Jump to content

Add links to category module


Fashionist

Recommended Posts

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

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 by fmilland (see edit history)
Link to comment
Share on other sites

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

  • 2 months later...

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

×
×
  • Create New...