Developer forum

Forum » Templates » Getting item field data from top page on subpages?

Getting item field data from top page on subpages?

Jacob Storgaard Jensen
Reply

Hi guys,

 

I have extended my page properties with an item field: Item.Page.LongMenuText

 

I would like to fill in this field on my top level pages, and access it on my subpages.

 

I would like it inside my navigation UL, and has managed to move it there with the Snippets functionality, but this is (obviously) only working when I'm on the top level page, not on the children.

 

So can I in any way hardcode a global paragraph, which via the Datalist module, creates a new view using a custom SQL, that gives me all the Page.Top.ID's and their corresponding Item.Page.LongMenuText?

 

Then I can match the Global:Page.Top.ID with the Page.ID and thereby get the Item.Page.LongMenuText that are in context...

 

As you can read, I pretty much has it figured out... I just don't know enough SQL to make the new view :-(


Replies

 
Jacob Storgaard Jensen
Reply

Well never mind... Research and you shall find :-)

 

SELECT        dbo.Page.PageID, dbo.ItemType_ExtendedPageProps.LongMenuText
FROM            dbo.Page INNER JOIN
                         dbo.ItemType_ExtendedPageProps ON dbo.Page.PagePropertyItemId = dbo.ItemType_ExtendedPageProps.Id
WHERE        (dbo.Page.PageParentPageID = 0)

 

 
Jacob Storgaard Jensen

 

You must be logged in to post in the forum