Jump to content

Dynamic content in CMS page


JFS

Recommended Posts

Hello Everyone,

 

I'd like to dynamically generate some content for display in a CMS page.  I will be generating the content in custom PHP code. Any suggestions or hints?  Where would you recommend I look for a "How To"?

 

I haven't really seen any information related to displaying dynamic content in a CMS page - just posting to PHP from CMS pages...

 

Thanks for all your responses  :)

 

Best regards,

John

Link to comment
Share on other sites

Alright.. I'm not getting this.  Have a look at:

 

http://9thchakra.com/content/10-consult-your-favorite-oracle

and now look at http://9thchakra.com/oraclecards.php

 

I want to embed the output of oraclecards.php into the http://9thchakra.com/content/10-consult-your-favorite-oracle and have it work the same way it does now.

 

I believe you are telling me to insert my code into the CMSController.php file and then in the initContent() routine assign the output to a smarty variable like this: $this->context->smarty->assign('cardgrid', ????); but I'm not sure what I should have in place of the ????.

 

Finally, I don't know how to distinguish (in the cms.tpl file) which CMS page I'm on...  

 

I'm beginning to think that this is the wrong way to go.  Is there any other way to create custom pages within the context of the site that can run this kind of custom code?

 

Thanks!

John

Link to comment
Share on other sites

Hi Vekia,

 

I have downloaded the example and tried to modify it but without knowledge of how PrestaShop internals work, I'm at a loss.  I can include my code in a zip file but I think it may be better to see a "Hello world" type of example.

 

Thanks for all your help.

 

Best regards,

John

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...