Access container page of a component in .net based CT
Posted
by
Huston Lopes
on Stack Overflow
See other posts from Stack Overflow
or by Huston Lopes
Published on 2012-09-24T09:36:06Z
Indexed on
2012/09/24
9:37 UTC
Read the original article
Hit count: 317
tridion
|tridion-2011
We are developing a .net based CT based on Broker query Mechanism (filter):
ComponentPresentationAssembler cpAssembler = new ComponentPresentationAssembler(Page ID,Page object);
In order to pass the page ID, I need to get the access of page on which the component is present. How can I access the page from package? Since this a CT, a component object would be available in page and not a page object. Tried the following piece of code, but without success:
string pageURI = _package.GetValue("Page.ID");
Page objPage = (Page)_engine.GetSession().GetObject(pageURI);
This is not working as there is no page object. What are the alternatives so that we can access the parent page of component from CT?
© Stack Overflow or respective owner