Where in the database are the individual module and menu item template assignments stored?

Need help with the Administration of your Joomla! 5.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
GillianBPP
Joomla! Explorer
Joomla! Explorer
Posts: 405
Joined: Wed Oct 01, 2014 10:25 am

Where in the database are the individual module and menu item template assignments stored?

Post by GillianBPP » Fri Jun 14, 2024 2:48 pm

I have a new custom template, which is slightly modified copy of another custom template - which I have uninstalled and deleted - but all the modules are assigned to the same positions as in the old template and all the position names in both templates are identical.

I want to globally change all references to the old template to the new template. I thought I would be able to do this with a database query, but when I looked under the table [abcde]_modules there is no mention of the template.

Similarly for menus: For example, a menu item URL currently looks like this:

index.php?option=com_content&view=category&layout=[oldtemplate]:concerts&id=12

Despite the old template having been uninstalled and all its files having been double-checked that they are no longer there, they still appear in menu URLs.

but I want to change it - and many others - to:
index.php?option=com_content&view=category&layout=[newtemplate]:concerts&id=12

If you look in the database in phpMyAdmin under [abcde]_menu no mention is made of the template assignment.

Also, where I had created xml files in the old template for new menu item types, they are still showing under 'Articles' as options, which they shouldn't be.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2813
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Where in the database are the individual module and menu item template assignments stored?

Post by ceford » Fri Jun 14, 2024 8:14 pm

#__modules_menu perhaps!

GillianBPP
Joomla! Explorer
Joomla! Explorer
Posts: 405
Joined: Wed Oct 01, 2014 10:25 am

Re: Where in the database are the individual module and menu item template assignments stored?

Post by GillianBPP » Sat Jun 15, 2024 2:02 pm

ceford wrote: Fri Jun 14, 2024 8:14 pm #__modules_menu perhaps!
Nope - there are just two columns there: 'moduleid' and 'menuid'. No mention of template positions.


GillianBPP
Joomla! Explorer
Joomla! Explorer
Posts: 405
Joined: Wed Oct 01, 2014 10:25 am

Re: Where in the database are the individual module and menu item template assignments stored?

Post by GillianBPP » Sat Jun 15, 2024 3:58 pm

Thank you. I know how to change module assignments manually. It would seem that the modules have settled down after the server cache cleared overnight.

What I am still getting, however, is menu items assigned to custom menu item types from a template that no longer exists and, therefore, does not display correctly. It seems I'm going to have to change these manually. This is what I see when I click on a menu item that used to use a custom menu item type (a category blog showing only fields). In the list of menu items it now says 'category' but in the menu item setup the type is blank and it shows the old template (toccata):
old-template-link.jpg
I'd still like to know where in the PHP database the information for which menu item is assigned to which template style is stored or which item type is selected so I can do a global update. I really don't want to have to change all the menu items one by one. A search of the database for 'toccata' returns nothing.
You do not have the required permissions to view the files attached to this post.

GillianBPP
Joomla! Explorer
Joomla! Explorer
Posts: 405
Joined: Wed Oct 01, 2014 10:25 am

Re: Where in the database are the individual module and menu item template assignments stored?

Post by GillianBPP » Sat Jun 15, 2024 4:05 pm

Update: I was wrong: the menu item links are in the abcde_menu table. However, when I type in 'toccata' as a filter, nothing is found, so I need to work on phpMyAdmin a bit more.

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2813
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Where in the database are the individual module and menu item template assignments stored?

Post by ceford » Sat Jun 15, 2024 4:20 pm

Did you look in #__modules_menu ? You may have modules linked to menus that do not exist.

GillianBPP
Joomla! Explorer
Joomla! Explorer
Posts: 405
Joined: Wed Oct 01, 2014 10:25 am

Re: Where in the database are the individual module and menu item template assignments stored?

Post by GillianBPP » Sat Jun 15, 2024 4:38 pm

ceford wrote: Sat Jun 15, 2024 4:20 pm Did you look in #__modules_menu ? You may have modules linked to menus that do not exist.
Actually, I couldn't find 'toccata' when I used the 'filter rows' option at the top of the table, but if I used the search tab and then under 'link' changed the criteria to "LIKE %...%" and then typed in 'toccata', I got all the menu items containing the toccata template ref. Hurrah! Easy to change here and quicker than doing it in Joomla, as I only have to change the name of the template to the new one and all the other settings - such as the selection of category, layouts, etc - remain as they were.


Post Reply

Return to “Administration Joomla! 5.x”