echo page type
Permalink 1 user found helpful
Hello!
I've got some problem - I need to chceck what is the page type of my page. I need to have something like this:
I need this because i have display some content based on page type and I don't wont to make another page type.
I've got some problem - I need to chceck what is the page type of my page. I need to have something like this:
if (/*current page is default page type*/) { echo 'Yes'; }
I need this because i have display some content based on page type and I don't wont to make another page type.
Hey!
I'm using Concrete5.7.
I have probably problem with implementation of this function. Can you give an advise?
I'm using Concrete5.7.
I have probably problem with implementation of this function. Can you give an advise?
Here is an example of their use.
Example:
$c = Page::getCurrentPage(); $c->getPageTypeID(); $c->getPageTypeHandle(); $c->getPageTypeName();
Example:
if ($c->getPageTypeName() == 'Empty Page') { // do this }
I've try to do in this way.
But nothing happens.
But nothing happens.
Can you include more details of what you are doing.
I manage this!
The problem was that I used getPageTypeName instead of getPageTypeHandle!
Now everything works perfect!
Thank you very much for your help!
The problem was that I used getPageTypeName instead of getPageTypeHandle!
Now everything works perfect!
Thank you very much for your help!
What version of concrete5 are you using?
If 5.7, there is:
getPageTypeHandle()
getPageTypeID()
getPageTypeName()
http://www.concrete5.org/api/class-Concrete.Core.Page.Page.html...