Page Variable List?

Permalink
Is there a list of page variables or session variables I can use with in my themes? For example, I want to display the Title of the page in the header of my theme. Can I do this?

 
jbx replied on at Permalink Reply
jbx
For example, I have a custom page attribute called colourScheme. I call it in the view with:
$this->getCollectionObject()->GetCollectionAttributeValue('colourScheme')

Should also work for your pageTitle etc..
ryan replied on at Permalink Reply
ryan
in the concrete core in:
[your site root]/concrete/themes/default/elements/header.php

You'll see the code:
<? Loader::element('header_required'); ?>


That needs to be included in the <head></head>
of your theme and you'll be able to specify the page title & other meta tag stuff in the page's properties (edit mode -> properties -> custom fields -> enter text in meta title ).

As for variables that are always available in themes you have:

$c - The page object (extends collection)
$this - the view object
$this->controller - the current page's controller.

The docs for those classes are here:
http://www.concrete5.org/api/

- I do agree there should be a quick cheat-sheet for this..
Hope that helps,
Ryan
etsauer replied on at Permalink Reply
I was looking through the documentation, and I couldn't find an object with the getControllerObject() function. Which object does "$this" represent. Does the documentation have a list of allowed values for getCollectionAttributeValue()?
ryan replied on at Permalink Reply
ryan
$this->controller is the controller object (no need for a get function..)

The values allowed for getCollectionAttributeValue() are dependent on what Collection Attributes you have defined.

Basically you pass the collection attribute's handle to that function to get the value. You can manage your available collection attributes in the dashboard at:
Pages and Themes -> Page Types, then look under page attributes in the Handle column.

Ryan