Developer forum

Forum » Templates » ItemPublisher: Getting folder names in pagetree

ItemPublisher: Getting folder names in pagetree

Jens Mouritzen
Jens Mouritzen
Reply

Hi guys
Can we somehow, in an ItemPublisher template, get the items parent page/folder in the loop?

2020-03-09_12_28_55-Window.png

Replies

 
Nicolai Pedersen
Reply

If you have an item which is a page, you have the page id.

Then you can do var page = Services.Pages.GetById(pageid) and get the properties of that page.

To get the parent of that page, you can do Services.Pages.GetById(page.ParentID)

Untested code!

 

You must be logged in to post in the forum