Link to home
Start Free TrialLog in
Avatar of Steve Bink
Steve BinkFlag for United States of America

asked on

Joomla 2.5 alternate layouts for category

I'm a competent PHP programmer, but fairly new to Joomla and its voodoo ways.

I have a category named "tuesday-archive".  I have a series of old newsletter pages, each of which is an article belonging to that category.  I also have a module (type "Articles Category") which generates a list of all articles belonging to the tuesday-archive category.  I have an article (call it the "list" page) which renders that module.  My menu item points to the list page, which is assigned to a different category.

The overwhelming majority of these old newsletters came with their own full-page HTML, so displaying them in my site's current template is inappropriate.  I need to display them in a "blank" template.  I created an alternate layout by creating a very simple template file and saving it as /templates/mytemplate/html/com_content/category/news-archive.php.  The content is extremely basic:
<html>
  <head>
    <jdoc:include type="head" />
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/mytemplate/css/template.css" type="text/css" />
  </head>
  <body>
    <jdoc:include type="component" />
  </body>
</html>

Open in new window


When I go the category "tuesday-archive" in the category manager, under "Basic Options", I can see news-archive as a selectable option in the Alternate Layout drop-down.  It is selected, but browsing to one of the newsletter articles continues to use the full template for the site.  

In my research, I've found that the alternate layout assignment at the category level will not be applied if a menu item pointing to the category exists.  That is not the case here - the menu item is pointed at the list page, which is assigned to a different category.  Still, if I assign the alternate layout to that menu item instead of the category, then the destination list page, and all the archived articles, will use the alternate layout as directed.  This would be great, except the list page does need the normal site template.

What do I need to do to assign an alternate layout to any article belonging to a specific category, and be able to arrive there from normal menu navigation?
SOLUTION
Avatar of lenamtl
lenamtl
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steve Bink

ASKER

I engineered my own solution.