Aptuitiv Studio Documentation

Core Tags

Where can tags be used?

Core tags can be used just about anywhere in the site. They can be used in Templates, Snippets, Navigation Menu Templates and in content pages.

Header Tags

These tags will go in the head (<head></head>) section of the template HTML.

TagDescription
{ap_template:title} Gets the entire title tag along with the title text.
Result: <title>My Title Text</title>
{ap_template:titleText} Gets just the title text. Use in between the <title></title> tags.
Usage: <title>{ap_template:titleText}</title>
Result: <title>My Title Text</title>
{ap_template:css} Gets any links to style sheets or inline styles set by a module.
Result: <link href="/link/to/stylesheet.css" rel="stylesheet" type="text/css" />
{ap_template:head} Gets any miscellaneous information to be placed in the <head></head> section of the HTML.
{ap_template:javascript} Gets any links to javascript files or inline javascript set by a module.
Result: <script type="text/javascript" src="/path/to/javascript.js"></script>
{ap_template:meta} Gets any meta tags set by a content page or a module. This is typically used to pull in the description and keywords meta tags set by an app.
Results: Any meta tag.
{ap_template:doctype} Gets the doctype.
The doctype comes from the doctype set for the template.
Result:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{ap_template:doctype includeHtmlTag="true"} Gets the doctype and the <html> tag.
This is useful for the XHTML doctypes and the <html> tag requires the "xmlns" attribute.
The doctype comes from the doctype set for the template.
Result:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
{ap_template:style} Gets any inline CSS styles set by a module.
Result: <style type="text/css>STYLES HERE</style>

Content Tags

There are a couple of variations of the content tag. The first one is a shortcut tag to just get the main content block. The next two are the exact same in functionality, just their syntax is different.

TagDescription
{ap_content} Gets the main content block.
{ap_content:blockName} Gets the content block specified by 'blockName'.

Inline Javascript Tag

This tag can be used to pull in any inline javascript that should be set within the body of the page.

TagDescription
{ap_template:inlineScript} Gets any inline javascript set by a module to set within the page body.

Navigation Tag

This tag is used to get a particular navigation menu.

TagDescription
{ap_navigation:menuKey} Gets the navigation menu specified by 'menuKey'.

Snippet Tag

TagDescription
{ap_snippet:snippetKey} Gets the snippet specified by the 'snippetKey'.

Container Tag

This tag is used to get the content for a specific container.

TagDescription
{ap_template:container key="containerKey"} Gets the content for the container specified by 'containerKey'.

Breadcrumb Trail Tags

TagDescription
{ap_template:breadcrumb}

Gets the breadcrumb trail for the page.


Options:
startDepth: Integer - Holds the zero-based depth of the breadcrumb array to start at. For example, to always skip the first item in the breadcrumb (i.e. the home page) set it to 1. Defaults to 0.
maxNumItems: Integer - Holds the maximum number of the breadcrumb items to show. For example, to only use the first two items set it to 2. If set to 0 then there is not a maximum number. This is applied after startDepth is applied. Defaults to 0 to allow all items.

Example:
{ap_template:breadcrumb startDepth="1" maxNumItems="3"} 

The above tag will start at the second item in the breadcrumb trail and will include 3 items.

{ap_template:breadcrumbText} Gets only the breadcrumb trail text for the current page.

Variable Tags

Variables are meant to hold values set by a module that can be displayed in a page. They are designated by the following format: {#variableName} where 'variableName' is the actual name of the variable. Below are some of the core variable tags that can be used.

TagDescription
{#body} Catch-all tag for the ID, Class and Onload attributes for the <body> tag. This can be used instead of {#bodyId}, {#bodyClass} and {#bodyOnload} as all of those variable values are contained in this one tag.
Usage: <body{#body}>
{#bodyIdValue} Gets the id text for the <body> tag. This would be used when it's known that the <body> tag will always have an id.
Usage: <body id="{#bodyIdValue}">
{#bodyId} Gets the id attribute for the <body> tag. This would be used when it's NOT known that the <body> tag will always have an id.
Usage: <body{#bodyId}>
Results: <body id="bodyID"> or <body>
{#bodyClassValue} Gets the class text for the <body> tag. This would be used when it's known that the <body> tag will always have at least one class.
Usage: <body class="{#bodyClassValue}">
{#bodyClass} Gets the class attribute for the <body> tag. This would be used when it's NOT known that the <body> tag will always have at least one class.
Usage: <body{#bodyClass}>
Result: <body class="className"> or <body>
{#bodyOnloadValue} Gets the Javascript for the onload attribute for the <body> tag. This would be used when it's known that the <body> tag will always have an onload event.
Usage: Usage: <body onload="{#bodyOnloadValue}">
{#bodyOnload} Gets the onload attribute for the <body> tag. This would be used when it's NOT known that the <body> tag will always have an onload event.
Usage: <body{#bodyOnload}>
Result: <body onload="onloadEvent();"> or <body>

AP Tags

These are miscellaneous tags.

These tags can also be used in Content Templates for an app, Page Content Block Layouts, Form Templates, Navigation Templates, Widget Templates or just about anywhere.

TagDescription
{ap:redirect location="http://www.mysite.com"} Redirects to the given location

Required Option:
location: The URL to redirect to

Optional Option:
status: The HTTP status code. Defaults to 302. Allowed values are 301, 302, 303, or 304.
{ap:date format="format"} Shows the current date in the specified format.
See the Date Formats page for available date formats.
{ap:time format="format"} Shows the current time in the specified format.
See the Date Formats page for available time formats.
{ap:year} Gets the current full year (4 digits).
{ap:year format="format"} Gets the current year in the specified format.
See the Date Formats page for available year formats.
{ap:month} Gets the current full textual month. i.e. October
{ap:month format="format"} Gets the current month in the specified format.
See the Date Formats page for available month formats
{ap:day} Gets the current 2 digit day with leading zero.
{ap:day format="format"} Gets the current day in the specified format
See the Date Formats page for available day formats
{ap:hour} Gets the current 2 digit hour with leading zero.
{ap:hour format="format"} Gets the current hour in the specified format.
See the Date Formats page for available hour formats
{ap:minute} Gets the current 2 digit minute with leading zero.
{ap:second} Gets the current 2 digit second with leading zero.
{ap:pageUpdatedOnTimestamp}

Holds the timestamp for when the newest element on the page was updated. Any of the components on the page could affect this value. Typical items that could affect this date is navigation items, navigation templates, templates, snippets, page content, app item content, and content templates.

Type: 
Integer

Optional Options:
format: The date format to display the timestamp as. See the Date Formats page for available date formats. 

Example:

Output the date as Month/Day/Year

{#ap.pageUpdatedOnTimestamp format="M/d/Y"}

{ap:updatedOnTimestamp}

Holds the last modified timestamp for the item that is the focus of the page. That item could be Page content, a Blog post, a Gallery item, a Store category or another app item.

Type: 
Integer

Optional Options:
format: The date format to display the timestamp as. See the Date Formats page for available date formats. 

Example:

Output the date as Month/Day/Year

{#ap.pageUpdatedOnTimestamp format="M/d/Y"}

{ap:setTitle}

Sets the value of the <title> tag for the page. This will override any existing title value.

Options:
value: The new page title value

Example:

{ap:setTitle value="New Page Title"}

{ap:appendTitle}

Appends some text to the <title> tag for the page. 

Options:
value: The value to add to the page title

Examples:

{ap:appendTitle value=" Stuff at the end"}

A real world example. The goal is that with paginated blog post pages to add the page number to the page title so that it is unique.

If the page title is originally "Blog Posts" after this code the page title will be "Blog Posts - Page 2" (assuming that the visitor is on page 2).

{ap:appendTitle value=" - Page "}
{ap:appendTitle value="{#pagination.current}"}

{ap:prependTitle}

Prepends some text the <title> tag for the page.

Options:
value: The value to add to the page title

Example:

{ap:prependTitle value="Stuff at the beginning "}