same file with primary menu html code loaded in all site pages

2 replies · opened Apr 26, 2016

CCommunity (archived)Apr 26, 2016

hi, I'm beginning with Canvas theme.
I would like to know if there is a way to have only one file that contains the primary menu html code that is loaded in all my site pages (so I can change only one code...).
Can I use php code to do it (include...), or chanching .html to .php extention will brake internal links?
Thanks in advance!

SSemicolon WebSTAFFApr 27, 2016

Hello,

This is Definitely Possible and you can have a Centralized File for the Menu and this can be achieved easily using PHP. Please use the following steps:

  1. Firstly, you will need to change the .html Extension of your files to .php .

  2. Secondly, create a File named menu.php and add the Menu Code to it.

  3. Then, include this file in the Primary Menu Area. Example:


    

Also, make sure that you change the Menu Links extension from .html to .php .

This will definitely work fine. Let us know if we can help you with anything else or if you find any issues.

WWebink74Apr 12, 2017

Hello,

I was trying to achieve it with my files but not with PHP.
My issue is that the dynamically added classes like for instance 'sf-with-ul' are not added, so the sub-menu or mega-menu are not recognized because, I think it is loaded after the specifics functions that are managing it.
Could you help with this?

PS : I am trying to achieve it also for the footer

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard