Created
March 16, 2016 11:09
-
-
Save cole007/a18425a153dc0cf77a75 to your computer and use it in GitHub Desktop.
Please add pi.search_assistance.php to /deploy/system/expressionengine/third_party/search_assistance/pi.search_assistance.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{layout="_layouts/_main"} | |
{layout:set name="extra_metas"} | |
<meta name="robots" value="noindex,nofollow,noarchve"> | |
{/layout:set} | |
<div class="wrapper"> | |
<div class="page__main"> | |
<nav class="nav nav--breadcrumbs"> | |
<ul> | |
<li><a href="/">Home</a></li> | |
<li>Page not found</li> | |
</ul> | |
</nav> | |
<div class="page__body page__body--listing"> | |
<h1>Page not found</h1> | |
<p>Sorry, the page you are looking for could not be found.</p> | |
{exp:search_assistance segment="{last_segment}" parse="inward"} | |
{exp:low_search:results keywords="{segment}" limit="10"} | |
{if count == 1} | |
<p>Here are some suggested pages:</p> | |
<ul>{/if} | |
{exp:switchee variable="{channel_short_name}" parse="inward"} | |
{case value="new_equipment"} | |
<li> | |
<a href="/used-equipment/product/{url_title}">{title}</a> | |
{channel_title} | |
</li> | |
{/case} | |
{case value="sundries"} | |
<li> | |
<a href="/sundries-tools/product/{url_title}">{title}</a> | |
{channel_title} | |
</li> | |
{/case} | |
{case value="used_equipment"} | |
<li> | |
<a href="/used-equipment/product/{url_title}">{title}</a> | |
{channel_title} | |
</li> | |
{/case} | |
{case default="yes"} | |
<li> | |
<a href="{auto_path}">{title}</a> | |
{channel_title} | |
</li> | |
{/case} | |
{/exp:switchee} | |
{if count == total_results}</ul>{/if} | |
{/exp:low_search:results} | |
<p>For more results please check out <a href="{path='search?keywords='}{segment}">search results for '{segment}'</a></p> | |
<p> </p> | |
{/exp:search_assistance} | |
</div> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* Search assistance Plugin | |
* | |
* @category Plugin | |
* @author | |
* @link | |
*/ | |
$plugin_info = array( | |
'pi_name' => 'Search assistance', | |
'pi_version' => '0.1', | |
'pi_author' => '', | |
'pi_author_url' => '', | |
'pi_description'=> '', | |
'pi_usage' => Search_assistance::usage() | |
); | |
class Search_assistance { | |
public $return_data; | |
/** | |
* Constructor | |
*/ | |
public function __construct() | |
{ | |
$this->EE =& get_instance(); | |
$data = ee()->TMPL->tagdata; | |
$segment = ee()->TMPL->fetch_param('segment'); | |
$segment = str_replace('bakery','',$segment); | |
$segment = str_replace('-','+',$segment); | |
$this->return_data = str_replace('{segment}',$segment,$data); | |
} | |
/** | |
* Plugin Usage | |
*/ | |
public static function usage() | |
{ | |
ob_start(); | |
?> | |
<h3>Search assistance</h3> | |
<p></p> | |
<hr/> | |
Include your documentation here... | |
<?php | |
$buffer = ob_get_contents(); | |
ob_end_clean(); | |
return $buffer; | |
} | |
} | |
/* End of file pi.search_assistance.php */ | |
/* Location: /system/expressionengine/third_party/search_assistance/pi.search_assistance.php */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment