joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

Options for exclude module from child page

Open carlitorweb opened this issue 8 months ago • 5 comments

Pull Request for #42385

Summary of Changes

Move the assignment of modules from #__module_menu to the new menu_assignment in #__modules. Now the menu assignment section for a module will have 2 new options for exlude child pages. For joomla updates there wil not be any visual change, since all assigned modules in #__module_menu will be copy to menu_assignment.

Testing Instructions

Preparation steps

  • This pull request make some changes in the database, you will need to update an existing joomla site with the prebuilt package. The faster way, just copy the sentences and execute it directly in your sql client (just do not forget to adjust the prefix #_). Minimum you need execute the follow:
ALTER TABLE `#__modules` ADD COLUMN `menu_assignment` text;
  • Apply the patch if you did not used the prebuilt package update

Administrator -> Site Modules

  • The column "Pages", need have the exact same values you have before. If you only executed the minimum sql sentence, then will show for all modules "None" and that is expected.
  • Filter by some Menu Item
  • Order by pages in asc/desc
  • Create/Delete a module
  • Batch a module. In both case (move/copy) check the assigned menu items stay in their position.

Administrator -> Site Modules -> Edit a module

  • Go to the tab Menu Assignment and choose a module assigment option. Save and check these options remain as you edited.
  • Save and close. Repeat Administrator -> Site Modules test

Administrator -> Menus -> Edit a menu item

  • Go to the tab Module Assignment and check the Display column show the correct tag about what module is assignment or not to the menu.
  • Turn on/off the Unassigned Modules toggle and check the module hide or shown according with yoru selection.
  • Delete a menu item (make sure first is assigned to a module). Open the module and check the menu assignment is working. If you ca also in the #__modules table, search the menu_assignment value for this module and check the menu item id you just deleted, do not show up inside the assigned menu item array.

Frontend

  • Check if the current modules you have are working as before.
  • Edit a module and set as menu assignment one of the two new values, On all pages except those selected (do not include child pages) or Only on the pages selected (do not include child pages) . One way to test it, first assign a menu item to a parent category. Create a new category as child of this one. Then create a article inside this child category. Go to the frontend and check the module show up inside the parent category view, but not in the child category view or the article view.

Actual result BEFORE applying this Pull Request

All work as expected

Expected result AFTER applying this Pull Request

All work as expected. But now you can choose that do not render a module in child pages.

Link to documentations

Please select:

  • [x] Documentation link for docs.joomla.org: Chunk4x:Menu Assignment
  • [x] No documentation changes for manual.joomla.org needed

carlitorweb avatar Jun 02 '24 07:06 carlitorweb