Switch template based on category - Joomla! Forum - community, help and support
hi
i trying find way switch template based on category being viewed.
currently have add php in template output or remove html this:
this code job wondering if there simpler way of doing in backend, because it's not elegant solution. trying same thing in k2 have yet find in parameters allow this.
if isn't possible in base joomla build there extensions people recommend.
thanks in advance
i trying find way switch template based on category being viewed.
currently have add php in template output or remove html this:
code: select all
<?php
$db = &jfactory::getdbo();
$option = jrequest::getcmd('option');
$view = jrequest::getcmd('view');
$temp = jrequest::getstring('id');
$temp = explode(':', $temp);
$id = $temp[0];
if ($option == 'com_content' && $view == 'article' && $id)
{ $db->setquery('select cat.id #__categories cat right join #__content cont on cat.id = cont.catid cont.id='.$id);
$category_id = $db->loadresult(); //this current article’s category id
}?>
<?php if ($category_id == 19) { ?>
<?php echo "<div id='leftcol'></div>"; ?>
<?php } else { ?>
<?php echo "<div id='midcol'></div>"; ?>
<?php } ?> this code job wondering if there simpler way of doing in backend, because it's not elegant solution. trying same thing in k2 have yet find in parameters allow this.
if isn't possible in base joomla build there extensions people recommend.
thanks in advance
hmm's don't method @ all. if take @ www.bybe.net , view various pages see template change, way unpublish template on pages going template within administrator panel.
so lets have
menu > news >
it news theme1 > published
it news theme2 > unpublished
it news theme3 > unpublished
general news theme1 > unpublished
general news theme2 > published
general news theme3 > unpublished
hot news theme1 > unpublished
hot news theme2 > unpublished
hot news theme3 > published
so lets have
menu > news >
it news theme1 > published
it news theme2 > unpublished
it news theme3 > unpublished
general news theme1 > unpublished
general news theme2 > published
general news theme3 > unpublished
hot news theme1 > unpublished
hot news theme2 > unpublished
hot news theme3 > published
Comments
Post a Comment