|Choose what links to display in the toolbar menu|
This tutorial will teach you how to add new links or move / remove existing links in the toolbar menu.
Title : Toolbar Menu Manager
Placement : In all the pages
You can save the script now ( it will add two new links for moderators ), or you can read the next section to find out how you can modify the links displayed in the menu.
2. Modifying the toolbar menu links
To modify the links displayed in the toolbar menu, you will need to edit the submenus object. It's located at the top of the script and looks like this :
The default menu links contain underscores and aren't surrounded by quotes. You can move these around as you wish, or delete them and start fresh.
Creating a custom link
Now then, to create your own link you simply need to define a name that will be on the left of the colon, and then create an array on the right of the colon using brackets. (  ) Let's start simply and create an empty link named HTML Page :
Inside the array you can place three values : [URL, PERMISSION_LEVEL, TARGET]
URL : This should be the URL that you want the link to take you to. Since in the example we're doing an HTML page, I'm going to put '/h1-my-html-page'. Note that your URL should be surrounded by quotes.
PERMISSION_LEVEL : This is the permission level that the link will be available to. It should be a number ranging from 0-2. Choose the level that is best suited for the link :
0 : Visible to anyone
1 : Visible to administrators only
2 : Visible to only moderators and admins
For my example I'm going to choose 0 so the HTML page link is visible to anyone.
TARGET : This is an optional third value. When set to true clicking the link will open it in a new window / tab. It would look like this for example : ['/h1-my-html-page', 0, true]
Now with all my values filled in, the completed link will look like this :
Then when I save the script it should display wherever I placed it in the submenus object.
Creating a separator
If you have multiple links and you want to create a separator it's quite simple ! Since you read the last section you should already know how to create new links, or "items." Follow the same routine, but give it a simple name such as "separator 1." The only difference is that you're going to put a bar ( | ) as the URL.
The script will recognize this and the item will be placed in the menu as a separator instead of a link. The same permission rules apply to separators, so make sure you choose the correct permission level to avoid showing multiple separators side by side.
Furthermore, you cannot have multiple separators named "separator 1," the name is unique, so you must increment the number or change the name for each new separator.
With this script you will be able to change the links displayed in the menu as you see fit. You can also change the URLs and permissions of existing links, or create your own personalized list for your members.. the possibilities are endless, so get customizing !
This tutorial was written by Ange Tuteur.
Permissions in this forum:You cannot reply to topics in this forum