Inserting function markup in an attribute

Topics: General, XSLT
Jan 10, 2011 at 8:51 PM

Hey guys, 

I've made a small XSLT functions that returns the path for an image, which is select in a metadata field.

Now i'd like to use the path from my function inside a attribute in my HTML layout.

I need to create markup like this, where "The url" is the output from my XSLT function.

<div style="background-image:url(THE URL)"></div>

I've tried inserting the function inside the attribute, but it's not allowed

<div style="background-image:url(<f:function xmlns:f="http://www.composite.net/ns/function/1.0" name="Volleyball.Data.Meta.Topbilled" />)"></div>

The above is a simplified example,, what i need is to be able to set the background for each page on my site.

Does anyone have a great tip, or an idea to what i can do?

 

Regards

  Martin 



Jan 10, 2011 at 11:49 PM

I guess what you need to do is to wrap your entire page layout in a function with a few parameters (one could be the background image) and then parse and override the markup inside that function.

For example in this video you can see how the function will find tables and add different class to table rows: http://docs.composite.net/C1/Videos/Featured.aspx?video=VdlbSTr4ytc