ArthurianX Posted August 2, 2010 Share Posted August 2, 2010 Hello, I want to be able cu call a cms id in a custom page.In my case the newly created template page is media.php. How can I call let's say two cms pages, I am thinking wordpress style now, get page content by id, the cms page have Id, I just have no idea how to call them wherever I want in my template.Is it possible? And how? Thanks! Link to comment Share on other sites More sharing options...
ArthurianX Posted August 2, 2010 Author Share Posted August 2, 2010 Honestly now, it's been a few months since I am posting few of my problems here, and absolutely no one answers to ANY of my questions.Not even a "Use paid support" or anything for that matter, are my problems so complicated, or what's the deal on these forums? Link to comment Share on other sites More sharing options...
rocky Posted August 3, 2010 Share Posted August 3, 2010 I've had a look at your questions and they are complicated. I guess that's why you aren't getting responses. Link to comment Share on other sites More sharing options...
ArthurianX Posted August 4, 2010 Author Share Posted August 4, 2010 MY big problem is that I do not have PHP programming skills, I am a front end developer, my logic and basic php knowledge tells me that I only have to select from the database the coresponding ID to the cms I want.Here's a screenshot: http://screencast.com/t/Nzk1NTVlThe database connection is already established in config.inc.php, oh well, I am hopeless Thanks for the reply!! You're the first:) Link to comment Share on other sites More sharing options...
ArthurianX Posted August 4, 2010 Author Share Posted August 4, 2010 this is the code:{if $cms} {$cms->content} {else} {l s='This page does not exist.'}{/if}This is the interesting line, {$cms->content}, I guess the the content is shown through the post command, the post send a number, cms ID, and the ->content gets that ID, logic, logic, no skills in php ) Link to comment Share on other sites More sharing options...
ArthurianX Posted August 4, 2010 Author Share Posted August 4, 2010 I've had a look at your questions and they are complicated. I guess that's why you aren't getting responses. This is what I am working on, indeed it is pretty complicated, but aside extracting category names and cms, almost everything works, http://screencast.com/t/NTEzYWI4ZTgt Link to comment Share on other sites More sharing options...
rocky Posted August 4, 2010 Share Posted August 4, 2010 From that screenshot, it appears that you are trying add add blocks of text to the footer that can be edited in the Back Office. To do this, you could add code like the following before line 5 of footer.php in the root directory of PrestaShop: $footer_left = new CMS(1, intval($cookie->id_lang)); if (Validate::isLoadedObject($footer_left)) $smarty->assign('footer_left', $footer_left); $footer_right = new CMS(2, intval($cookie->id_lang)); if (Validate::isLoadedObject($footer_right)) $smarty->assign('footer_right', $footer_right); Change 1 to the ID of the CMS page you want displayed in the left column of the footer and 2 to the ID of the CMS page you want displayed in the right column of the footer. You can then use the following in footer.tpl in your theme's directory wherever you want the content to appear: {$footer_left->content} {$footer_right->content} Link to comment Share on other sites More sharing options...
ArthurianX Posted August 6, 2010 Author Share Posted August 6, 2010 I think you just saved me )Actually I don't want to edit text in the footer, but in:the main page: http://prestoquartz.hostingpower.nl/Those 3 tabsand in the media page:http://prestoquartz.hostingpower.nl/media.phpthose two tabs.I'm gonna try this immediatlyTHANK YOU VERY MUCH Link to comment Share on other sites More sharing options...
ArthurianX Posted August 6, 2010 Author Share Posted August 6, 2010 THIS WORKS LIKE A CHARM! THANK YOU VERY MUCH! Link to comment Share on other sites More sharing options...
allan1412 Posted October 11, 2010 Share Posted October 11, 2010 I'm trying to get this to work as an introduction to the Manufacturer's List by placing the code(s) in manufacturer.php and manufacturer-list.tpl but with no luck.Does anyone know if this is possible? Link to comment Share on other sites More sharing options...
jondrew Posted February 15, 2011 Share Posted February 15, 2011 Hi,The above is great and I can get it to work with the footer of may pages but I want the content of a cms page to appear on my homepage? I've tried using the same code in index.php and index.tpl but no luck anybody got any other ideas?ThanksJon Link to comment Share on other sites More sharing options...
threeopus3 Posted June 7, 2013 Share Posted June 7, 2013 So then, will this technique only work for footer.tpl? I have also tried it without any luck. Link to comment Share on other sites More sharing options...
vekia Posted June 7, 2013 Share Posted June 7, 2013 everything depends on your prestashop version. so my question is: what PS you use? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now