Add role based external links to the main menu
Author: @Xavier Thevenot
Introduction
To enable users to easily open external links, configure the platform to display an additional button in the main menu.
The external links menu will open from the button.
Each external link will display for specific role IDs. The platform will only display the external links button if the user's role lets them access at least one link.
Configure a menu button with external links
To configure the external links menu button do the following steps.
Configure client property. In the
client-config-custom.json
file, configure theclient.header.externalurlicons
client property."client.header.externalurlicons" : [ { "url": "https://www.abiquo.com", "icon":"fa fa-user", "label":"Abiquo", "labelCode":"abiquo", "roleIds": [ 1,2,3] }, { "url": "https://www.google.com", "icon":"fa fa-google", "label":"Google", "labelCode":"google", "roleIds": [1] } ]
The property is a list of
url
objects and for each object you can set the attributes described in the table below.Configure the language file. In the language file, for example,
/var/www/html/lang/lang_en_US_custom.json
, add the appropriate labels, for example:{ "mainmenu.button.externalurlicons.label.abiquo" :"Abiquo website", "mainmenu.button.externalurlicons.label.google" :"Google search engine" }
Table of UI configuration properties for external URL menu buttons
Name | Type | Required | Description | Example |
---|---|---|---|---|
url | String | The url of the external link that will open in a new browser window |
| |
icon | String | You can add an icon to your external link. You can specify a valid FontAwesome icon code |
| |
label | String | The label displayed for the external link |
| |
labelCode | String | The code to use in the language files to display the label in each of the available platform languages. You can define labels in each For example: |
| |
roleIds | Array | The list of role IDs that are allowed to display the external link. | [1,2,3] |
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved