diff --git a/README.md b/README.md index beea84a..5ef74a3 100644 --- a/README.md +++ b/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. diff --git a/src/views/partials/menu-left.pug b/src/views/partials/menu-left.pug index bb40e84..2fd8c5a 100644 --- a/src/views/partials/menu-left.pug +++ b/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)