Jump to content

[SOLVED] Remove the "left column hook" on only one CMS page


Recommended Posts

Hi I am running PS 1.5.6.1 and not default template.

I need to remove left column hook for both the homepage and the cms page with id number 9.

 

Here is the code in header.tpl that did not work 100% as intended:

{if $page_name == "cms" AND $smarty.get.id_cms != '9' AND $page_name != "index"}

								<div id="leo-leftcol" class="span3">
										{$HOOK_LEFT_COLUMN}
								</div><!--leftcol-->
							   {/if}						

The problem is that for some reason it also removes the left column hook on other pages which I don't want. It should only remove it on the homepage and cms page 9.

 

I looked into about 5 post's with this question but none of the solutions solved my issue 100%.

Can anyone help me? Thanks.

Edited by khaledsaied (see edit history)
  • Like 1
Link to comment
Share on other sites

hello

 

you said that you want to remove right column, but in your code i see: {$HOOK_LEFT_COLUMN}
 

 

 

  1. {if $page_name == "cms" AND $smarty.get.id_cms != '9' AND $page_name != "index"}
  2.  
  3. <div id="leo-leftcol" class="span3">
  4. {$HOOK_LEFT_COLUMN}
  5. </div><!--leftcol-->
  6. {/if}

 

why left column?

  • Like 1
Link to comment
Share on other sites

Hi.

 

Try this:

{if !(($page_name == "cms" AND $smarty.get.id_cms == '9') OR ($page_name == "index"))}

Regards.

 

Robin.

 

The CartExpert Team

 

Thanks a lot that solved the problem :)  - I will now try to expand it to contain more pages..

 

And sorry I meant the LEFT column, I have corrected it now :)

  • Like 1
Link to comment
Share on other sites

No problem, the essential was the if statement's condition. :)

 

Regards.

 

Robin.

 

The CartExpert Team

 

Yes I can see that now :)

 

I have expanded the solution to cover multiple pages like this:

 

{if !(($page_name == "cms" AND $smarty.get.id_cms == '9' OR $smarty.get.id_cms == '10') OR ($page_name == "index") OR ($page_name == "contact"))}
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hi... i'm sorry for reopening this post... but i can't hide left column in single cms page. When i insert the code that you show, i have two left colums in all cms page, instead of one column.

 

Can help me pleaseee ? i'm going crazy :(

 

if u want... the site is www.iconpoint.eu 

 

I need left column only on CATALOGO PRODOTTI.

 

Thanks. Dany

Link to comment
Share on other sites

  • 7 months later...
  • 1 year later...

I have placed code in the bottom of header.tpl file, and everything WORKS just fine.

 

CODE:

 

<div class="columns-container">
<div id="columns" class="container">
{if $page_name !='index' && $page_name !='pagenotfound'}
{include file="$tpl_dir./breadcrumb.tpl"}
{/if}
                    {if !(($page_name == "cms" AND $smarty.get.id_cms == '11') OR ($page_name == "index"))}
 
<div class="row">
{if isset($left_column_size) && !empty($left_column_size)}
<div id="left_column" class="column col-xs-12 col-sm-{$left_column_size|intval}">{$HOOK_LEFT_COLUMN}</div>{/if} 
 
{/if}
 
<div id="center_column" class="center_column col-xs-12 col-sm-{12 - $left_column_size - $right_column_size}">
{/if} 
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...