title: Detecting a category page in the isCategoryPage method
body: <p>I currently have an SCA website that has sub categories that need to display as a category page, and not a Product listing page.  (i.e. display the categories, not the products).</p>
  
  <p>Currently, I have modified the isCategoryPage to override the Facets.Views.isCategoryPage such that it does this correctly.  However, when doing a search on the site - it breaks that page with a blank page.  </p>
  
  <p>I am currently stuck at figuring out how to detect if I am on a search page rather than a category page.</p>
  
  <p>The code is thus:</p>
  
  <pre><code>...
          // @Overrides Facets.Views.isCategoryPage
          isCategoryPage: function isCategoryPage(translator) {
              var currentFacets = translator.getAllFacets();
              var categories = translator.getCategoryPath();
  
              if (&lt;--IsSearchPage() === true ---&gt;) {
                  return (_.keys(categories[categories.length-1].categories).length !== 0);
              } else {
                  return (currentFacets.length === 1 &amp;&amp;
                      currentFacets[0].id === 'category' &amp;&amp;
                     categories &amp;&amp;
                      CategoryHelper.showCategoryPage(categories)
                  );
              }
          },
  ...
  </code></pre>
  
  <p>As you can see the if statement is where I need a bit of help.</p>
  
  <pre><code>if (&lt;--IsSearchPage() === true ---&gt;) {
  </code></pre>
  
  <p>What method, function, code would detect if the page is a search page.  Or if the page url has /search in the url.  (either would work).  </p>
  
  <p>Thank you.</p>