3

I'm working on a website with ~100 menu items (type is "Single Article"). Each menu item has it's own, unique settings under the "Options" tab:

enter image description here

This obviously overrides the global settings, but I want to set it back to "Use Global" in order to control the settings from "Global Settings" in the article manager and have all articles look the same.

Is it possible to set "Use Global" for all options in all menu items at once?

My first thought is to use a MySql query, but I'm not sure how it should be written and what database entry I should change.

3 Answers 3

2

Use this at your own risk:

UPDATE jos_menu SET params = CONCAT('{"show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_hits":"","show_tags":"","show_noauth":"","urls_position":"",', SUBSTR(params, POSITION('"menu-anchor_title"' IN params))) WHERE `link` like "index.php?option=com_content&view=article&id=%"
  • Replace jos with your Joomla table prefix.
  • As FFrewin said, "Don't try this on a live website - and always have a backup of the database, before operating mass updates directly on it."

Update

The query worked on a Joomla 3.3.3 test environment.

4
  • I was just testing this, and it seems working
    – FFrewin
    Commented Sep 3, 2014 at 20:52
  • @FFrewin In fact it won't work if the params column is empty, or has different order and usually this happened when the table is edited manually for example by phpMyAdmin.
    – Farahmand
    Commented Sep 3, 2014 at 21:36
  • @ Fari: yes this is true, it can really mess the content of the field in a such case.
    – FFrewin
    Commented Sep 3, 2014 at 21:38
  • I forgot to mention that the query may not work on Joomla 2.5.
    – Farahmand
    Commented Sep 3, 2014 at 21:45
1

Just did this with joomla 3.7, only needed to change one param. here is the code i used successfully:

update xxx_menu set params = replace(params,'"show_page_heading":"1"','"show_page_heading":"0"') where params like '%"show_page_heading":"1"%'

I tested it with a where clause for one menu id first to be sure it worked, and of course backed up everything first! Hope this helps someone.

0

In PHPmyAdmin you can write something like below:

UPDATE `#__menu`
SET `params` = '{"show_title":"","link_titles":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_vote":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_hits":"","show_tags":"","show_noauth":"","urls_position":"","menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_text":1,"page_title":"","show_page_heading":0,"page_heading":"","pageclass_sfx":"","menu-meta_description":"","menu-meta_keywords":"","robots":"","secure":0}'
WHERE `link` LIKE 'index.php?option=com_content&view=article&id=%'

Notes:

  • In the update statement use the db prefix of your table.
  • The SET params take the values for the menu item options. To set any parameter to the default setting, you just need to pass an empty value, e.g. "show_title":"". Check each param to make sure you that you have the desired setting.
  • WHERE link LIKE 'index.php?option=com_content&view=article&id=%' is used to find only the single article items.
  • Don't try this on a live website - and always have a backup of the database, before operating mass updates directly on it.

Update:

Thanks to Fari comment, Be Aware: This query will also affect params like Meta Description, Meta Keywords, Page Class, Browser Page Title & etc...

2
  • 1
    The query you mentioned changes params like Meta Description, Meta Keywords, Page Class, Browser Page Title & etc. as well as all the parameters under the "Options" tab.
    – Farahmand
    Commented Sep 3, 2014 at 7:17
  • Yep it does - good point, I didn't take this into consideration.
    – FFrewin
    Commented Sep 3, 2014 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.