Get Free Audit

Removing Columns from One CMS Page in Prestashop

Mar 20, 2012

1048 Alex Simonchik

Unfortunately, there is no built-in Prestashop function to change the template on one page only. Let’s clarify the process of removing columns on CMS page. We are going to change one appearance (1) into another (2).

For this purpose we need to override the method displayFooter() of controller CmsControllerCore (for removing the right column). Override function first appeared in Prestashop 1.4 and allows to override the functionality without modifying the system core, i.e. no further problems will arise during the upgrade to the new version.

Let’s create CMSController file in /override/controllers/ folder with the following content:

Andrey_Dubina
Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Andrey


We overrode the displayFooter () function and changed the template in which the right column was defined, without touching the system core. Now we create the final template with the file / themes / prestashop / footer_cms.tpl:


{/if}

The standard footer.tpl looks this way:


{$HOOK_RIGHT_COLUMN}

{/if}

By now there should be no right column on CMS page, but the page looks somewhat boring, so it would be nice to extend the content. Play with your CSS:


With this being done, we’ve changed the width of the content and our site looks much better.To delete the left column on your website, you repeat these steps, overriding displayHeader() instead of displayFooter() of controller CmsControllerCore.

Andrey Dubina
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Andrey

14 Comments

  1. Hi Alex, could u pls tell me how to hide/disable all other modules except username & password on the sign in page … while in mobile view.

  2. Karam,

    To delete empty spaces you need to edit css. Unfortunately, the final version of this module has not been issued because the developers found this module unpromising.

  3. will this method work for 1.5.4, i have hided the right column but it still reserving the space m i need this space

  4. Paul Hart,

    You mean using the module соlumn_mаnаger for custome pages?

  5. Hardik,

    Sorry, but I do not understand your question. How is it related to the article? If this is a general question, which is not related to the topic of article, then please, provide more details about the issue.

  6. Hi Alex,
    This is what I am looking to achieve and I think that I understand the script.
    How do I assign this to each page, ie one page with both left and right columns and one page with just left column.
    I am presuming I should cut and paste this code into new pages and upload new pages via ftp. Can you be more specific what pages I should copy, change and which folder to add them into?
    Or
    Can I pay you for a quick chat?
    Regards
    Paul

  7. Okay ! I’ll tried your module shortly. Thank you very much. I’m grateful to you who give your time to develop free modules. It’s very useful for guys like me !
    I’ll follow your blog too !

  8. Yida,

    The described method concerns the 1.4.x version. Follow our blog – we’ll post how to remove columns in the 1.5.x version shortly. Do not waste time though and try our new Column Manager free module for 1.5.x now – it’s still being tested, however, you can download it already

  9. Hi !
    Thanks for this tip (sorry for my pitiful english).
    So I tried your method, but now I have a question : “Which part of the code selects the page where the right column is not appearing?”
    Because it didn’t work with my prestashop 1.5.3.1.
    I modified my CMSController file, next I created a footer_cms.tpl file but it didn’t changed anything. Did I missed something ?

    I hope you could help me even if your post has been posted a long time ago. =/

  10. It is necessary to change the following files:
    footer.tpl
    grid_prestashop.css
    footer.tpl:

    Delete\comment the following lines:

    It would be as well useful to call {$HOOK_RIGHT_COLUMN} in the right column at least; otherwise this hook modules will be removed
    grid_prestashop.css:
    Increase the width of the central column:

    For example: http://belvg.info/demo/prestashop/storelocator/index.php?controller=stores

Post a new comment

BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *