Jump to content

CMS


Recommended Posts

I thought I saw it sometime ago there is a thread to show people how to make the CMS pages has different format. I remeber it only need to modify the CMS.php with codes like if CMS id==4 something something, else CMS id== 5 something something. It is a very simple code. BUT I can not find the thread.


Anyway. I want to make the about us, and security CMS pages (CMS page 4 and 5) that have the left and right columns, and the Privacy statement and terms pages (CMS 2 and 3) that only have left column. Can someone please show me the thread or show me how to do it? Thank you very much.

Link to comment
Share on other sites

Unfortunately, I can't see how to get the current CMS id in the header.tpl without modifying cms.php. You'll have to move the following line from above to below the $smarty->assign block:

include(dirname(__FILE__).'/header.php');



Then you can modify footer.tpl in your theme directory and add the following on line 3:

{if $cms->id != 2 AND $cms->id != 3}



and the following on line 8:

{else}
   {include file=$tpl_dir./thickbox.tpl}
{/if}



This will hide the right column only on the privacy and terms pages. For some reason, thickbox.tpl is not included when I hide the right column, causing a Javascript error, which is why I'm adding it above.

If you want to increase the width of the center column, you'll need to change line 39 of header.tpl to:

<body {if $page_name}id="{$page_name|escape:'htmlall':'UTF-8'}"{/if}{if $cms->id == 2 OR $cms->id == 3} class="no_right_column"{/if}>



so that you can put the following in your global.css:

body.no_right_column #center_column
{
   width: 750px;
}


Change 750px to whatever you want the width of the center column to be on the pages missing the right column.

Link to comment
Share on other sites

  • 1 year later...

Hi, please I need help. I need the cms id from header.tpl, my code is (it's from a top_menu):

 

 

{if $page_name == 'cms'}

{if $cms->id == 5}

<a href="{$base_dir}cms.php?id_cms=5" class="selec">{l s='Empresa'}</a>

{else}

<a href="{$base_dir}cms.php?id_cms=5">{l s='Empresa'}</a>

{/if}

{/if}

 

This d'ont working, I can't get the cms id? Thank you very much.

Link to comment
Share on other sites

  • 4 weeks later...
×
×
  • Create New...