Alternative Layouts in 1.6
1.6 is so amazing, really. I've said all along that it will be a webmaster's release and I really think it is. Mostly people have paid attention to ACL but there are lots of other great details. One of the coolest features is the new alternative layout option.
We all know that in 1.5 you could do a layout override. Which is awesome, but also frustrating because of how it is "all or nothing." That is if you use a template with an override you always have to use the override. If you wanted the core layout for something you needed to go through a song and dance. No more!
In 1.6 items and categories (should) have a parameters that lets you select any alternative layout from either the core or the default template. So in my example, I'm going to use an alternative layout for the weblinks category view.
Just as in 1.5 I put my layout files in the /html/com_weblinks/category folder. But instead of caling it default.php, I'm calling it newlinks.php (sub layout template naming works the same as always). Only now. ... I get the option to pick what layout I want.
I made a simple override where I just moved the name of the category to the bottom of the page. An voila! here is how it looks:
If you want to try this at home, right at this moment you need to apply two simple (easy to apply by hand) patches that are in the Tracker:
Those patches will make the weblinks category work. I'm going to spend some time today making sure that the same issues aren't elsewhere.
A few things to note. First these apply to items not menu items. So you can't at this point have multiple layouts for the same exact item if for some reason that is something you want. Secondly, as of now there is no way to set this globally. So if you always want to use an alternative layout you'll have to select it each time--but if you really mean that, you should probably do default anyway.
Alternative layouts use the componentlayout field in JForm and it's just one indication of the tremendous impact that JForm is going to have for Joomla! users.



Sat 02 Oct 2010 13:52:23 CDT
Sat 02 Oct 2010 13:52:38 CDT
Sat 02 Oct 2010 17:30:50 CDT
Sun 03 Oct 2010 03:34:05 CDT
Sun 03 Oct 2010 13:38:41 CDT
Mon 04 Oct 2010 14:24:07 CDT
Tue 16 Aug 2011 10:08:46 CDT
Wed 17 Aug 2011 01:08:01 CDT