wisbin Posted November 7, 2009 Share Posted November 7, 2009 In the category-tree-branch.tpl there is a conditional style element attached to the links, via So when the current link is on, the menu item gets the selected style via conditional code {if $node.id == $currentCategoryId}I would like to do that to my CMS pages/info menu links too, but I cant get it to work.This is what i am trying: {foreach from=$cmslinks item=cmslink} {$cmslink.meta_title|escape:htmlall:'UTF-8'} {/foreach} I have no idea what variables to use here, but $node.id == $cmslink.id doesnt work.Anybody?thanks Robbin Link to comment Share on other sites More sharing options...
rocky Posted November 8, 2009 Share Posted November 8, 2009 Topic merged Link to comment Share on other sites More sharing options...
rocky Posted November 8, 2009 Share Posted November 8, 2009 Unfortunately, it is not quite that simple. You need to modify modules/blockinfos/blockinfos.php and add this code just before line 110 (the call to blockinfos.tpl): $smarty->assign('currentId', $_GET['id_cms']); then you can write this in blockinfos.tpl: {foreach from=$cmslinks item=cmslink} {$cmslink.meta_title|escape:htmlall:'UTF-8'} {/foreach} Link to comment Share on other sites More sharing options...
b3tw33n Posted December 8, 2009 Share Posted December 8, 2009 ah this was so promising. I tried this but it didn't work. i have my info block in my left side column. i would also like the "selected" condition to apply, but i can't get it to work. is there something different that must be done if it's in the left side menu? many thanks. Link to comment Share on other sites More sharing options...
rocky Posted July 29, 2010 Share Posted July 29, 2010 I know this is an old thread, but I just had to do this for a client and found a solution. I changed lines 107 of modules/blockinfos/blockinfos.php from: $smarty->assign('cmslinks', $id_cms ? CMS::getLinks($cookie->id_lang, $id_cms) : array()); to: for ($i = 0; $i < sizeof($cmsLinks); $i++) $cms[$i]['link'] = $cmsLinks[$i]['link']; $smarty->assign('cms', $cms); then line 5-6 of modules/blockinfos/blockinfos.tpl from: {foreach from=$cmslinks item=cmslink} {$cmslink.meta_title|escape:html:'UTF-8'} to: {foreach from=$cms item=item} {$item.meta_title|escape:html:'UTF-8'} then I added the following to the /* Block CMS links */ section of global.css: #informations_block_left li.selected a { color: blue } Change blue to whatever colour you want the link to the current CMS page to be. Link to comment Share on other sites More sharing options...
holle75 Posted January 27, 2011 Share Posted January 27, 2011 Hi Rocky, it works 93 percent for me When i manualy (browser address) go to one of the cms pages the color is changing accordingly to my css. The links itself in the infoblock are not present (href is empty " " in the code) only the text. Any ideas?Ver. 1.3.2.3thank you in advanceH. Link to comment Share on other sites More sharing options...
rocky Posted January 27, 2011 Share Posted January 27, 2011 Did you add the code above to modules/blockinfos/blockinfos.php? That is supposed to add the links and pass them to blockinfos.tpl. Link to comment Share on other sites More sharing options...
holle75 Posted January 28, 2011 Share Posted January 28, 2011 Yes, i did exactly as you adviced. Everything is working fine except the links.bestH.the code i get f.e. for going manualy to zahlung-versand-garantie is: ..... Information Zahlung - Versand - Garantie Impressum ..... from line 102 blockinfos.php now looks like: ..... function hookLeftColumn($params) { global $smarty, $cookie; $cms = CMS::listCms($cookie->id_lang, $this->id); $id_cms = array(); foreach($cms AS $row) $id_cms[] = intval($row['id_cms']); for ($i = 0; $i < sizeof($cmsLinks); $i++) $cms[$i]['link'] = $cmsLinks[$i]['link']; $smarty->assign('cms', $cms); return $this->display(__FILE__, 'blockinfos.tpl'); } ..... and blockinfos.tpl like: <!-- Block informations module --> {l s='Information' mod='blockinfos'} {foreach from=$cms item=item} {$item.meta_title|escape:html:'UTF-8'} {/foreach} <!-- /Block informations module --> and Information Block is hooked in left column Link to comment Share on other sites More sharing options...
holle75 Posted January 31, 2011 Share Posted January 31, 2011 anybody?sorryH. Link to comment Share on other sites More sharing options...
holle75 Posted February 8, 2011 Share Posted February 8, 2011 ... in my case changing {foreach from=$cmslinks item=cmslink} {$cmslink.meta_title|escape:htmlall:'UTF-8'} {/foreach} to {foreach from=$cmslinks item=cmslink} {$cmslink.meta_title|escape:htmlall:'UTF-8'} {/foreach} in productinfos.tpl did the trick ( a professional helped me)no changes in blockinfos.phpbest Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now