Checking the PageType

Introduction

Aurora defines the $pageType variable to determine the main area of the site you are on. Some of the behaviour of this variable could be seen as inconsistent.

A smarty block is provided to abstract away the edgecases around using this variable.

How to use this function

Use the {if_page_type page_type="members"}, {if_page_type_else} and {/if_page_type} tags. See examples later in this page.

Parameters


ParameterValuesDefaultDescriptionRequired
page_typestringn/aThe Page type to check against.Yes
primaryboolfalseIf the page type defined in the template engine hold multiple values, this will determine which value is checked for equality.

If true, the block will show the truthy content if the $pageType variable holds the provided page_type parameter as the first position in the array.

If false (default) the block will show the truthy content if the $pageType variable holds the provided page_type parameter in any position in the array.
No

Examples

{if_page_type page_type="members"}
	<p>Welcome to the members area</p>
{if_page_type_else}
	<p>Welcome to our site</p>
{/if_page_type}