- Posts: 4
- Thank you received: 0
Frontpage for category, doesn't work well [Fixed]
-
osearcaigh
Inactive member -
Topic Author
- New Member
-
Less
More
11 years 8 months ago - 11 years 8 months ago #31336
by osearcaigh
Frontpage for category, doesn't work well [Fixed] was created by osearcaigh
I'm using Kindergarten as the template for a category. I want the lovely frontpage graphics to be the 'frontpage' of this category, however when I assign it as a menu link it appears differently than when I use it as the true frontpage. I've added the 5 blank DIV's with their respective IDs which run the center module on the demo. The background has some features of the category view of the template though - is there a way to replicate the frontpage view of the template when the area I want to use it for isn't a true Joomla frontpage?
Last edit: 11 years 8 months ago by osearcaigh. Reason: Marked as fixed
Please Log in to join the conversation.
-
ivan.milic
Support Staff -
- Moderator
-
Less
More
- Posts: 14116
- Thank you received: 1639
11 years 8 months ago #31342
by ivan.milic
Replied by ivan.milic on topic Frontpage for category, doesn't work well
When on front page template inserts "sparky_home" class to body tab on other pages it's sparky_inner.
If you open index.php of template you will find this :
<body<?php if ($menu->getActive() == $menu->getDefault()) { echo ' class="sparky_home"'; }else{ echo ' class="sparky_inner"'; } ?>>
so you could just replace sparky_inner with sparky_home for else block to force it always behave like that.
If you open index.php of template you will find this :
<body<?php if ($menu->getActive() == $menu->getDefault()) { echo ' class="sparky_home"'; }else{ echo ' class="sparky_inner"'; } ?>>
so you could just replace sparky_inner with sparky_home for else block to force it always behave like that.
The following user(s) said Thank You: osearcaigh
Please Log in to join the conversation.
-
osearcaigh
Inactive member -
Topic Author
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
11 years 8 months ago #31356
by osearcaigh
Replied by osearcaigh on topic Frontpage for category, doesn't work well
Thanks Ivan, that helped a lot.
For others who may need this solution, I wanted the template to display as it would for a front page except I was using a single article layout menu item. In the template's index.php file I replaced:
with and if/else:
where $currentMenuId is the Itemid you see in the URL when you're on the page you want to template.
For others who may need this solution, I wanted the template to display as it would for a front page except I was using a single article layout menu item. In the template's index.php file I replaced:
Code:
<body<?php if ($menu->getActive() == $menu->getDefault()) { echo ' class="sparky_home"'; }else{ echo ' class="sparky_inner"'; } ?>>
with and if/else:
Code:
$currentMenuId = JSite::getMenu()->getActive()->id ;
if ($currentMenuId==9999) {
echo '<body class="sparky_home">';
}else{
echo '<body class="sparky_inner">';
}
where $currentMenuId is the Itemid you see in the URL when you're on the page you want to template.
Please Log in to join the conversation.
Time to create page: 0.152 seconds