Jump to content
Sandame

add hooks to cms pages in 1.7

Recommended Posts

Hi,

i am trying to add a module to a specific cms page

however cms pages don't let me run any smarty code  which mean i can't call any of my hooks.

like so:

{hook h='displayavis'}

i have seen solutions for 1.6 but they all revolve around editing cms.tpl which doesn't seem to exist in 1.7.

 

could anyone suggest a solution?

 

Share this post


Link to post
Share on other sites

Hi,

 

To do that, you have to edit the \themes\yourtheme\templates\cms\page.tpl file.

Put that code anywhere you like.

If you just want that code to be show on a specific cms page, alert 6 as the cms page's ID. Use this code instead.

{if $cms.id==6}{hook h='displayavis'}{/if}

 

Regards,

Jonny

Share this post


Link to post
Share on other sites

Hi,

I am using Ps 1.7.2

Ex- I want to add a module services block module to a cms page id 4. How can I do it?

Thanks in advance

Share this post


Link to post
Share on other sites
Posted (edited)
On 6/12/2019 at 9:02 AM, Himanshubishtt said:

Hi,

I am using Ps 1.7.2

Ex- I want to add a module services block module to a cms page id 4. How can I do it?

Thanks in advance

I guess that would only be something like

{if $cms.id==4}{hook h='displayServiceBlock_or_whatever_its_name_is'}{/if}
Edited by R.Shredder
oops

Share this post


Link to post
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

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More