November Happy Hour will be moved to Thursday December 5th.

Custom Properties - Accessing page data

Vote:
 
We have built a custom property type which allows you to select multiple files (through the file manager) and stores them in a collection which can be used, for example, to have a list of resources displayed against an online document. There is currently one limitation with this custom property in that you are unable to look at the Page Files folder, only the global files. This is because the file manager call requires an attribute which specifies the page you are on and the id of the page file, therefore connecting to the right Page Files folder. My question is how can I access the current page from within my custom property? I want to be able to determine the page the editor is on, therefore enabling me to obtain the Page File Directory id so I can send this with the call to the file manager dialog. Is this possible?
#13053
May 29, 2007 6:16
Vote:
 
Hi Rachel! You can get a reference to the underlying PageBase through the Control passed in to CreateChildControls() public override void CreateChildControls(string renderType, System.Web.UI.Control container) { EPiServer.PageBase parentPage = container.Page as EPiServer.PageBase; ... } Regards, Johan Olofsson EPiServer AB
#15326
May 29, 2007 9:28
Vote:
 
Thanks! Thats exactly what I needed.
#15327
May 30, 2007 23:48
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.