core icon indicating copy to clipboard operation
core copied to clipboard

Filtering on host when adding widgets to containers

Open ghost opened this issue 13 years ago • 5 comments

When adding a widget to a container through the add widget button lists all the widgets. This is nice, but when you have many hosts and they all use the same names for their widgets it's almost impossible to find the correct widget. It would be nice if we could filter the widgets there by host. screen shot 2013-10-30 at 17 30 45 pm.

ghost avatar Oct 30 '13 21:10 ghost

ContentletAjax already has support for this, so only the frontend needs to be changed. I was able to filter on the current host by adding two lines to (fieldsValues[2] and fieldsValues[3]) to WEB-INF/velocity/static/preview_mode/preview_mode_controls.vl in dotCMS 3.2.4:

function _dotWidgetSelected(){
    var _dotWidgetSelect = document.getElementById("_dotWidgetSelect");
    var selIndex = _dotWidgetSelect.selectedIndex;
    var woptions = _dotWidgetSelect.options;
    _dotWidgetNameSelected = woptions[selIndex].text;
    _dotWidgetInodeSelected = woptions[selIndex].value;
    _dotStructureTypeName = _dotWidgetNameSelected;
    _dotWidgetSearchString = "";

    if(_dotWidgetInodeSelected == 0){
        _dotWidgetCleanResultsData();
        return;
    }

    var categoriesValues = new Array ();
    var fieldsValues = new Array ();
    fieldsValues[0] = "text1";
    fieldsValues[1] = dijit.byId('_dotWidgetAjaxSearch').attr('value');
    fieldsValues[2] = "conhost";
    fieldsValues[3] = "$host.identifier";

    ContentletAjax.searchContentlet(_dotWidgetInodeSelected, fieldsValues, categoriesValues, false, false, _dotPage, _dotPerPage, "title asc", _dotFillWidgetResults);
}

jorith88 avatar Oct 20 '15 13:10 jorith88

Even better would be to have the same display as in the 'reuse content' popup or the content search, where you can select a content type and search for all fields marked 'searchable'.

Xander-Steinmann avatar Oct 26 '15 13:10 Xander-Steinmann

This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.

stale[bot] avatar Sep 29 '19 12:09 stale[bot]

+1

koenpeters avatar Oct 01 '19 13:10 koenpeters

This issue has been automatically marked as stale because it has not had activity within the past 90 days. It will be closed in 30 days no further activity occurs. Thank you.

stale[bot] avatar Dec 30 '19 14:12 stale[bot]