As for selecting a category, in functions_url file I found similar logic, but couldn't figure out the correct syntactic for selecting specific category, could you give me a hint, please?
{if ($categories == 'mycategory') } class="tabs-selected"{/if}
Offline
VDigital wrote:
Could you try $this in state of $template or $smarty?
{php}
global $page;
$this->assign($page['section'], 'tabs-selected');
{/php}
Great job ^^ !
for a specific category it's a bite complexe
Offline
flop, I agree VDigital gave great solution =) Only thing left is to figure out how to do same thing with categories. I am ok hard coding the names, just trying to figure out the syntax.
If you could help, I would appreciate it =)
Offline
By example, append to your header.tpl
{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} {html_head} <script type="text/javascript"> $(document).ready(function(){ldelim} $("#mbCategories ul li.selected").parent('ul').parent('li').eq(0).addClass('selected'); /* select parent */ $("#mbCategories ul li.selected").parent('ul').parent('li').eq(0).addClass('selected'); /* select grandparent */ $("#mbCategories ul li.selected").parent('ul').parent('li').eq(0).addClass('selected'); /* select great-grandparent */ }); </script> <style> #menubar #mbCategories li.selected > a {ldelim} font-weight:bold; } </style> {/html_head}
This sets 3 upper-levels in bold.
Offline
{if $cat.SELECTED}class="tabs-selected"{/if}
This is what I was looking for, kinda...it wouldn't work in my case, because I don't call categories as array. =/
Offline
Do you have a link in order to see what exactly you want for the categories please ? Maybe by private message
Offline
could you try that :
{php}
$findme = 'premium';
$pos = strpos($_SERVER["REQUEST_URI"], $findme);
if ($pos !== false) {
$this->assign('premium_tab', 'tabs-selected');;
}
[repeat for other tabs]
{/php}
and then as usual
{if isset ($premium_tab) } class="{$premium_tab}" {/if}
Offline
flop25,
Thank you very much! It worked perfectly!
Offline
I'm happy to see a user happy ^^
Can I suggest you to improve some details like "if it is home then <div class="content" style="margin-left:0"
Your website is really great Good luck for your business
Offline