Mike
Mike

Reputation: 6050

How to get a Sitecore Items Parent Path

We are using the weblog module.

So you have a

Blog template 
    -- Folders
       -- Entry

We are trying to get the Item path for the Blog Item itself to set as a datasource for a link Item

Can I get the grandparent's Item path info from the Entry object using sitecore query or something else

Upvotes: 0

Views: 2426

Answers (1)

Jim Noellsch
Jim Noellsch

Reputation: 714

Via property traversal:

Sitecore.Context.Item.Parent.Parent

Via query:

./ancestor::*[@@templatename='Blog template']

Am I over simplifying a response to your question?

Upvotes: 2

Related Questions