LinkDirectoryHelper.js file

For greater readability, the JS code for saving user preferences and deleting links has been moved to a separate file, LinkDirectoryHelper.js.

If you've overloaded the XSL template "common-service-head-js", add the JS file import

<script type="text/javascript" src="{ametys:pluginResourceURL('link-directory', 'js/LinkDirectoryHelper.js')}"></script>      

If you have overloaded the template XSL "configure-links-btn-script", this template must now call the JS methods AmetysHelperLinkDirectory.removeUserLinks and AmetysHelperLinkDirectory.saveUserPrefs.

Similarly, if you use the link directory as input data in your charter, add this import to the templates that use it.
For example :

<xsl:template name="additionnal-script">
<script type="text/javascript" src="{ametys:pluginResourceURL('link-directory', 'js/LinkDirectoryHelper.js')}"></script> 
</xsl:template>

Link status

Each link in the directory has a status (Normal, New or Down). 

A new template XSL "link-status" can be used to add a CSS class depending on status.
Default "broken" for a broken link, "new" for a new link.

You can override this template to use your own css classes.

Hidden links

It is possible to allow a logged-in user to choose which links they do not wish to see (hidden).
"Hidden" links are stored in the user's preferences.

In the input XML , hidden links have the @isHidden attribute set to true.

If you want to manage hidden links, remember to do so in the following templates:

<xsl:template match="link[@url != '' and @isHidden = 'false']" mode="thumbnails">      
ou      
<xsl:template match="link[@url != '' and @isHidden = 'false']">      

Please note that the default jquery dialog box for link configuration does not allow links to be hidden.

Back to top