Copied to clipboard

Flag this post as spam?

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


  • Garrett Fisher 341 posts 496 karma points
    Oct 18, 2013 @ 00:38
    Garrett Fisher
    0

    Getting the ID of the Page to Which a Field Belongs

    Hi,

    I have a situation where I am in a macro on a certain template in which I am looping through a field which has multiple IDs which belong to other pages in the CMS which are related to the current page.  These IDs, though, are IDs which belong to a file field IN these other pages.  What I need is not the IDs that I am looping through,  but the IDs of the pages to which the file field belongs.  Is this possible?

    Hard to explain.

    Thanks,

    Garrett

  • Garrett Fisher 341 posts 496 karma points
    Oct 18, 2013 @ 21:17
    Garrett Fisher
    0

    When inside a field in the code, how do I get the ID of the page to which the field belongs?

    //Garrett

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Oct 18, 2013 @ 23:43
    Chriztian Steinmeier
    0

    Hi Garrett,

    I have a hard time figuring out exactly what you need - but any property is a child of a page/document, so to get that page's ID, you can do:

    <xsl:value-of select="../@id" />
    

    (If you're inside a loop or a template that matches the property)

    Could you show a chunk of the XML? And maybe some of the XSLT too, to get an idea what you're doing?

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft