Side navigation
-
Unpack the downloaded
zip
file. There will be the following files:-
sidenav-min.js
-
sidenav.css
-
Readme.txt
-
-
In Guide, click on the Customize design icon in the sidebar. The Theming center page opens.
-
Click the theme you want to edit to open it.
-
Click the Edit code button.
-
In the Assets section, click Add asset, then browse to select your files.
Select the
sidenav-min.js
andsidenav.css
files from unpackedzip
. The files are added to your list of asset files. -
In your theme code configuration page under the templates directory, click the
document_head.hbs
file. -
In the
document_head.hbs
file, paste the following snippet:<link rel="stylesheet" href="{{asset 'sidenav.css'}}" />
<script src="{{asset 'apidata-min.js'}}"></script>
<script src="{{asset 'sidenav-min.js'}}"></script>Note
If your
document_head.hbs
template already contains a line withapidata-min.js
file, you don't need to add it. Add a line withsidenav-min.js
below it. - Click Publish.
Options can be passed to the data-sidenav
attribute
as a valid JSON object. For example:
<div data-sidenav='{"homeTitle":"Home"}'></div>
Name | Type | Default | Description |
---|---|---|---|
"content"
|
Array
|
["articles", "sections", "categories"]
|
Content type that you want to display |
"homeTitle"
|
String
|
"Home"
|
The title of the link to the home page. To remove the title in this option you need to pass an empty string. |
"mobileBreakpoint"
|
Number
|
767
|
Browser width at which the view changes from desktop to mobile. |
"showMobile"
|
Boolean
|
true
|
Display or not the side navigation on mobile. |
"buttonText"
|
String
|
"Toggle navigation"
|
Toggle button text |
"includeCategories"
|
Array
|
null
|
An array of category IDs to display. If the parameter is not set, all are displayed. |
"includeSections"
|
Array
|
null
|
An array of section IDs to display. If the parameter is not set, all are displayed. |
"includeArticles"
|
Array
|
null
|
An array of article IDs to display. If the parameter is not set, all are displayed. |
"excludeCategories"
|
Array
|
null
|
An array of category IDs to hide. If the parameter is not set, all are displayed. |
"excludeSections"
|
Array
|
null
|
An array of section IDs to hide. If the parameter is not set, all are displayed. |
"excludeArticles"
|
Array
|
null
|
An array of article IDs to hide. If the parameter is not set, all are displayed. |