huntleybill Posted October 13, 2012 Share Posted October 13, 2012 I have version 1.5 and would like to have some blocks show on the front page only. For example, I'd like the "new products" block and the "viewed products" block to show on the front page and NOT show on any other pages. How (specifically) do I set this up. Thank you Link to comment Share on other sites More sharing options...
clayton29657 Posted October 13, 2012 Share Posted October 13, 2012 Hello huntleybill Go to modules then to positions tab then click on pencil icon and there it will allow you to disable on which pages to not show. Cheers Clayton Link to comment Share on other sites More sharing options...
MEG Venture Posted October 13, 2012 Share Posted October 13, 2012 Clayton's answer is OK. But there is a more effective and easy way to do this. You may want to try. Open the tpl file of the modules of interest and put all the codes between those two lines below... {if $page_name == 'index'} ... ... Codes .... ... {/if} 1 Link to comment Share on other sites More sharing options...
huntleybill Posted October 14, 2012 Author Share Posted October 14, 2012 (edited) Thank you Clayton...That worked for some pages. I still get New Products and Viewed Products blocks showing on "Your Shopping Cart" Page and the payment page. Say I pay by Check. When that page comes up, the Viewed and New Products blocks are on the right side. I went back to modules as you instructed but I find no entry for these????? Any further suggestions? Edited October 14, 2012 by huntleybill (see edit history) Link to comment Share on other sites More sharing options...
MEG Venture Posted October 14, 2012 Share Posted October 14, 2012 You need to apply my suggestion... 1 Link to comment Share on other sites More sharing options...
clayton29657 Posted October 14, 2012 Share Posted October 14, 2012 thank you for the addon Caglar Link to comment Share on other sites More sharing options...
huntleybill Posted October 15, 2012 Author Share Posted October 15, 2012 Caglar, I dont understand your explanation. I opened (for example) blockcart.tpl. I find no info as you describe. Please tell me if I am doing this wrong. Thank you Link to comment Share on other sites More sharing options...
MEG Venture Posted October 15, 2012 Share Posted October 15, 2012 (edited) Let's take blocknewproducts.tpl in modules>blocknewproducts This is the code inside it: <!-- MODULE Block new products --> <div id="new-products_block_right" class="block products_block"> <h4><a href="{$link->getPageLink('new-products')}" title="{l s='New products' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></h4> <div class="block_content"> {if $new_products !== false} <ul class="product_images clearfix"> {foreach from=$new_products item='product' name='newProducts'} {if $smarty.foreach.newProducts.index < 2} <li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a></li> {/if} {/foreach} </ul> <dl class="products"> {foreach from=$new_products item=newproduct name=myLoop} <dt class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}">{$newproduct.name|strip_tags|escape:html:'UTF-8'}</a></dt> {if $newproduct.description_short}<dd class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}">{$newproduct.description_short|strip_tags:'UTF-8'|truncate:75:'...'}</a><br /><a href="{$newproduct.link}" class="lnk_more">{l s='Read more' mod='blocknewproducts'}</a></dd>{/if} {/foreach} </dl> <p><a href="{$link->getPageLink('new-products')}" title="{l s='All new products' mod='blocknewproducts'}" class="button_large">» {l s='All new products' mod='blocknewproducts'}</a></p> {else} <p>» {l s='No new products at this time' mod='blocknewproducts'}</p> {/if} </div> </div> <!-- /MODULE Block new products --> Simply change it with the one below <!-- MODULE Block new products --> {if $page_name == 'index'} <div id="new-products_block_right" class="block products_block"> <h4><a href="{$link->getPageLink('new-products')}" title="{l s='New products' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></h4> <div class="block_content"> {if $new_products !== false} <ul class="product_images clearfix"> {foreach from=$new_products item='product' name='newProducts'} {if $smarty.foreach.newProducts.index < 2} <li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a></li> {/if} {/foreach} </ul> <dl class="products"> {foreach from=$new_products item=newproduct name=myLoop} <dt class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}">{$newproduct.name|strip_tags|escape:html:'UTF-8'}</a></dt> {if $newproduct.description_short}<dd class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}">{$newproduct.description_short|strip_tags:'UTF-8'|truncate:75:'...'}</a><br /><a href="{$newproduct.link}" class="lnk_more">{l s='Read more' mod='blocknewproducts'}</a></dd>{/if} {/foreach} </dl> <p><a href="{$link->getPageLink('new-products')}" title="{l s='All new products' mod='blocknewproducts'}" class="button_large">» {l s='All new products' mod='blocknewproducts'}</a></p> {else} <p>» {l s='No new products at this time' mod='blocknewproducts'}</p> {/if} </div> </div> {/if} <!-- /MODULE Block new products --> I added if condition just after and before <!-- /MODULE Block new products --> tags. Edited October 15, 2012 by Caglar (see edit history) Link to comment Share on other sites More sharing options...
huntleybill Posted October 16, 2012 Author Share Posted October 16, 2012 Holy Crap...That worked!!! Thank you Caglar. You ROCK! Nice explanation too! Link to comment Share on other sites More sharing options...
Recommended Posts