* * This post is a re-implementation of the old pivot1 plugin that can be found in this link * *
In some cases you might have a URL’s in your fields in the cube, this post will show you how to modify URLs placed in rows of a Pivot table into clickable links.
Purpose & Benefits
This will allow you to jump to either internal or external web resources for further information regarding a certain element.
STEP 1 - ADD THE PLUGIN
- Download the latest version of the plugin from this link and extract the enclosed folder into the plugins folder:
STEP 2 - ADD A URL DIMENSTION
Create a a new pivot table and add the dimenstion that holds the URLs to be one of the pivot's dimensions
STEP 3 - CONFIGURE THE URL COLUMNS
Copy paste the below config script to the widget's id:
const columnsToRenderAsHTML = [3,4];
const columnsToRenderAsPlainURL = ;
Note that there are two options for making your URL into a clickable link :
for HTML values (i.e. <a href='https://www.google.com' target='blank'>Google</a>) or
for normal URLS (i.e. https://www.google.com)
Depending on the type of values you have in your data, choose the correct option and set the column number you want to change, starting at 1.
- If you'd like to have these links refer the user to an external page on the Internet, simply add 'http://' before all links in the actual data. This can easily be done by creating a new custom column in the table which holds the URLs and concatenate() 'http://' to the existing URL using the concatenate('string1', 'string2') function.
- Replace the http://xxx.xxx.com/xxxx/ (just this, without touching the ' or ") with your fixed URL and the column you stated in the variable in the beginning of the code will be appended to the end of this URL.
- This plugin doesn't appear in embed mode.
Please sign in to leave a comment.