Copied to clipboard

Flag this post as spam?

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


  • Shaun Brown 6 posts 22 karma points
    Jul 17, 2009 @ 13:09
    Shaun Brown
    0

    Current returning value of the Content Picker, and Ultimate Picker

     

    <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} p {mso-margin-top-alt:auto; margin-right:0cm; mso-margin-bottom-alt:auto; margin-left:0cm; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->

    Hello fellow peoples,

    I'm wondering if you could help me out, I'm fairly new to the CMS, so far i think it rocks!  However, with my "newbizm" I'm seeking help and advise, possibly counseling if I'm unable to solve the issue as it's making me bald...

    The Content and Ultimate picker only returns the Ids of the current pages within the actual site folder, this is cool if you're wanting the Ids...  But in my situation I’m after the actual content.  Are there any settings which I've maybe missed out somewhere to change the return type without me needing to operate on some core language files.

    To give you an insight of what I'm trying to achieve here it goes...

     

    Master page with content place holders for the template, say the right content is going to be available on all the pages, but needs to be content managed for joe bloggs, so he/she can edit the contents of it, rather than it being hard coded in the master page, now... I've created custom doc types for the templates and added nice looking tabs to house the content/ultimate picker in for joe bloggs, but it's only returning the Ids :'(

    I'm new to the XSLT stuff so go easy on me.

     

    Thanks in advance,

    Shaun

  • Ron Brouwer 273 posts 768 karma points
    Jul 17, 2009 @ 13:20
    Ron Brouwer
    0

    Try this:

    <xsl:value-of select="//node[@id = $yourid]/data[@alias = $thecontentyouwant]"/>

    Ron

  • Shaun Brown 6 posts 22 karma points
    Jul 17, 2009 @ 13:23
    Shaun Brown
    0

    Hello Ron,

    Thanks for your quick reply.  Where would I need to implament this line of code?

    Thanks again,
    Shaun

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 17, 2009 @ 13:51
    Dirk De Grave
    0

    You'd probably be inserting a macro into your master page to insert the data from the page that the editors can edit, right? A macro that will reference some xslt file, and this is where you'll be coding the xslt to return the data from the page.

    If, in xslt, you need a specific property of a content node, you'd use:

    <xsl:value-of select="umbraco.libary:GetXmlNodeById(id)/data [@alias = 'propertyAlias']" />

    In above snippet, replace id with the node id returned from the content picker, and propertyAlias with the alias of the property for that specific document type.

    If you're going to a number of properties from a same node, I'd suggest to first create a variable to hold the node info, and query that node for its properties, as in:

    <xsl:variable name="node" select="umbraco.libary:GetXmlNodeById(id)" />

    and use that variable to get the properties:

    <xsl:value-of select="$node/data [@alias = 'propertyAlias']" />

     

    Hope this helps and feel free to ask more questions if still unclear.

     

    Cheers,

    /Dirk

     

     

     

  • Ron Brouwer 273 posts 768 karma points
    Jul 17, 2009 @ 19:24
    Ron Brouwer
    0

    @Dirk

    Can you explain to me why you prefer umbraco.libary:GetXmlNodeById($myid) over //node[@id = $myid]?
    The reason why I´m asking is because I always try to prevent using xsltextensions for better performance.

    Thanks in advance, Ron

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jul 17, 2009 @ 19:47
    Dirk De Grave
    0

    @Ron:

    A real good question, it might be worth investigating which one is faster? I have no idea/clue actually!

    On a sidenote, does '//node' not start from the actual page requested, ie starting from $currentPage, what if node (specified with id) is not a child of $currentPage?

     

    Cheers,

    /Dirk

     

  • Ron Brouwer 273 posts 768 karma points
    Jul 18, 2009 @ 11:52
    Ron Brouwer
    0

    @Dirk:

    All "//" does is start searching. So you can do ".//" or "//" to start from current location or "..//" to start from parent
    I think the default location in xml is the root, so if you want to find something thats a decendent of the currentpage:

    $currentPage//

    You can also specify to start from root when that is not the current location using "///"

    It is only abbreviated syntax that makes live a lot easier.
    You might want to take a look at my favorite xslt reference:

    http://www.mulberrytech.com/quickref/XSLT_1quickref-v2.pdf

    Ron

Please Sign in or register to post replies

Write your reply to:

Draft