All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

base_url variable doesn't parse in Low Search Results

Stephen 27 Mar 2017 21:04 problem, complete

I'm running ExpressionEngine 3.5.4 and Low Search 5.1.0. I set the Search Results field in the Channel Settings to use the {base_url} variable such as {base_url}/blog/post. When I use the {auto_path} variable in the Low Search Results tag it isn't parsing the {base_url} variable so the URL that it's pulling in looks like {base_url}/blog/post/test-blog-post.

Not sure if that's expected, but it would be great if that variable would parse in the exp:low_search_results tag.

Replies

  1. Low 28 Mar 2017 06:42

    Ah right. Haven't had the chance to add that in LS just yet. To fix, open up filters/keywords/lsf.keywords.php and look up line #1223 and #1224, which read:

      $this->_prep_urls(); 
    }


    Move that first line below the curly bracket, so it becomes:

    } 

    $this->_prep_urls();


    Then, look up line #546, which reads:

    $url = rtrim($url, '/') . '/';


    Below that, add a new line with:

    $url = str_replace('{base_url}', ee()->config->item('base_url'), $url);


    which should fix it.

  2. Stephen 28 Mar 2017 19:10

    Thanks for the quick response. That fixed it!