How to add current site into content selector dialog?



I create a custom property that call "Image Gallery" and use "contentSelectorDialog" to select image content, but the problem is missing "For this site" folder and I want to include it into this.

Here is part of the code where to display dialog.

_onAddButtonClick: function (event) {
                    var contentRepositoryDescriptors = this.contentRepositoryDescriptors || dependency.resolve("epi.cms.contentRepositoryDescriptors");
                    this.roots = contentRepositoryDescriptors["pages"].roots;
                    this.isShowingChildDialog = true;
                    this.contentSelectorDialog = new ContentSelectorDialog({
                        canSelectOwnerContent: false,
                        showButtons: false,                       
                        roots: this.roots,
                        //allowedTypes: ["episerver.core.icontentdata"],
                        //allowedTypes: ["episerver.core.mediadata"],
                        allowedTypes: ["episerver.core.icontentimage"],
                        showAllLanguages: true
                    this.dialog = new Dialog({
                        title: "Välj en bild",
                        dialogClass: "epi-dialog-portrait",
                        content: this.contentSelectorDialog,
                        destroyOnHide: true
                    this.connect(this.dialog, "onExecute", "_onDialogExecute");
                    this.connect(this.dialog, 'onHide', '_onDialogHide');
                    this.isShowingChildDialog = true;

I think there is some way to add current site start page in to this.roots. But I don't know how to get current page. Can anyone can help me with this?

Thank in advance,

Oct 02, 2015 10:37

], function (
) {
return declare("xyz",
[_ContextMixin], {
contextChanged: function (ctx, callerData) {
//Current Context
this.context = ctx;
context: null


Edited, Oct 02, 2015 11:00


Thank for reply but the system do not run into contextChanged function, so they cannot assign ctx to this.context.

Edited: this function work in page not in block. This custom property I created in a block, so this function doesn't work. How I can get current site root of a block or site assets root?

Edited, Oct 02, 2015 11:21
* 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.