Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kasper Gadensgaard 31 posts 52 karma points
    Aug 26, 2012 @ 14:35
    Kasper Gadensgaard
    0

    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.

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Aug 27, 2012 @ 12:37
    Jeroen Breuer
    0

    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

  • Kasper Gadensgaard 31 posts 52 karma points
    Aug 27, 2012 @ 13:19
    Kasper Gadensgaard
    0

    Hi,

    Thanks for your reply. Is it not possible to pass the XML data from the field to a macro?

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Aug 27, 2012 @ 13:28
    Jeroen Breuer
    0

    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

  • Kasper Gadensgaard 31 posts 52 karma points
    Aug 27, 2012 @ 13:30
    Kasper Gadensgaard
    0

    Alright, so how you use an XPath to get all values and render them in an HTML unordered list etc?

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Aug 27, 2012 @ 13:32
  • Kasper Gadensgaard 31 posts 52 karma points
    Aug 27, 2012 @ 13:33
    Kasper Gadensgaard
    0

    Thanks!

  • 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.

Please Sign in or register to post replies