Filtering on host when adding widgets to containers
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.
.
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);
}
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'.
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.
+1
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.