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

How to open the media library for picking up the root content reference element?

H F
H F
Vote:
 

Hello,

I wonder how I can open the media library for picking up the root content reference element from the admin tool I am developing?

Same goes how to open the pages explorer, so i can set up the root  content reference for the pages.

thank you for any pointers,

HF

#188978
Mar 08, 2018 7:30
Vote:
 

I am not sure I understand exactly what you want to achieve but EPiServer.Web.SiteDefinition contains information as RootPage (the root of the whole content tree, seen as the Root in the UI page tree), GlobalAssetRoot (the root for all assets such as blocks/media, seen as root in Blocks/Media gadget), SiteAssetRoot (if the site has defined a specific asset root).

You can get all site definitions from EPiServer.Web.ISiteDefinitionRepository.List (repository is registered in IOC container) or the current site if you get type SiteDefinition from container (or uses static property EPiServer.Web.SiteDefinition.Instance)

#189751
Mar 23, 2018 15:33
H F
Vote:
 

Hello Johan,

thank you for the asnwer. 

What I am trying to achieve is let the user of my admin tool pick up the root page dynamically.

I can specify the contentreference in one of the properties in the settings page and then retrieve it from there.. but it is cumbersome, as a user has first set the root in the settings page then return to the admin tool. 

instead i would have the button 'select the root under which the pages will be created', the user selects the root page from the tree and continue working.

So, basically i need to open the 'select the page' dialog from the code. How can I do it?

thank you

#189753
Mar 23, 2018 15:40
* 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.