Adam Terrey
Adam Terrey

Reputation: 350

Is there a way to get the diazo abslolute prefix in an xsl section in a diazo rules.xml file?

looking for something like:

<replace css:content="#portal-logo img">
   <img src="{$absolute_prefix}/images/logo.png" />
</replace>

Currently gets this error:

runtime error, element 'img' [318:0]
Variable 'absolute_prefix' has not been declared. [0:0]

Upvotes: 2

Views: 155

Answers (1)

davidjb
davidjb

Reputation: 8727

Looks like you'll probably want to use the base variable, provided you're using Diazo via plone.app.theming, which provides the Zope BASE1 variable as an XSLT parameter:

<replace css:content="#portal-logo img">
   <img src="{$base}/images/logo.png" />
</replace>

Details of the theme parameters available by default are found at https://pypi.python.org/pypi/plone.app.theming#theme-parameters.

If you're using straight Diazo, then you'll need to pass such a parameter in from your environment.

Upvotes: 2

Related Questions