Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Triage of Template Tags rendering syntactically incorrect, per Disqus…

… comment
  • Loading branch information...
commit 9b8594af8ccc199ca25eb0dbd4525e88c0c873b7 1 parent eda75a2
d57 authored
Showing with 25 additions and 25 deletions.
  1. +25 −25 docs/en/reference/built-in-page-controls.md
View
50 docs/en/reference/built-in-page-controls.md
@@ -1,6 +1,6 @@
# Built-in Page Controls
-
+
Ever wonder when you use `$Title` and `<% Control Children %>` what else you can call in the templates?. This page is
here to help with a guide on what template controls you can call.
@@ -16,19 +16,19 @@ within another page control.
### Controlling Menus Datafeeds
-#### &lt;% control Menu(1) &gt;%, &lt;% control Menu(2) &gt;%, ...
+#### <% control Menu(1) %>, <% control Menu(2) %>, ...
Returns a fixed level menu. Because this only works in the top level, you can't use it for nested menus. Used <%
control Children %> instead. You can nest `<% control Children %>`.
-#### &lt;% control ChildrenOf(page-url) &gt;%
+#### <% control ChildrenOf(page-url) %>
This will create a datafeed of the children of the given page. Handy if you want a list of the subpages under staff (eg
the staff) on the homepage etc
### Controlling Certain Pages
-#### &lt;% control Level(1) &gt;%, &lt;% control Level(2) &gt;%, $Level(1).Title, $Level(2).Content, etc
+#### <% control Level(1) %>, <% control Level(2) %>, $Level(1).Title, $Level(2).Content, etc
Returns the current section of the site that we're in, at the level specified by the numbers. For example, imagine
you're on the page __about us > staff > bob marley__:
@@ -36,7 +36,7 @@ you're on the page __about us > staff > bob marley__:
* `<% control Level(2) %>` would return the staff page
* `<% control Level(3) %>` would return the bob marley page
-#### &lt;% control Page(my-page) &gt;%$Title&lt;% end_control &gt;%
+#### <% control Page(my-page) %>$Title<% end_control %>
"Page" will return a single page from the site tree, looking it up by URL. You can use it in the `<% control %>` format.
Can't be called using $Page(my-page).Title.
@@ -69,32 +69,32 @@ line*. This interface is implemented by the [api:SiteConfig] class.
### Controlling Parents and Children
-#### &lt;% control Children &gt;%
+#### <% control Children %>
This will return the children of the current page as a nested datafeed. Useful for nested navigations such as pop-out
menus.
-#### &lt;% control AllChildren &gt;%
+#### <% control AllChildren %>
This will show all children of a page even if the option 'show in menus?' is unchecked in the tab panel behaviour.
-#### &lt;% control Parent &gt;% or $Parent.Title, $Parent.Content, etc
+#### <% control Parent %> or $Parent.Title, $Parent.Content, etc
This will return the parent page. The $ variable format lets us reference an attribute of the parent page directly.
### Site Navigation - Breadcrumbs
-#### &lt;% control Breadcrumbs &gt;%
+#### <% control Breadcrumbs %>
This will return a breadcrumbs widgets for the given page. You can call this on any data-object, so, for example, you
could display the breadcrumbs of every search result if you wanted. It has a few options.
-#### &lt;% control Breadcrumbs(3) &gt;%
+#### <% control Breadcrumbs(3) %>
Will return a maximum of 3 pages in the breadcrumb list, this can be handy if you're wanting to put breadcrumbs in a
place without spilling
-#### &lt;% control Breadcrumbs(3, true) &gt;%
+#### <% control Breadcrumbs(3, true) %>
Will return the same, but without any links. This is handy if you're wanting to put the breadcrumb list into another
link tag.
@@ -126,7 +126,7 @@ When viewed on the Home page it will render like this
$LinkOrCurrent ignores the section status, returning link instead. $LinkOrSection ingores the current status, returning
section instead. Both of these options can simplify your CSS when you only have 2 different cases to consider.
-#### &lt;% if LinkOrCurrent = current &gt;%
+#### <% if LinkOrCurrent = current %>
This is an alternative way to set up your menus - if you want different HTML for the current menu item, you can do
something like this:
@@ -139,12 +139,12 @@ something like this:
<% end_if %>
-#### &lt;% if LinkOrSection = section &gt;%
+#### <% if LinkOrSection = section %>
Will return true if you are on the current page OR a child page of the page. Useful for menus which you only want to
show a second level menu when you are on that page or a child of it
-#### &lt;% if InSection(page-url) &gt;%
+#### <% if InSection(page-url) %>
This if block will pass if we're currently on the page-url page or one of its children.
@@ -191,10 +191,10 @@ override `<% base_tag %>` with a specific piece of HTML, you can do something li
### Controlling Members and Visitors Data
-#### &lt;% control CurrentMember &gt;%, &lt;% if CurrentMember &gt;% or $CurrentMember.FirstName
+#### <% control CurrentMember %>, <% if CurrentMember %> or $CurrentMember.FirstName
CurrentMember returns the currently logged in member, if there is one. All of their details or any special Member page
-controls can be called on this. Alternately, you can use `&lt;% if CurrentMember %>` to detect whether someone has logged
+controls can be called on this. Alternately, you can use `<% if CurrentMember %>` to detect whether someone has logged
in. To Display a welcome message you can do
:::ss
@@ -208,8 +208,8 @@ If the user is logged in this will print out
:::ss
Welcome Back, Admin
-
-#### &lt;% if PastMember &gt;%, &lt;% if PastVisitor &gt;%
+
+#### <% if PastMember %>, <% if PastVisitor %>
These controls detect the visitor's previous experience with the site:
@@ -221,7 +221,7 @@ These controls detect the visitor's previous experience with the site:
#### $Now.Nice, $Now.Year
$Now returns the current date. You can call any of the methods from the `[api:Date]` class on
-it.
+it.
#### $Created.Nice, $Created.Ago
@@ -237,11 +237,11 @@ call any of methods of the `[api:Date]` class on it.
If you are using a DataObjectSet you have a wide range of methods you can call on it from the templates
-#### &lt;% if Even &gt;%, &lt;% if Odd &gt;%, $EvenOdd
+#### <% if Even %>, <% if Odd %>, $EvenOdd
These controls can be used to do zebra-striping. $EvenOdd will return 'even' or 'odd' as appropriate.
-#### &lt;% if First &gt;%, &lt;% if Last &gt;%, &lt;% if Middle &gt;%, $FirstLast
+#### <% if First %>, <% if Last %>, <% if Middle %>, $FirstLast
These controls can be used to set up special behaviour for the first and last records of a datafeed. `<% if Middle %>` is
set when neither first not last are set. $FirstLast will be 'first', 'last', or ''
@@ -270,14 +270,14 @@ that aren't accessible within `<% control SearchResults %>`. These can be used
### Search Results
-#### &lt;% if SearchResults.MoreThanOnePage &gt;%
+#### <% if SearchResults.MoreThanOnePage %>
Returns true when we have a multi-page datafeed, restricted with a limit.
#### $SearchResults.NextLink, $SearchResults.PrevLink
This returns links to the next and previous page in a multi-page datafeed. They will return blank if there's no
-appropriate page to go to, so $PrevLink will return blank when you're on the first page. You can therefore use &lt;% if
+appropriate page to go to, so $PrevLink will return blank when you're on the first page. You can therefore use <% if
PrevLink %> to keep your template tidy.
#### $SearchResults.CurrentPage, $SearchResults.TotalPages
@@ -288,11 +288,11 @@ CurrentPage returns the number of the page you're currently on, and TotalPages r
This returns the total number of items across all pages.
-#### &lt;% control SearchResults.First &gt;%, &lt;% control SearchResults.Last &gt;%
+#### <% control SearchResults.First %>, <% control SearchResults.Last %>
These controls return the first and last item on the current page of the datafeed.
-#### &lt;% control SearchResults.Pages &gt;%
+#### <% control SearchResults.Pages %>
This will return another datafeed, listing all of the pages in this datafeed. It will have the following data
available:
Please sign in to comment.
Something went wrong with that request. Please try again.