Override styles

GK User
Wed Oct 27, 2010 6:21 pm
Hi team,
How can I use different style for different menu item using override feature for T3 template?
Eg: style 1 for home page and style 2 for a different menu item.

Thanks in adv,
Cheers
User avatar
Gold Boarder

GK User
Thu Oct 28, 2010 7:45 am
there is several post about posting different menu's ... the easiest way is to take a copy of the template and make the changes needed, and then publicate it where you want the new one...
User avatar
Platinum Boarder

GK User
Thu Oct 28, 2010 9:39 am
Thanks for your answer. I know that this option is the easiest way to do that, but I'm asking it because as you know T3 framework give us the possibility to override different layout template for different menu item, for example, simply adding a line inside the configuration panel of the template Eg: 385=column1 if we want to apply a single column layout to the menu item with ID=385.

Now, my question is: Can we do the same with styles (color, images, etc...) instead layout ?

Thanks to anyone can answer.

Cheers.
User avatar
Gold Boarder

GK User
Fri Oct 29, 2010 8:42 am
good point, i don't know - but hopefully some other gavick member knows...
User avatar
Platinum Boarder

GK User
Sat Oct 30, 2010 2:23 pm
Any suggestions from Gavick's programmers?

Thanks
User avatar
Gold Boarder

GK User
Sat Oct 30, 2010 3:20 pm
Use this

Code: Select all
<body class="page<?php echo JRequest::getInt( 'Itemid' )?>">


this function call item id and add class to body, then you can edit personal css for each page

Code: Select all
body.page1 {...}
body.page2 {...}
body.page3 {...}
body.pageN {...}
User avatar
Fresh Boarder

teitbite
Sun Oct 31, 2010 8:38 am
Hi

I believe that the question was about the menu itself and styling the elements. You can set the class suffix for each menu item so this way You can be able to change the required element as You wish via css.
User avatar
Moderator

GK User
Mon Nov 01, 2010 2:20 pm
Hi guys,
thank to all of you for your reply. I've found a quick solution for this issue using the T3 features.

Here the solution for everyone want to apply different stylesheet for different menu item. Eg: in sporter template we want to use style2 (brown) for menu item with ID=24.

1) Open the file default.php located in /templates/gk_sporter/layouts

2) Modify the line $this->loadBlock('head'); with this code $this->loadBlock('style2');

3) Save the file as style2.php and upload it in /templates/gk_sporter/layouts

4) Open the file head.php located in /templates/gk_sporter/layouts/blocks

5) Modify the line $document->addStylesheet($this->templateurl() . '/css/style'.$template_style.'.css'); with this code $document->addStylesheet($this->templateurl() . '/css/style2.css');

6) Save the file as style2.php and upload it in /templates/gk_sporter/layouts/blocks

7) Go to control panel template under PRESETS and add the following line into the text box. 27=style2

Now, when you click on menu item with ID=27 will be applied the style2 (brown).

Cheers
User avatar
Gold Boarder


cron