Jump to content

[Solved] Remove left/right columns on a specific page


Recommended Posts

Hello everyone,

I'm integrating phpbb to prestashop as a CMS page. I've created a CMS page "Message Board" which has iframe link to index page of phpbb. It loads fine but because the center column has limited width, I'd like to remove both left and right columns so I can use the whole page under the header of my website.

I know putting a conditional if clause on header.tpl and footer.tpl will remove both colums:

 

{if $page_name != 'cms' }
{$HOOK_LEFT_COLUMN} //{$HOOK_RIGHT_COLUMN} for footer.tpl
{/if}

 

However, I don't want them to disappear on every cms page. Pages such as about us, terms & conditions, etc.. should work as they would normally. I want them to disappear on message board page only. Without the friendly url, the address bar shows

 

/cms.php?id_cms=7

 

I've tried to use:

 

{if $page_name != 'cms'  AND $id_cms !='7'}
$HOOK_LEFT_COLUMN} //{$HOOK_RIGHT_COLUMN} for footer.tpl
{/if}

 

with no luck, it throws an exception. How can I add id_cms variable as an additional condition so the columns disappear only on specific CMS page?

 

Any help is appreciated.

Thank you

  • Like 1
Link to comment
Share on other sites

very interesting topic about integrating with PHPBB.

Actually I am considering integrate PHPBB somehow into PrestaShop.

 

Come back to your question, I think the problem is that you are using variable id_cms in the theme files, I guess it is not assigned to smarty in the page controller.

 

You have to assign the id_cms as smarty variable before you can use it.

You can do this in Init() method of FrontPageController class

 

But it is better that you create an override of FrontController or use existing override if it already exists.

 

When you are ready, can you give (PM) me your site URL as reference? thanks

  • Like 1
Link to comment
Share on other sites

Thank you for your reply. It actually didn't take too long to figure out, I just had to browse through some smarty documentation. It turns out, calling smarty.get.id_cms (which stands for $_GET['id_cms'] ) does the trick. So place this on both header.tpl and footer.tpl to remove both columns:

 

{if $page_name != 'cms' AND {$smarty.get.id_cms} != '7'}

 

"7" is the id number of the cms page you want it to be disappear on.Now, all I have to do is to create additional css rule to extend center column to entire page. (still using the one defined in global.css)

 

I will PM you the website once I'm done. It's doesn't have a domain name yet.

 

Thanks again for your reply

Link to comment
Share on other sites

OK. Finally it shows up as I wanted.

 

On the CMS page, I have the following code:

 

<iframe id="ForumsWrap" src="http://example.com/forum/index.php" scrolling="auto" width="980px" height="700px"></iframe>

 

980px being the same size as #page, defined in global.css

 

You can probably define a rule for "ForumsWrap" and adjust the size from global.css

 

Now, I'm going to actually integrate prestashop and phpbb so they share the same login credentials. (i've read few articles, so I know it's not too hard)

The last will be theming it so it follows the same style of my website.

 

Hope that helps.

Link to comment
Share on other sites

Nice tips, thanks for it,

I'm trying to make the same thing but my programming skills are kind of LOW :)

I got almost everything, but i'm stucked with a problem

How do you overwrite the center column width value because here the width defined for the iframe is

overwrited with the value for the center column (width: 556px;) and I can't get more than this...

 

I hope you understand my bad english

 

Best regards

Link to comment
Share on other sites

  • 11 months later...
  • 1 year later...

Thank you for your reply. It actually didn't take too long to figure out, I just had to browse through some smarty documentation. It turns out, calling smarty.get.id_cms (which stands for $_GET['id_cms'] ) does the trick. So place this on both header.tpl and footer.tpl to remove both columns:

 

{if $page_name != 'cms' AND {$smarty.get.id_cms} != '7'}
"7" is the id number of the cms page you want it to be disappear on.Now, all I have to do is to create additional css rule to extend center column to entire page. (still using the one defined in global.css)

 

I will PM you the website once I'm done. It's doesn't have a domain name yet.

 

Thanks again for your reply

 

 

 

Hi I am running PS 1.5.6.1 and not default template.

 

I was trying your proposal but it did not work, can you help please? Here is my code:

 

	{if $page_name != "index" and $page_name != "cms" AND {$smarty.get.id_cms} != '7'}
								<div id="leo-leftcol" class="span3">
										{$HOOK_LEFT_COLUMN}
								</div><!--leftcol-->
							   {/if}				
Edited by khaledsaied (see edit history)
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...