Copied to clipboard

Flag this post as spam?

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


  • Gary 3 posts 23 karma points
    May 30, 2012 @ 00:09
    Gary
    0

    n00b, stuck with content picker

    Hi guys,

     

    I'm currently trying out Umbraco... love it so far.

     

    I've got stuck at a hurdle though. I'm looking to use a content picker to be able to pick different "widgets" to put onto a page.

    I added a "content picker" to my homepage, which is all good... I then selected the widget that I made (just a few lines of text, fine...

     

    In my macro, I need to insert the following text to be able to display my content on the page...

     

    <xsl:value-of select="umbraco.library:GetXmlNodeById(1098)" disable-output-escaping="yes" />

     

    This works great, but as you can see, the ID is hard-coded in there... I want that ID to come from the content picker (alias is homewidget1)

     

    I have tried <xsl:value-of select="$currentPage/homewidget1" /> but that doesn't work...

     

    Any pointers?

    Thanks,

    Gary :)

     

     

     

  • Nigel Wilson 945 posts 2077 karma points
    May 30, 2012 @ 05:02
    Nigel Wilson
    1

    Hi Gary

    A handy debug "tool" within xslt is to output the xml data within a textarea. This can be achieved as follows:

    <textarea>
    <xsl:copy-of select="$currentPage"/>
    </textarea> 

    You can use it on specific node data too if the node data is in xml format - I have found it invaluable in working out the correct syntax.

    http://our.umbraco.org/projects/backoffice-extensions/ucomponents is worth a look too - as you are adding "widgets" the multi node picker in the uComponents package is a must have.

    Good luck.

    Cheers

    Nigel

  • Gary 3 posts 23 karma points
    May 30, 2012 @ 11:17
    Gary
    0

    Oh wow, now THAT is handy :)

    I usually use PHP, and would often just echo out something to see what it contains... so this will help me hugely. Especially now as I set it to 'widget1' and not 'homewidget1' as I thought I did!

     

    I'll check out the ucomponents link there now.

     

    Thanks again,

    Gary

  • Nigel Wilson 945 posts 2077 karma points
    May 30, 2012 @ 11:33
    Nigel Wilson
    0

    Hi Gary

    Pleased the info has been a help.

    I too used to solely code in php but since starting with Umbraco, it is hard to go back.

    Cheers

    Nigel

     

  • Gary 3 posts 23 karma points
    May 30, 2012 @ 11:56
    Gary
    0

    So in 30 minutes, I managed to get exactly what I needed done (and spent all day trying myself yesterday!)

     

    Thanks again for your help - ucomponents was exactly what I was after!

  • Nigel Wilson 945 posts 2077 karma points
    May 30, 2012 @ 23:30
    Nigel Wilson
    0

    Hi Gary

    Maybe mark one of the replies as the solution - just a housekeeping task...

    Cheers

    Nigel

Please Sign in or register to post replies

Write your reply to:

Draft