winterone Posted February 27, 2014 Share Posted February 27, 2014 Hello I need some help. I want to hide 1 cms page. but when user login, that page will display i don't know what to do. Please help. thanks. Link to comment Share on other sites More sharing options...
vekia Posted February 27, 2014 Share Posted February 27, 2014 you can use simple if condition in cms.tpl file, something like {if $logged} CONTENTS OF CMS.TPL HERE {/if} 1 Link to comment Share on other sites More sharing options...
winterone Posted February 27, 2014 Author Share Posted February 27, 2014 you can use simple if condition in cms.tpl file, something like {if $logged} CONTENTS OF CMS.TPL HERE {/if} Hi. I'm sorry but i kinda don't understand. let me explain again. I want to hide only one cms page. Not all of it. only user can see this page. Because that page is order page. Visitor can't see it. Right now i add this cms page to mega meun but i'm not hide yet. It's alright if you write the code for hide cms page for me ? Thanks again. Ps. id_cms=40 Link to comment Share on other sites More sharing options...
vekia Posted February 27, 2014 Share Posted February 27, 2014 so add another if condition instead of {$cms->content} use this: {if $smarty.get.id_cms==40} {if $logged} {$cms->content} {else} {l s='access forbidden, please log in first to view this page'} {/if} {else} {$cms->content} {/if} 2 Link to comment Share on other sites More sharing options...
winterone Posted February 27, 2014 Author Share Posted February 27, 2014 i add code as you told but page still display. i add code like this Did i do somet่hing wrong?, Please tell me. Thank you sir Link to comment Share on other sites More sharing options...
vekia Posted February 27, 2014 Share Posted February 27, 2014 and you're browsing page with id = 40 ? in addition, sometimes it's necessary to recompile theme (adv. paramenters > performance tab in bo) 1 Link to comment Share on other sites More sharing options...
winterone Posted February 28, 2014 Author Share Posted February 28, 2014 (edited) Holy sh*** now it's work ! Thanks a lot mister vekia Edited February 28, 2014 by winterone (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted February 28, 2014 Share Posted February 28, 2014 you're very welcome glad to hear that it works now im going to mark this thread as solved with regards, Milos Link to comment Share on other sites More sharing options...
Adam Akhirat Posted February 28, 2014 Share Posted February 28, 2014 Vekia, can you share the folder of CMS include all the files inside it and for all place required? coz till now im still can't display my cms.. thank you Vekia Link to comment Share on other sites More sharing options...
vekia Posted February 28, 2014 Share Posted February 28, 2014 hello, i don't understand well your demand. you just want original cmsController and cms.tpl file? or ... what? Link to comment Share on other sites More sharing options...
Adam Akhirat Posted March 1, 2014 Share Posted March 1, 2014 hello, i don't understand well your demand. you just want original cmsController and cms.tpl file? or ... what? yup... not only the file, but the whole folder of cms and the address that i should change it to really new 1... help me Vekiaaaaaaaaaaaaa Link to comment Share on other sites More sharing options...
vekia Posted March 1, 2014 Share Posted March 1, 2014 i don't understand your expectactions, im confused a little due to the fact in ps there is no "CMS" folder Link to comment Share on other sites More sharing options...
Adam Akhirat Posted March 3, 2014 Share Posted March 3, 2014 i want cmsController and cms.tpl file Link to comment Share on other sites More sharing options...
vekia Posted March 3, 2014 Share Posted March 3, 2014 ok, it's clear now for what ps version? 1.5.6.2? Link to comment Share on other sites More sharing options...
Adam Akhirat Posted March 3, 2014 Share Posted March 3, 2014 ok, it's clear now for what ps version? 1.5.6.2? hahahaha hope this will make it works... yes. 1.5.6.2 =D Link to comment Share on other sites More sharing options...
vekia Posted March 3, 2014 Share Posted March 3, 2014 CmsController: https://github.com/PrestaShop/PrestaShop-1.5/blob/master/controllers/front/CmsController.php cms.tpl https://github.com/PrestaShop/PrestaShop-1.5/blob/master/themes/default/cms.tpl Link to comment Share on other sites More sharing options...
Adam Akhirat Posted March 3, 2014 Share Posted March 3, 2014 CmsController: https://github.com/PrestaShop/PrestaShop-1.5/blob/master/controllers/front/CmsController.php cms.tpl https://github.com/PrestaShop/PrestaShop-1.5/blob/master/themes/default/cms.tpl and sorry Vikea... where is the "address" of both file to replace? thank you Link to comment Share on other sites More sharing options...
Adam Akhirat Posted March 3, 2014 Share Posted March 3, 2014 This page does not exist. Link to comment Share on other sites More sharing options...
vekia Posted March 4, 2014 Share Posted March 4, 2014 this page doesnt exist? what is this? this is a part of ... some modules? or what? CmsController.php - /controllers/front/ cms.tpl - themes/YOUR_THEME/cms.tpl Link to comment Share on other sites More sharing options...
winterone Posted March 20, 2014 Author Share Posted March 20, 2014 (edited) Hello Milos, If i want to add one CMS page, what code should i write. I try {if $smarty.get.id_cms==40 OR $smarty.get.id_cms==41} but it's not working. Best regards, IT Edited March 20, 2014 by winterone (see edit history) Link to comment Share on other sites More sharing options...
thijsvk Posted November 9, 2015 Share Posted November 9, 2015 Would this work to hide a cms category? I've tried it with the following: {if $smarty.get.id_cms_category==4} {if $logged} {$cms->content} {else} {l s='access forbidden, please log in first to view this page'} {/if} {else} {$cms->content} {/if} However, I have not yet managed to get it to work, basically, nothing happens, nothing gets 'hidden/blocked'. Individual pages work fine. Any suggestions, would it be possible to use this code to block multiple pages? If so, how? I really need to properly start learning php 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