I have the following in the theme but I want to make it server independent so that it can be moved seemlessly from deve to test to prod.
how do I genericize http://www.devserver.com?
<resource>
<content-type>text/css</content-type>
<href>http://www.devserver.com/CommonElements.nsf/commonMAX.css</href>
</resource>
I would assume the following - but doesn't work as it makes the reference relative to the current .nsf
<resource>
<content-type>text/css</content-type>
<href>/CommonElements.nsf/commonMAX.css</href>
</resource>
From an article on the Notes & Domino App Dev wiki:
"When the XPages runtime emits a URL, it assumes that the root "/" is the root of the application (e.g. /mydb.nsf). But as this notion doesn't exist in the browser, this is added by the JSF runtime. To work around this add the syntax "/.ibmxspres/domino" to the beginning of the path to set the root as the Domino data directory."
In Chapter 14 of Mastering XPages there is a discussion of Themes. Beginning on page 597 there is a discussion of "Resource Paths" and the Path Aliases for three key paths:
/.ibmxspres/domino points to: /data/domino/html/
/.ibmxspres/global points to: /data/domino/java/xsp/
/.ibmxspres/dojoroot points to: /data/domino/js/dojo-1.4.3/ (or the current version of dojo)
So your block is:
<resource>
<content-type>text/css</content-type>
<href>/.ibmxspres/domino/CommonElements.nsf/commonMAX.css</href>
</resource>
Happy coding
/Newbs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With