0

I have a Joomla 4 site; using Helix Ultimate Framework template.

I have an article and I need to link the same article from two different menu items and each menu item must use a different layout.

I started copying the templates/shaper_helixultimate/html/com_content/article/default.php file to templates/shaper_helixultimate/html/com_content/article/mylayout.php

I duplicated also the xml associated to it so that I defined the custom menu item type.

Then when I created a new menu item, and select the "Menu Item Type", I saw also my custom menu layout "My Layout". So I created two different menu items, the first that uses the default layout, the second that uses the mylayout layout. If I browse to the 2 different links they works correctly. So I made the same for other articles.

Now consider that I have also another menu item of type Blog Content Category. The Blog items, in the category page, resulted linked the the custom layout url, instead of the default one (I think because it is the last I defined) Is there a way so that in the blog content category view the system assign es the url defined in the menu item using default layout?

Kind regard, Matteo

2
  • Why not have 2 different articles with one menu item each one? Not the best path have 2 menu item for the same article. Commented May 10 at 19:10
  • I have some custom fields on these articles and some must be showed on the first type of page and the others on the second type of page; a lot of custom fields are always visible... so to avoid to duplicate articles I thought to use different layouts keeping only one article
    – agodoo
    Commented May 11 at 14:30

1 Answer 1

0

If you create two different templates and then assign each one to two different menu items with category blogs on them, then the articles should use the template you use for each blog menu item. Saves you having to create two articles. You can use a conditional on each custom field based on the menu item for each blog then (use the also on child items option).

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.