Customize Prestashop CMS pages

For some unexplicable reason Prestashop has decided to have a single "Meta title" field in CMS page edition. However you most often need to have a meta title different from your page title (h1), which could also be different from the label used in a menu.

In order to add those additional fields in our CMS admin we are going to create a module and register a hook on the AdminCmsFormModifier. Find below the full module code

Once your module is installed and database updated you should be able to edit the 2 new created fields.

Now to use the "real_meta_title" field override the Meta class by creating a Meta.php file in "override/classes" such as

Finally, in your CMS page template you can update the "page_title" block such as

{block name='page_title'}
{$cms.page_title}
{/block}

I hope this will be useful to you. Please comment if you have come over the same issue and solved it differently.

Leave a Comment

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

I agree to these terms.