Browse Source

feature: allow external link on menu

webpushnotifications
Jean-Baptiste Pasquier 3 months ago
parent
commit
77a1d2bd4d
  1. 19
      README.md
  2. 6
      src/views/partials/menu-left.pug

19
README.md

@ -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.

6
src/views/partials/menu-left.pug

@ -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)
Loading…
Cancel
Save