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?
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