5

I'm trying to make a GUI extension that opens a popup when you are in an RTF field.

The popup contains a browser button to select some components.

How to filter the type of components to select in the browser by a specific schema?

The idea is to add a button to the ribbon of text area. That should work like the standard hyperlink button of tridion, with a browser button to insert tcm:link in the rich text body. The requirement is that the components wich could be selected must be of one specific schema.

something like:

...
case "tcm:":
        if (p.NewLink.href.indexOf("tcm:") != "-1")
        {
            var item = $models.getItem(p.NewLink.href);
            if (item)
            {
                p.NewLink.tcmname = item.getStaticTitle();
            }
        }

        c.BtnBrowse.enable();
        c.BtnOpenURL.disable();
        c.FieldUrl.disabled = true;
        c.FieldUrl.value = p.NewLink.value;

        this._setUrl(c.FieldUrl.value);

        c.RowUrl.style.display = "";
        c.RowAnchor.style.display = "none";
        p.NewLink.tcmuri = p.NewLink.href;
  • Please give some more details about your requirements. not clear from your question – Raj Kumar Jul 24 '14 at 9:04
9

Assuming, you`re opening item select dialog (Tridion.Cme.Views.ItemSelectDialog) to select the component you are interested in, you need to specify a filter in dialog features.

As an example when you click on browse button to open popup dialog:

Extension.Browse.prototype.onOpenClik = function Extension$browse(isControlVisible)
{
    var contextItemID = this.getContextUri();

    var dialogPopup = $popupManager.createExternalContentPopup(
        $cme.Popups.ITEM_SELECT.URL.format(contextItemID, ""),
        $cme.Popups.ITEM_SELECT.FEATURES,
        {
            filter: this.getFilter()
        });
    dialogPopup.open();
};

Where filter is Tridion.ContentManager.ListFilter with all associated properties, such as (new Tridion.ContentManager.ListFilter()).conditions.BasedOnSchema where you can specify the schemas you have to deal with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.