Page 1 of 1

Use a different layout for different articles, (single view)

Posted: Tue Sep 14, 2010 8:16 pm
by thomasevans08
Hello I am still fairly new with the Joomla system. I have done a fair amount of reading on how to make custom views via overrides, however I am trying to have two different layouts for an article view for example one being "default.php" and the other being "review.php". I am trying to find a way to have certain articles assigned with a parameter to use the default.php layout and other articles to use the review.php layout I have created.

Would anyone know how to do this?

Re: Use a different layout for different articles, (single v

Posted: Tue Sep 14, 2010 9:04 pm
by stutteringp0et
Say you have 2 layouts for your view (totally within the parameters of how joomla operates).

The first layout is: default.php and that is the normal article layout.
The second layout is: review.php - you created this one.

When viewing your article in the default view, adding "layout=review" to the URL will display the review.php layout. Even with SEF enabled.

The normal, default layout
http://yoursite.com/articletitle.html

The review layout
http://yoursite.com/articletitle.html?layout=review

Re: Use a different layout for different articles, (single v

Posted: Tue Sep 14, 2010 9:22 pm
by thomasevans08
Thank you that information was indeed helpful, this fundamental way of linking does offer me a way of displaying the articles in a different layout.
However I was also wondering if there was a way to create a parameter for the article content that the author could use to select from the two different layouts.

Is that a possibility?

Re: Use a different layout for different articles, (single v

Posted: Wed Sep 15, 2010 12:06 am
by stutteringp0et
You could build it into your override scripts