SPageTemplate Class Reference
[Templates]

The base class for page templates that all other page template classes should extend. More...

Inheritance diagram for SPageTemplate:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 getAttributeForMetaSlot ($metaSlot, $attribute)
 Get an attribute related to a meta-slot.
 getDisplayForMetaSlot ($metaSlot)
 Get the display for a meta-slot.
 getIndexForMetaSlot ($metaSlot)
 Get the index of the meta-slot (its order within the page, starting at 0).
 getLayoutForMetaSlot ($metaSlot)
 Get the layout style for a meta-slot.
 getMetaSlotsList ()
 List all the names of meta-slots that will be displayed.
 setAttributeForMetaSlot ($metaSlot, $attribute, $value)
 Set an attribute related to a meta-slot.
 setDisplayForMetaSlot ($metaSlot, $display)
 Change the display of a meta-slot (turn display on or off).
 setLayoutForMetaSlot ($metaSlot, $layout)
 Change the layout of a meta-slot.
 swapMetaSlotOrder ($ms1, $ms2)
 Swap the order of two meta-slots in the page.


Detailed Description

The base class for page templates that all other page template classes should extend.

Store, in order, the list of meta-slots that could potentially be rendered as part of our page. For each slot, keep track of whether or not the meta-slot should or should display on the page, and what layout style it should use. Since the meta-slots are stored in order, an instance of this class can re-order the meta-slots to make page content appear in a different order.

When you extend this class, you should use the following methods to override the defaults on how meta-slots display:

Author:
Jonathan Stuart-Moore <jwsm@shodor.org> (2006)

Member Function Documentation

SPageTemplate::getAttributeForMetaSlot ( metaSlot,
attribute 
)

Get an attribute related to a meta-slot.

Parameters:
$metaSlot [string]: The name of the meta-slot
$attribute [string]: The name of the attribute to set
Returns:
[mixed]: The value for the attribute

SPageTemplate::getDisplayForMetaSlot ( metaSlot  ) 

Get the display for a meta-slot.

Parameters:
$metaSlot [string]: The name of the meta-slot
Returns:
[bool]: True if the meta-slot should be displayed, false if not

SPageTemplate::getIndexForMetaSlot ( metaSlot  ) 

Get the index of the meta-slot (its order within the page, starting at 0).

Parameters:
$metaSlot [string]: The name of the meta-slot
Returns:
[int]: The index of the meta-slot within the list of all meta-slots for this page (starting at index 0)

SPageTemplate::getLayoutForMetaSlot ( metaSlot  ) 

Get the layout style for a meta-slot.

Parameters:
$metaSlot [string]: The name of the meta-slot
Returns:
[string]: The name of the layout style for the meta-slot

SPageTemplate::getMetaSlotsList (  ) 

List all the names of meta-slots that will be displayed.

Return a list, in the correct order, of all the meta-slots that should be displayed.

If the 'showTopMetaSlots' and 'showBottomMetaSlots' options are turned on, merge the standard top and bottom meta-slots with the list of slots specified by the template. If not, do not include the standard top and bottom meta-slots as part of the returned list.

The standard top and bottom meta-slots, as well as the default main meta-slots, are defined in SPageTemplateConfig.

Returns:
[array]: An array of meta-slot names

SPageTemplate::setAttributeForMetaSlot ( metaSlot,
attribute,
value 
)

Set an attribute related to a meta-slot.

Parameters:
$metaSlot [string]: The name of the meta-slot
$attribute [string]: The name of the attribute to set
$value [mixed]: The value for the attribute

SPageTemplate::setDisplayForMetaSlot ( metaSlot,
display 
)

Change the display of a meta-slot (turn display on or off).

The display determines whether or not a particular meta-slot will display in the output page.

Parameters:
$metaSlot [string]: The name of the meta-slot
$display [bool]: True if the meta-slot should display, false if not.

SPageTemplate::setLayoutForMetaSlot ( metaSlot,
layout 
)

Change the layout of a meta-slot.

The layout determines how a particular meta-slot will display when it renders. (Layout of a meta-slot controls things such as whether a sidebar appears on the right or left of a page.)

Parameters:
$metaSlot [string]: The name of the meta-slot
$layout [string]: The name of the layout style for the meta-slot

SPageTemplate::swapMetaSlotOrder ( ms1,
ms2 
)

Swap the order of two meta-slots in the page.

Pass in the name of two meta-slots whose order of display on the page should be swapped.

Parameters:
$ms1 [string]: The name of the first meta-slot
$ms2 [string]: The name of the second meta-slot


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:03:25 2010 for Common by  doxygen 1.5.6