Jump to content

Mats

Members
  • Posts

    355
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Mats

  1. Corrected code:

    $q = $sanitizer->text($input->get->q);
    if($q) {
    $input->whitelist('q', $q);
    $qs = explode(" ", $q);
    foreach($qs as $key => $q){
      $qs[$key] = $sanitizer->selectorValue($q);
    }
    $selector = "title|body|interests*=" . implode("|", $qs) . ", limit=50";
    if($user->isLoggedin()) $selector .= ", has_parent!=2";
    $matches = $pages->find($selector); 
    if($matches->count) {
    $content .= "<h2>Found $matches->count pages matching your query:</h2>";
    $content .= renderNavPanel($matches);
    } else {
    $content = "<h2>Sorry, no results were found.</h2>";
    }
    } else {
    $content = "<h2>Please enter a search term in the search box (upper right corner)</h2>";
    }
    • Like 1
  2. I don´t think you should have a index.html file in your site/templates folder. Only the template files, home.php etc.  

    If you have a dot in the url the page will be routed to the home page. That's my experience wit dots in urls anyway.

  3. Is there a way of checking if the module finds any items to display in the navigation?

    What i would like to do is check if there are any navigation items found, if so show a link to the submenu further down the page (on mobile), if not don't display the link. 

    Solved it with javascript instead.

×
×
  • Create New...