<b:structure> is used to display data from the site structure. This means that you're able to receive all pages the from a certain url without restricting the result to any data model. However, inside <b:structure> you can access only the metadata of the page.
b:structure tags
b:structure.recursion<b:structure.recursion />
|
Runs again with different parent and/or where clause. |
b:structure.resultdata<b:structure.resultdata.field />
|
Displays data about received result and the search. |
b:before<b:before>...</b:before>
|
Show content before the getstructure results |
b:after<b:after>...<b:/afterdata>
|
Show content after the results |
b:data<b:data>...</b:data>
|
Shows content with each result |
b:nodata<b:nodata>...</b:nodata>
|
Show content if there's no results |
b:structure.path<b:structure.path />
|
Content's relative path to the site root. |
b:structure.url<b:structure.url />
|
Content's URL relative to the domain. |
b:structure.name<b:structure.name />
|
Content's human readable name |
b:structure.parent<b:structure.parent />
|
Content's parent's relative path to the site root |
b:structure.position<b:structure.position />
|
Content's position as ordered in Bildy's content browser |
b:structure.datamodel<b:structure.datamodel />
|
Name of the content's data model |
b:structure.id<b:structure.id />
|
Content's id |
b:structure.template<b:structure.template />
|
Id of the content's template |
b:structure.published<b:structure.published />
|
Content's publishing status |
b:structure.created<b:structure.created />
|
Time stamp of content's creation date |
b:structure.modified<b:structure.modified />
|
Time stamp of content's last modification date |
Attributes
name |
What variable name to use inside the tag to refer to result. You can use the same name only once on a page, and the name cannot be any of the reserved names. |
parent(optional)
|
Retrives only pages that share the given parent url relative to the site root. See example 1. You can use path received from:
This attribute must be defined for <b:structure> to be cached. To get also the sub pages under a certain parent, you can use the wildcard in the end of the path. See example 2. |
from(optional)
|
Limit results to only one data model by defining this attribute. See example 3. |
offset(optional)
|
Tells Bildy from which result row to start displaying results. Offset is zero-based so first row is 0 and 10th row is 9. |
amount(optional)
|
Limits amount of received entries. Default is not limited. |
limit(optional)
|
Alias for amount. |
orderby(optional)
|
Orders received entries by this field. Default is position. Fields that you can order by are any of the fields in your data model and also url, name, parent, position (in the same order as in the Bildy browser), modified and created. You can alter the direction of ordering with the attribute direction. |
direction(optional)
|
Defines ordering direction. Valid values are asc (ascending) and desc (descending). Default is ascending. |
where(optional)
|
If given, indicates the condition or conditions that rows must satisfy to be selected. In the where clause, you can use any of the functions and operators that MySQL supports, except for aggregate (summary) functions. See MySQL documentation Chapter 11, Functions and Operators. Please note that if there is no where or parent attributes defined, everything in the structure will be shown. When you define where, the <b:structure> can't be cached which will degrade performance on complex pages. If you only use where to define a parent or data model, see if you can use parent and from instead. For more about caching see Caching. |
nocache(optional)
|
If this attribute is defined, this <b:structure> request will not be cached. |
Examples
Creating a simple navigation
This will create a simple navigation of the top level pages
<b:structure name="toplevel" parent="/"> <b:before><ul></b:before> <li><a href="<b:toplevel.url/>"><b:toplevel.name/></a></li> <b:after></ul></b:after> </b:structure>
Creating a navigation using wildcard
This will create a navigation of all the products under the "products"-page.
<b:structure name="toplevel" parent="/products%"> <b:before><ul></b:before> <li><a href="<b:toplevel.url/>"><b:toplevel.name/></a></li> <b:after></ul></b:after> </b:structure>
Creating a navigation using wildcard and from
This will create a navigation of all the examples in the documentation.
<b:structure name="example" parent="/help/documentation%" from="example"> <b:before><ul></b:before> <li><a href="<b:example.url/>"><b:example.name/></a></li> <b:after></ul></b:after> </b:structure>
Creating a navigation from certain depth up
When you want to create navigations that start from certain depth and continue up (or down), <b:env.request depth="number"/> becomes really handy. Real life situation might be that you have global navigation to show first and second navigation levels and then from third level on you have local navigation (think about the documentation navigation in the Bildy site).
When the number in depth is positive, the levels are counted from the left. When it's negative, the number of levels are taken of from the request.
Notice that the quotes have to be escaped because we're using B:tag inside another B:tag.
<div id="subnavi">
<h3>
Browse
<b:get.metadata.name from="<b:env.request clear=\"root\" depth=\"2\" />">
</h3>
<b:structure name="subnavi" parent="<b:env.request clear=\"root\" depth=\"2\" />">
<b:before><ul></b:before>
<li>
<a href="<b:subnavi.url/>"><b:subnavi.name/></a>
<b:subnavi.recursion parent="<b:subnavi.path/>"/>
</li>
<b:after></ul></b:after>
</b:structure>
</div>

