Accessing the parent entry of a nested structure
  • I have a nested structure 'categories' that I use for a two-tier dropdown menu of rings. The rings are located in the second level of the categories structures. There is a single association linking each ring back to it's category.

    I can access the 'title' text structure of the category of a ring by doing <v=category/title>

    but how do I access the 'title' text structure of the parent category?


    <v=../category/title>

    doesn't work.


    <v=category/../title>

    doesn't work.


  • 9 Answers sorted by
  • Vote Up0Vote Down KevinKevin September 2010

    <v=../title>

    should do the trick.

  • That didn't work. The page is a permalink page for the 'ring'...so I am in the ring context not the category context if that helps.

  • Vote Up0Vote Down Scott September 2010

    Hey Michael - What is the site? You can send a note to [email protected] if you'd prefer to not disclose that info.

  • Vote Up0Vote Down KevinKevin September 2010

    Oh, I understand. Yes, this should be the right way to do it: <v=category/../title>
    I'm not sure why that didn't work for you.

    What do you get when you do this: <v=category/..> ?

  • That gives me the ID of the curent ring.

  • Vote Up0Vote Down KevinKevin September 2010

    That's also incorrect/strange. Send us the URL of the exact page you have to the support E-Mail box and we'll check it out.

  • Vote Up0Vote Down KevinKevin September 2010

    Ah, here's the problem. Although you can traverse back up, the problem is that XPath will automatically optimize out anything it sees that looks like "child/..". It doesn't realize that the ".." is magic.

    You can do something like this:

    <v:section path="category"><v=../title></v:section>

    Let me know if that works for you.

  • Vote Up0Vote Down KevinKevin September 2010

    By the way, I do apologize for giving you incorrect information earlier.

  • That worked perfectly, thank you, this makes sense.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion