feature: allow external link on menu

This commit is contained in:
Jean-Baptiste Pasquier 2021-06-22 12:39:21 +02:00
parent f6320fa6f1
commit 77a1d2bd4d
2 changed files with 25 additions and 0 deletions

View File

@ -734,6 +734,25 @@ Module declaration, on `config.json`:
You need the experimental routing enabled to have a Profile Directory.
### Add link to left menu
```
{
"type": "link",
"parameters": {
"icon": "icon-docs",
"name": "some.path",
"target": "https://startinblox.com"
},
"route": true
},
```
Where:
* `parameters.icon` is a valid simple line icon
* `parameters.name` is a path to a translation. You can create your own with the lang component
* `parameters.target` is the target URL
### Route generation
Orbit will, by default, generate an unique route for every of your module. You can customize this route by setting a `route` attribute on your module declaration.

View File

@ -168,6 +168,12 @@ solid-router#navbar-router(default-route=defaultRoute)
div.segment.icon.icon-small.icon-calendar
div.segment.text-uppercase.text-letter-spacing-large(data-trans="menuLeft.events")
div.divider
if component.type == "link"
a.menu-tab.segment.full.padding-xsmall.text-semibold.text-color-white.heading-active.bg-color-heading.transparent-background.hover.active(href=component.parameters.target, target="_blank")
div.segment.margin-right-xxsmall
div.segment.icon.icon-small&attributes({"class": component.parameters.icon})
div.segment.text-uppercase.text-letter-spacing-large(data-trans=component.parameters.name)
div.divider
if componentSet.has('registering')
solid-route(name='join-community', use-id, hidden)
solid-route(name='login', hidden)