0

I have a website (not made by me, working on restyling) that manage achitect pubblications and every architect have page with own menu with Home - Bio - Project 1 - Project 2 and so on. And i have modules (bio and projects) assigned to Home. Now i have something like 580 Bio modules and i would like to remove them only from Home of architect page. Is there anyway to do that in "automatic way"? Or i have to open every single module and remove assignment from home menu item?

Joomla 3.9.2 installed

Thank you

Code that unset module assignment on page that you want

    DELETE FROM dbprefix_modules_menu
    WHERE menuid = HOME_PAGE_ID
    AND moduleid IN ( SELECT moduleid FROM (
                          SELECT mm.moduleid 
                          FROM dbprefix_modules_menu AS mm 
                          WHERE mm.moduleid = MODULE_ID ) tempTable                     
                     )

Replace dbprefix with your real database prefix. Replace HOME_PAGE_ID and MODULE_ID with their corresponding values from the ID column of the Menu Items manager, look at the attached screenshot.

  • Working solutions should not be posted in the question as an edit. Please either ask to edit the answer with the corrected sql ( or edit the answer without asking), or post a new, complete, explained answer. – mickmackusa Jan 29 at 20:39
  • Ok, i'll wait until he edit his answer and remove it form here. – Elmir84 Jan 29 at 20:53
0

RECOMMENDED:
BACKUP your website, and test it on the backup website doing this action to the live website.

This can be done using SQL, if you can access phpMyAdmin, or any database access to run an sql statement, try this statement:

DELETE FROM dbprefix_modules_menu
WHERE menuid = HOME_PAGE_ID
AND moduleid IN ( SELECT moduleid FROM (
                      SELECT mm.moduleid 
                      FROM dbprefix_modules_menu AS mm 
                      WHERE mm.menuid = BIO_PAGE_ID ) tempTable                     
                 )

Replace dbprefix with your real database prefix.

Replace HOME_PAGE_ID and BIO_PAGE_ID with their corresponding values from the ID column of the Menu Items manager, look at the attached screenshot.

enter image description here

  • I used the query but it returns error: #1093 - Table 'c80m4_modules_menu' is specified twice, both as a target for 'DELETE' and as a separate source for data – Elmir84 Jan 28 at 11:41
  • @Elmir84 I have modified the query, give it another try. – Mohamed Abdelaziz Jan 28 at 18:41
  • Ok i tried and it was removing a menu assigned on that page and not module assigned to that page, i changed it in last row, check my question with working code. Thank you a lot for help :) – Elmir84 Jan 29 at 20:19
  • Could yu edit please your answer so i'll delete it from answer. thx – Elmir84 Jan 29 at 20:53
  • @Elmir84 I think there is a misunderstanding, I will have a look later – Mohamed Abdelaziz Feb 1 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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