I have spent better time of a day trying to find a lesson on this, so I am turning to some pros for help. When you create content, menu, page it get stored somewhere in a file (I am assuming.) Where is that file? The example is that I installed clone menu module and cloned the main menu so that I can have links based on different pages with different menu items. It worked great except for my responsive them doesn't respond as like the original menu. After using Google inspector tools I found that div is different for the cloned menus. Changing the div to the original menu works like a charm and I can see it in the Google inspector. What I can't figure out is where that value is stored. I can see all of the CSS and JS files that apply. My question is how do I change an inputted code. I need to specifically change div id block-menu-menu-si-main-menu to something else. I have opened nearly every file in my sites folder and only see code that comes from the CSS and JS files. I don't see any php or html file that has specific code like this. I have also checked the database but can't find it either there.

Any help would be awesome.

Thanks.

Comments

VM’s picture

When you create content, menu, page it get stored somewhere in a file (I am assuming.)

Assumption incorrect. These things are stored in the database and the data is pulled and inserted dynamically into a theme file for rendering.

I don't have specific knowledge of the output of menu clone. If it were me, I'd research in the issue queue of the module in question. It seems to me that you would either need to alter the output before the clone, or override a function in the module generating the output so that it could be customized.

mmjvb’s picture

When you create content, menu, page it get stored somewhere in a file (I am assuming.)

Anything you create gets stored in some form somewhere in a file. A CMS like Drupal uses tables in a Database to store these objects. An abstraction layer to the files in the filesystem.

The CMS creates the HTML to be sent to your browser upon request. It doesn't exist in a file like with older sites not using a CMS (apart from caching, of course).

That does make it a little bit more difficult to find what is causing the difference. My understanding is that the ID you mentioned is calculated to make it unique. See modules/block/block.tpl.php. Sounds like you would need specific classes instead.

Sorry, don't know enough of D7 to help you find a solution, maybe Clone Menu can help you.

John_B’s picture

Using Menu clone does not reproduce the block's div id. The block's div id is automatically generated from the machine name for the block. When you create a menu it creates (1) a block to put the menu in; and (2) a menu. Each gets its own id. Making a new menu might get a different block id and menu id than the menu you are copying, regardless of whether you do it by hand, or use Menu clone to import the data. The solution is to change the machine name of the menu when you first set it up, before you use Menu clone to imort the links. It may be possible to change the machine retrospecctively in the menu admin screen. The Drupal convention is as folows: if you set the machine name to, for example, 'my_unique_id' the CSS id will be auto-generated as 'id="my-unique-id"'.

These basic concepts are already covered in the documentation: you can start here https://www.drupal.org/docs/7/understanding-drupal/general-concepts and look through the documentation, then ask again for anything not covered in the documentation. Drupal is a very complex system, and trying to work on it hoping that it is intuitive will lead to a lot of frustrations so spending some time (? a few months) studying the documentation and tutorials is unfortunatey necessary to get the best out of it.

It is possible to override the auto-generated ID I described above. That is a bit more complex, and is found in the theming guide in the documentation. It may be best to get spend time getting general overview of Drpual before moving on to that, which you will only need if there is some good reason why you cannot change the machine name of the menu and hence the block which the menu lives in.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors