user1753622
user1753622

Reputation: 288

xpages theme add script library to a scpecific XPage

All my XPages apart from "DefaultLogin.xsp" have a resource of xpServerSide added to them, but wondered if there was a way to add this resource via the theme?

Upvotes: 1

Views: 428

Answers (1)

Michael Saiz
Michael Saiz

Reputation: 1640

you can add resources to your theme like this:

<theme extends="whatever">
    <resources>
        <bundle src="prop.properties" var="strings"></bundle> <!-- propertie example -->
        <dojoModule name="extlib.dijit.ExtLib"></dojoModule><!-- dojo module example  -->
        <script src="/whatever.js" clientSide="true"></script><!-- scriptlibray example -->
    </resources>
....
...
</theme>

This will add your script, properties or dojoModule to all your XPages if this theme is selected.

You can also extend this by adding a rendered attribute to the <resource> tag. to load it only on special conditions. e.g.:

<resource rendered="#{javascript:context.getUserAgent().isFirefox()}">
    <content-type>text/css</content-type>
    <href>stylesFF.css</href>
</resource>

Upvotes: 3

Related Questions