Copied to clipboard

Flag this post as spam?

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


  • Profiterole 232 posts 264 karma points
    Aug 17, 2011 @ 20:20
    Profiterole
    0

    contentRandom

    Hi, I was using contentRandom parameter for 3 macros in 4.0. Now I've updated to 4.7 (update worked well) the conctentRandom doesn't work. In showDebug it says that parent does not have child... but it has children!

    So, after a quick search I found this : http://our.umbraco.org/forum/developers/xslt/13030-Parent-doesn%27t-have-childeren-using-contentRandom

    But I could I fix this? I really need this parameter.

    Thank you for your help.

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Aug 17, 2011 @ 23:04
    Chriztian Steinmeier
    0

    Hi Profiterole,

    I'd recommend installing uComponents (it's almost a must-install anyway) and try out the RandomNode() extension. You should be able to change the contentRandom property to a standard Content picker (pick the parent node) - and in your XSLT you can get the randomNode something like this:

    <xsl:variable name="randomNode" select="ucomponents.xml:RandomNode(umbraco.library:GetXmlNodeById(/macro/contentRandomProperty)/*[@isDoc])" />

    /Chriztian

     

  • Profiterole 232 posts 264 karma points
    Aug 19, 2011 @ 02:15
    Profiterole
    0

    Thank you!! Works great! But it would be even better if option that exist directly whitin Umbraco worked...

Please Sign in or register to post replies

Write your reply to:

Draft