3 Replies Latest reply on Jun 16, 2013 4:12 PM by Sham HC

    Custom ContentFinder getParams

    pwijaya

      Hi,

      I want my custom content finder tab to show objects based on several "cq:template" attributes of pages. I want the search box to filter further from the list.

       

      Here's my custom content finder:

      {

          "tabTip": CQ.I18n.getMessage("Carousels"),

          "id": "cfTab-Carousels",

          "iconCls": "cq-cft-tab-icon carousels",

          "xtype": "contentfindertab",

          "ranking": 5,

          getParams: function(comp) {

                    var params = new Object();

                    params.query = "\"cq:template\":\"/apps/nike/templates/pes/carousels/notification-carousels\"" + " OR " +

                              "\"cq:template\":\"/apps/nike/templates/pes/carousels/kms\"";

                    return params;

                    },    

          "items": [

              CQ.wcm.ContentFinderTab.getQueryBoxConfig({

                  "id": "cfTab-FeatureCarousels-QueryBox",

                  "items": [

                            CQ.wcm.ContentFinderTab.getSuggestFieldConfig({"url": "/bin/wcm/contentfinder/suggestions.json/content/nike" + ((m = window.location.href.match(/\/[a-z]{2}_[A-Z]{2}(\/one-nike)?/i)) ? m[0] : 'null') + "/pes"})

                  ]

              }),

              CQ.wcm.ContentFinderTab.getResultsBoxConfig({

                  "itemsDDGroups": ["carousels"],

                  "items": {

                      "tpl":

                          '<tpl for=".">' +

                                  '<div class="cq-cft-search-item" title="{pathEncoded}" ondblclick="CQ.wcm.ContentFinder.loadContentWindow(\'{path}.html\');">' +

                                          '<div class="cq-cft-search-thumb-top"' +

                                          ' style="background-image:url(\'{[CQ.HTTP.externalize(values.path,true)]}.thumb.48.48.png\' );"></div>' +

                                               '<div class="cq-cft-search-text-wrapper">' +

                                                  '<div class="cq-cft-search-title">{[CQ.shared.XSS.getXSSTablePropertyValue(values, \"title\")]}</div>' +

                                              '</div>' +

                                          '<div class="cq-cft-search-separator"></div>' +

                                  '</div>' +

                          '</tpl>',

                      "itemSelector": CQ.wcm.ContentFinderTab.DETAILS_ITEMSELECTOR

                  },

                  "tbar": [

                      CQ.wcm.ContentFinderTab.REFRESH_BUTTON

                  ]

              },{

                  "url": "/bin/wcm/contentfinder/page/view.json/content/nike" + ((m = window.location.href.match(/\/[a-z]{2}_[A-Z]{2}(\/one-nike)?/i)) ? m[0] : 'null') + "/pes"

              }, {

                  "baseParams": {

                      "type": "cq:Page"

                  }

              })

          ]

       

       

      }

       

       

      It looks like I have to "AND" the parameters with the text from search box? How do I do that? Basically I want the search to match all of the templates + the search string.