As the headline says, how do i render Multiple Textstring field in my page layout? Can i do it without creating an XSLT macro?
If not, i would like to create a dynamic macro that takes the field as parameter and renders the content. How do i pass a multiple textstring field as input? Just passing [#fieldname] gives empty input.
The Multiple Textstring datatype stores it's data as xml. This means you'll need an XSLT or Razor macro to render it. Because it's stored as xml it also won't work to pass as a parameter with [#fieldname]. Best way is to just get the data for example with an XPath and render it.
I don't think that you can pass xml as a macro parameter. That's why I recommended to use an XPath to get the data you need. If it's a property on a node and you want to pass it as parameter than you can also fetch it with an XPath.
How to render Multiple Textstring fields?
Hi,
As the headline says, how do i render Multiple Textstring field in my page layout? Can i do it without creating an XSLT macro?
If not, i would like to create a dynamic macro that takes the field as parameter and renders the content. How do i pass a multiple textstring field as input? Just passing [#fieldname] gives empty input.
Hello,
The Multiple Textstring datatype stores it's data as xml. This means you'll need an XSLT or Razor macro to render it. Because it's stored as xml it also won't work to pass as a parameter with [#fieldname]. Best way is to just get the data for example with an XPath and render it.
Jeroen
Hi,
Thanks for your reply. Is it not possible to pass the XML data from the field to a macro?
I don't think that you can pass xml as a macro parameter. That's why I recommended to use an XPath to get the data you need. If it's a property on a node and you want to pass it as parameter than you can also fetch it with an XPath.
Jeroen
Alright, so how you use an XPath to get all values and render them in an HTML unordered list etc?
These wiki pages might help you: http://our.umbraco.org/wiki/reference/xslt/xpath-axes-and-their-shortcuts - http://our.umbraco.org/wiki/reference/xslt/using-xpath/xpath-examples - http://our.umbraco.org/wiki/reference/xslt/xpath-and-xslt-loops.
Jeroen
Thanks!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.