Once you have created one or more Navigations on your LiveWhale CMS site, you’ll want to display them in your templates and includes.
In the page template, you can display the current group or section navigation using the following XPHP variables:
Group | Section | Description |
---|---|---|
<xphp var="group_title" /> |
<xphp var="section_title" /> |
Name of group or section |
<xphp var="group_title" /> |
<xphp var="section_title" /> |
Link to group or section homepage |
<xphp var="group_navigation" /> |
<xphp var="section_navigation" /> |
Group or section navigation |
If you want to use the same page template whether or not the page is in a section, use a simple XPHP if/then.
1 | <xphp content="true"> |
The above code says, “if this page has a section navigation, show that; otherwise, show the group_navigation.”
By default, a LiveWhale navigation will show
Since LiveWhale 2.0, there is a new option to show only the “immediate family” around the currently active page. When enabled, the navigation widget will instead display
You can enable this on a per-widget basis by adding <arg id="only_immediate_family">true</arg>
to your navigation widget, or enable it site-wide by adding this line to livewhale/client/public.config.php.
1 | $_LW->CONFIG['USE_ONLY_IMMEDIATE_FAMILY_IN_GROUP_NAVIGATION']=true; |
You can use <xphp var="group_breadcrumb" />
in your template to display the current group’s navigation in breadcrumb form. For a more advanced display, you can customize your own breadcrumb widget:
1 | <widget type="breadcrumb"> |
Widget Options | Description | Default | Example |
---|---|---|---|
id | Display this navigation by ID | <arg id="id">123</arg> |
|
main_nav | Display the main navigation for this group (by name) | <arg id="main_nav">Admissions</arg> |
|
separator | Separate pages with this character | » | <arg id="separator">-</arg> |
levels | Display a max number of pages in the path | unlimited | <arg id="levels">3</arg> |
The above widget options allow you to customize the separator and levels on a per-widget basis, but if you’d like to change them site-wide, you can uncomment and edit the following lines in livewhale/client/public.config.php.
1 | $_LW->REGISTERED_WIDGETS['breadcrumb']['custom']['levels']=0; // max # of levels to show for breadcrumb steps (default: 0 i.e. all levels) |
By default, a LiveWhale breadcrumb menu starts from the homepage of your current group and then traverses down the navigation to the currently active page. Since LiveWhale 2.0, there is an additional option for “extended” breadcrumbs that also traverse up into parent directories above the current group’s homepage. You can enable this on your dev site and experiment by adding this line to livewhale/client/public.config.php.
1 | $_LW->CONFIG['ENABLE_EXTENDED_BREADCRUMBS']=true; |