Take the 2-minute tour ×
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It's 100% free, no registration required.

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;
share|improve this question
    
Please give some more details about your requirements. not clear from your question –  Raj Kumar Jul 24 at 9:04

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
    
thanks for help! –  Julián Hernández Jul 24 at 11:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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