Jump to content

Is there a cleaner way?


Rebel Tech

Recommended Posts

Hi

 

I have created a page under Tool -> CMS -> "Pages in this category".

 

However, I want to add this to the footer.

 

In CMS Block -> I enabled the page under "Display various links and information in the Footer" (Picture attach: cms_block.png). However, nothing displayed.

 

I then went to fiddle with code (which I hate doing since I am sure there is another way).

 

In theme\modules\blockcms\blockcms.tpl I added some lines of code

{if $block == 1}
	<!-- Block CMS module -->
	{foreach from=$cms_titles key=cms_key item=cms_title}
		<div id="informations_block_left_{$cms_key}" class="block informations_block_left">
			<h4 class="title_block"><a href="{$cms_title.category_link}">{if !empty($cms_title.name)}{$cms_title.name}{else}{$cms_title.category_name}{/if}</a></h4>
			<ul class="block_content bullet">
				{foreach from=$cms_title.categories item=cms_page}
					{if isset($cms_page.link)}<li class="bullet"><b style="margin-left:2em;">
					<a href="{$cms_page.link}" title="{$cms_page.name|escape:html:'UTF-8'}">{$cms_page.name|escape:html:'UTF-8'}</a>
					</b></li>{/if}
				{/foreach}
				{foreach from=$cms_title.cms item=cms_page name=cms_page_items}
					{if isset($cms_page.link)}<li {if $smarty.foreach.cms_page_items.last && !$cms_title.display_store} class="last"{/if}><a href="{$cms_page.link}" title="{$cms_page.meta_title|escape:html:'UTF-8'}">{$cms_page.meta_title|escape:html:'UTF-8'}</a></li>{/if}
				{/foreach}
				{if $cms_title.display_store}<li class="last"><a href="{$link->getPageLink('stores')}" title="{l s='Our stores' mod='blockcms'}">{l s='Our stores' mod='blockcms'}</a></li>{/if}
			</ul>
		</div>
	{/foreach}
	<!-- /Block CMS module -->
{else}
	<!-- MODULE Block footer -->
	<div id="block_various_links_footer" class="block_various_links">
		<h4>{l s='Information' mod='blockcms'}</h4>
		<ul>
			{if !$PS_CATALOG_MODE}<li class="first_item"><a href="http://demo.rebeltech.co.za/content/3-terms-and-conditions-of-use" title="{l s='Terms and Conditions' mod='blockcms'}">{l s='Terms and Conditions' mod='blockcms'}</a></li>{/if}
			<li class="{if $PS_CATALOG_MODE}first_{/if}item"><a href="http://demo.rebeltech.co.za/content/1-delivery" title="{l s='Delivery and Returns' mod='blockcms'}">{l s='Delivery and Returns' mod='blockcms'}</a></li>
			{if !$PS_CATALOG_MODE}<li class="item"><a href="http://demo.rebeltech.co.za/content/5-shop-withus" title="{l s='Why Shop With Us' mod='blockcms'}">{l s='Why Shop With Us' mod='blockcms'}</a></li>{/if}
			{if !$PS_CATALOG_MODE}<li class="item"><a href="http://demo.rebeltech.co.za/content/6-banking-details" title="{l s='Banking Details' mod='blockcms'}">{l s='Banking Details' mod='blockcms'}</a></li>{/if}
			{if !$PS_CATALOG_MODE}<li class="item"><a href="http://demo.rebeltech.co.za/content/4-about-us" title="{l s='About Rebel Tech' mod='blockcms'}">{l s='About Rebel Tech' mod='blockcms'}</a></li>{/if}
			{if $display_stores_footer}<li class="item"><a href="{$link->getPageLink('stores')}" title="{l s='Our stores' mod='blockcms'}">{l s='Our stores' mod='blockcms'}</a></li>{/if}
			<li class="item"><a href="{$link->getPageLink($contact_url, true)}" title="{l s='Contact us' mod='blockcms'}">{l s='Contact us' mod='blockcms'}</a></li>
		</ul>
	</div>
		<div id="block_various_links_footer" class="block_various_links">
		<h4>{l s='Product Information' mod='blockcms'}</h4>
		<ul>
			{if !$PS_CATALOG_MODE}<li class="first_item"><a href="{$link->getPageLink('prices-drop')}" title="{l s='Specials' mod='blockcms'}">{l s='Specials' mod='blockcms'}</a></li>{/if}
			<li class="{if $PS_CATALOG_MODE}first_{/if}item"><a href="{$link->getPageLink('new-products')}" title="{l s='New products' mod='blockcms'}">{l s='New products' mod='blockcms'}</a></li>
			{if !$PS_CATALOG_MODE}<li class="item"><a href="{$link->getPageLink('best-sales')}" title="{l s='Top sellers' mod='blockcms'}">{l s='Top sellers' mod='blockcms'}</a></li>{/if}
		</ul>
	{$footer_text}
    {if $display_poweredby}<p class="powered">© {$smarty.now|date_format:"%Y"} {l s='Powered by' mod='blockcms'} <a href="http://www.prestashop.com">PrestaShop</a>™</p>{/if}
	</div>
	<!-- /MODULE Block footer -->
{/if}

The result is show on picture "footer_end.png).

 

My question is:

1.) Is there a better way to do it since I might need to create more CMS pages?

2.) The hyperlinks might change over time and I would like it to be automated - can this be achieved?

 

Thanks

post-613669-0-37463900-1387123042_thumb.png

post-613669-0-22051600-1387123206_thumb.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...