Fashionist Posted September 26, 2014 Share Posted September 26, 2014 Hi all, how to add some links to category module?? I have attacched pic Link to comment Share on other sites More sharing options...
vekia Posted September 27, 2014 Share Posted September 27, 2014 this module generates links based on categories. is not possible (in back office) to add links there. if you want to add new links it will be necessary to alter module .tpl file blockcategories_footer.tpl to <ul> elements just add new <li> with link (<a>) <li><a href="http://linktosomewhere.com">{l s='my link' mod='blockcategories'}</a></li> Link to comment Share on other sites More sharing options...
Fashionist Posted October 3, 2014 Author Share Posted October 3, 2014 (edited) Hmmmm I have not understand well. So for example: <ul> category name I want to add <li><a href="http://linktosomewhere.com">{l s='my link' mod='blockcategories'}</a></li> </ul> ???? Sorry but I'm not a programmer Edited October 3, 2014 by Fashionist (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 3, 2014 Share Posted October 3, 2014 don't use <ul> just paste code: <li><a href="http://linktosomewhere.com">{l s='my link' mod='blockcategories'}</a></li> for example here: <ul class="tree {if $isDhtml}dhtml{/if}"> {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $smarty.foreach.blockCategTree.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child} {/if} <li><a href="http://linktosomewhere.com">{l s='my link' mod='blockcategories'}</a></li> {if ($smarty.foreach.blockCategTree.iteration mod $numberColumn) == 0 AND !$smarty.foreach.blockCategTree.last} </ul> Link to comment Share on other sites More sharing options...
Fashionist Posted October 5, 2014 Author Share Posted October 5, 2014 I have addedd but in the categories module block I can't see them Hmmmmmm why this??? Link to comment Share on other sites More sharing options...
fmilland Posted October 8, 2014 Share Posted October 8, 2014 (edited) Same Issue here, I've tryed to deleted cache, but the custom link does not appear: this is my categoriesblock.tpl code: {if $blockCategTree && $blockCategTree.children|@count} <!-- Block categories module --> <div id="categories_block_left" class="block"> <h4 class="title_block">{if isset($currentCategory)}{$currentCategory->name|escape}{else}{l s='Categories' mod='blockcategories'}{/if}</h4> <div class="block_content"> <ul class="tree {if $isDhtml}dhtml{/if}"> {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $smarty.foreach.blockCategTree.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child} {/if} {/foreach}<li><a href="http://linktosomewhere.com">My Link</a></li> </ul> {* Javascript moved here to fix bug #PSCFI-151 *} <script type="text/javascript"> // <![CDATA[ // we hide the tree only if JavaScript is activated $('div#categories_block_left ul.dhtml').hide(); // ]]> </script> </div> </div> <!-- /Block categories module --> {/if} Edited October 8, 2014 by fmilland (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 8, 2014 Share Posted October 8, 2014 what files you guys changed? located in module directory, or in theme directory? Link to comment Share on other sites More sharing options...
fmilland Posted October 8, 2014 Share Posted October 8, 2014 I was making changes in module directory instead of theme directory, my mistake, now it works! Thanks vekia. Link to comment Share on other sites More sharing options...
Fashionist Posted October 9, 2014 Author Share Posted October 9, 2014 I have done so but I have some repeating of the same link...why this? There's my code: <!-- Block categories module --> <div class="row"> <div class="footer-container col-md-12 clearfix"> <div class="col-xs-12 col-sm-3"> <h3>{l s='Categories' mod='blockcategories'}</h3> <ul class="tree {if $isDhtml}dhtml{/if}"> {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $smarty.foreach.blockCategTree.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child} {/if} <li><a href="http://www.acquistarevinionline.com/riduzione-prezzi">{l s='offerte' mod='blockcategories'}</a></li> <li><a href="http://www.acquistarevinionline.com/produttori">{l s='produttori' mod='blockcategories'}</a></li> {if ($smarty.foreach.blockCategTree.iteration mod $numberColumn) == 0 AND !$smarty.foreach.blockCategTree.last} </ul> <ul class="tree {if $isDhtml}dhtml{/if}"> {/if} {/foreach} </ul> </div> <!-- /Block categories module --> Link to comment Share on other sites More sharing options...
Fashionist Posted October 11, 2014 Author Share Posted October 11, 2014 Up!!! Link to comment Share on other sites More sharing options...
mikewra Posted December 25, 2014 Share Posted December 25, 2014 When I tried placing the link where vekia suggested, I got the new link repeating after each of the links already there. I think that is what Fashionist was complaining of. I can't read php (well) but it looks like placing it there interrupts a loop. Placing the new link above the foreach works. Here's the relevant code from root->themes->my theme->modules->blockcategories-> blockcategories_footer.tpl and the new link is the one for manufacturer <div class="category_footer toggle-footer"> <div class="list"> <ul class="tree {if $isDhtml}dhtml{/if}"> <li><a href="http://packsofsnacks.com/manufacturers">{l s='Manufacturers' mod='blockcategories'}</a></li> {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $smarty.foreach.blockCategTree.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child} {/if} {if ($smarty.foreach.blockCategTree.iteration mod $numberColumn) == 0 AND !$smarty.foreach.blockCategTree.last} </ul> </div> Link to comment Share on other sites More sharing options...
Recommended Posts