Translations
Default translations are done automatically. To bypass translations add an `@` at the being of the string.
What are the navigation links?
The title bar is the navigation toolbar at the top of knowledge base and Foundation based themes. It contains menu items that represent the global navigation of your site.
It looks like this by default.
Customizing Navigation Links
We can customize the Titlebar to use any custom navigation links we would like, instead of the default ones.
These can vary by language, but if a specific language is not found, the "default" will be used.
A permission can also be defined for displaying a certain link.
Setting the default nav items.
:themeID/assets/variables.json
{
"navigation":{
"navItems": {
"default": [
{
"to": "/discussions",
"children": "Discussions"
},
{
"to": "/categories",
"children": "Categories"
},
{
"to": "/kb",
"children": "Help",
"permission": "kb.view"
},
]
}
}
}
Setting links for a specific language
This can be used alongside the default.
{
"navigation":{
"navItems": {
"fr": [
{
"to": "/kb",
"children": "Innovation Hub",
"permission": "kb.view"
},
{
"to": "/discussions",
"children": "Latest Discussions"
},
{
"to": "/categories",
"children": "Categories"
},
]
}
}
}
Handling Subcommunities
By default all paths will have the current subcommunity applied to them. Let's look at an example, assuming that our site is at community.mysite.com
.
{
"to": "/kb/getting-started",
"children": "Getting Started"
}
If my site has no subcommunities then the actual URL this points to will be community.mysite.com/kb/getting-started
.
If I do have subcommunities then the question becomes, which subcommunity will be used to make the URL? By default the current subcommunity the user is in will be used. So if I visit the page at /fr/kb/articles/5-bienvenue
then the URL in the navigation will be community.mysite.com/fr/kb/getting-started
.
Choosing the subcommunity for the URL
The simplest way to do this is to add a ~
to the start of your URL and manually specify our subcommunity. Let's update our definition.
{
"to": "~/other-fr/kb/getting-started",
"children": "Getting Started"
}
By putting the ~
character, the subcommunity will not be added to the URL. So the final URL will be community.mysite.com/other-fr/kb/getting-started
.
Hub/Node URLs
The current node's will be automatically added to all URL formats defined above if available.
Absolute URLs
At this point you might be saying, "What if I want a URL that goes somewhere else?". That's easy enough. Just use a fully qualified URL.
{
"to": "https://mysite.com/products",
"children": "Products"
}