Boss Hog Posted May 11, 2014 Share Posted May 11, 2014 Hello everyone, How do you make a page private? I am looking to make only one CMS page private. When users visit that page I would like them to be required to log in to see the page. Link to comment Share on other sites More sharing options...
vekia Posted May 11, 2014 Share Posted May 11, 2014 unfortunately with default features is not possible. you can achieve it only with .tpl file modification you can use in cms.tpl file code like {if $cms->id==5} {if $logged} {$cms->content} {/if} {else} {$cms->content} {/if} Link to comment Share on other sites More sharing options...
Boss Hog Posted May 11, 2014 Author Share Posted May 11, 2014 So if the page that I want private is the about page what would be the code? Link to comment Share on other sites More sharing options...
Boss Hog Posted May 11, 2014 Author Share Posted May 11, 2014 Also, how do you create a CMS user start page? I would like certain users to see a specific message when they log into their account Link to comment Share on other sites More sharing options...
vekia Posted May 11, 2014 Share Posted May 11, 2014 it's not as easy as it seems. you can redirect user to a specific cms page with modification of auth controller. but how you want to distinct users ? based on what criterion ? Link to comment Share on other sites More sharing options...
Boss Hog Posted May 11, 2014 Author Share Posted May 11, 2014 Please answer the first question first. What would be the code to make a CMS page private? And where would I have to plug the code in at? For example, I created a CMS named "upload". How would I make that private? Link to comment Share on other sites More sharing options...
vekia Posted May 11, 2014 Share Posted May 11, 2014 i said everything necessary in post #2 replace original $cms->content with code that i suggested to use. replace also if condition: {if $cms->id==5} with id which is equal to your CMS page id you want to make private. 1 Link to comment Share on other sites More sharing options...
Boss Hog Posted May 11, 2014 Author Share Posted May 11, 2014 how do i know the page id? is the cms page id the name of the actual page? Link to comment Share on other sites More sharing options...
vekia Posted May 11, 2014 Share Posted May 11, 2014 you can find number of cms page under prefrences > cms tab in back office, near each cms page you can find it: Link to comment Share on other sites More sharing options...
Boss Hog Posted May 11, 2014 Author Share Posted May 11, 2014 Thanks I found the Page Id. It is 6. I went to the cms.tpl file found $cms->content and replaced it with the below and the page was blank. {if $cms->id==5}{if $logged}{$cms->content}{/if}{else}{$cms->content}{/if} Link to comment Share on other sites More sharing options...
Recommended Posts