4

So I'm a little confused by Joomla's Alternative Layout overrides.

I'm using Joomla 3.3

I have read all Joomla 3.x documentation, and have followed many tutorials without any luck.

So here are my template files:

enter image description here

Promo is the name of the alternative layout which I would like to activate for one of my Category Pages.

enter image description here

So it appears as an alternative layout without a problem.

Then I've gone ahead and made the menu item: enter image description here

However when I go on the page, it calls the blog.php override only and not the promo.php layout

What am I doing wrong here?

Moe
  • 4,744
  • 7
  • 28
  • 37

2 Answers2

6

Where is your promo.xml file? You should have one in the same directory where you have your promo.php file. The promo.xml file should be a copy of the blog.xml file located under the public_html/components/com_content/views/category/tmpl folder. You will only need to change the line:

<layout title="COM_CONTENT_CATEGORY_VIEW_BLOG_TITLE" option="COM_CONTENT_CATEGORY_VIEW_BLOG_OPTION">

to

<layout title="promo" option="promo">

And then when you create a menu item, choose its type to be promo.

itoctopus
  • 4,133
  • 4
  • 32
  • 44
  • Hi. I have done this and it works for some changes. Changes works on a custom portfolio_item.php that is attached to a menu item. When I click on a sub category link it uses the blog_item.php. Anyone who knows why? – Mr Rebel Aug 24 '15 at 15:30
1

To expand on @itoctopus, there are two different things, an alternative layout and an alternate menu layout. If you make a direct menu link you must use the latter. For this you need the xml file, and at that point it will show up in your list of menu options. Alternative layouts are applied to items and the do not show up in the menu options. The menu always overrides the item. There are some additional options you can play around with.

Elin
  • 6,507
  • 3
  • 25
  • 47