Get Page Type function?

Permalink 5 users found helpful
Does anyone know how to get the pageType from within the header file?

I want to dynamically define the css class of the body tag by pagetype to give control over css in different pages.

I was looking for something like:

<body class="<?php echo $this->getAttribute(pageType); ?>">


But it's obviously not that simple - any ideas?

katalysis
 
okhayat replied on at Permalink Best Answer Reply
okhayat
Use:
<?php $c->getCollectionTypeName(); ?>
which will return the page type name, i.e., Right Sidebar, or
<?php $c->getCollectionTypeHandle(); ?>
which will return the page type handle, i.e., right_sidebar.
The API is your friend:
http://www.concrete5.org/api/ or
http://docs.concrete5addons.com/...
katalysis replied on at Permalink Reply
katalysis
That's what I need - many thanks.
wesalvaro replied on at Permalink Reply
wesalvaro
Yeah, I tried looking through the API docs for this...

Don't try acting like it's easy to find things in that unsearchable, loosely documented, poorly structured jumble.

Thanks for the answer, though, it's exactly what I needed!
ob7dev replied on at Permalink Reply
ob7dev
I use google site:concrete5.org/api/ "what to search for" for navigating the API
ob7dev replied on at Permalink Reply
ob7dev
I use google site:concrete5.org/api/ "what to search for" for navigating the API
mrjcgoodwin replied on at Permalink Reply
mrjcgoodwin
Thanks for this - very helpful snippet.