Alternative Layout to Layouts

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
User avatar
Helvecio
Joomla! Explorer
Joomla! Explorer
Posts: 468
Joined: Wed Oct 10, 2007 2:29 pm
Location: Rio de Janeiro - Brazil
Contact:

Alternative Layout to Layouts

Post by Helvecio » Sat Aug 01, 2015 3:39 pm

Is it possible to create an alternative layout - not an override - from the following file:

layouts > Joomla > content > blog_style_default_item_title.php

I know how to create an alternative layout from component, modules and plugins, but I'm not sure if I can do the same with Layouts. And I know I can override this file. BUT, I don't this override to be applied to all instances of blogs of my site, only to one section.

Thanks
Helvecio "Elvis" da Silva
Graphic and Web Designer
Joomla Website Developer
http://hlvc.design

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 28204
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: Alternative Layout to Layouts

Post by imanickam » Sat Aug 01, 2015 6:32 pm

Yes, you could do that. But, you have to call the new layout instead of the old layout in your code. Also, this could be implemented at the template level.

As in your case, if you want to create an alternate layout for layouts > Joomla > content > blog_style_default_item_title.php, let us assume that you are using the Protostar template, following would be the steps you would take.

(a) Create a new layout file, say blog_style_default_item_title_mine.php, in the directory \templates\protostar\html\layouts\joomla\content.

(b) Create the HTML overriding file for the file blog_item.php that is available in the directory \components\com_content\view\tmpl in the directory \templates\protostar\html\com_content\category

(c) In the overriding file created, change the following line of code to point to the new layout file.

Code: Select all

<?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title', $this->item); ?>
With the code change, the new line of code would be

Code: Select all

<?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title_mine', $this->item); ?>
Hope this helps.

Note: The same concept could be incorporated in the Alternative Layouts as well.
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Joomla! Core - Tamil (தமிழ்) Translation Team Coordinator
Former Joomla! Translations Coordination Team Lead
Eegan - Support the poor and underprivileged

User avatar
Helvecio
Joomla! Explorer
Joomla! Explorer
Posts: 468
Joined: Wed Oct 10, 2007 2:29 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Alternative Layout to Layouts

Post by Helvecio » Sun Aug 02, 2015 1:49 pm

Thank you so much MIG!!!!!!!!

To make it work as I needed, I had to create a custom menu item.

Without your help I wouldn't have figured it out.

Best regards!
Helvecio "Elvis" da Silva
Graphic and Web Designer
Joomla Website Developer
http://hlvc.design


Locked

Return to “Templates for Joomla! 3.x”