CSS in XSLT writing wrong path when publishing
In my XSLT, i'm trying to use this tag:
<div class="mainHero" style="background-url: {mainHero/path}">
when published the path looks something like this:
/WRAP_SDDU/IUK-IUK-CAMPUS/IUB-migration/alumni/img/bgHero.jpg
how can i get it to write the correct path on publish?
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ryan Griffith on 21 Aug, 2012 12:42 PM
Hi fuelishways,
I don't believe background-url is valid CSS property, I think you would want to use background-image: url(). Let's try the following:
2 Posted by fuelishways on 21 Aug, 2012 01:31 PM
yes, sorry, I had copied the wrong code. I did update it to your valid property and it is still publishing the full cascade server path. any ideas?
3 Posted by Ryan Griffith on 21 Aug, 2012 01:38 PM
It sounds like the URL path in the inline-style isn't being tracked by Cascade. Let's try the following to see if we can force the tracking:
4 Posted by fuelishways on 21 Aug, 2012 01:48 PM
great! that seemed to work now. when does the [system-asset] tag need to be used? I've never had to use that tag before.
5 Posted by Ryan Griffith on 21 Aug, 2012 01:59 PM
Glad to hear that did the trick!
Cascade will rewrite links/paths for the more common attributes such as href and src, here is a list of some of the attributes that Cascade will track.
For something like inline styles (ie url()) you would need to add in the
[system-asset][/system-asset]
pseudo tags, very similar to adding tracked links within files (eg CSS stylesheets). Here is some additional information about tracked links within Files and non-recognized attributes.Please let us know if you have any questions.
Thanks!
Ryan Griffith closed this discussion on 22 Aug, 2012 01:43 PM.