View Full Version : Refine this search and pasteable search URL pseudo-features

25 Nov 2006, 21:36
This is not really a new feature but just surfaces one that was readily available, though in such a way that it was hard to notice.

The feature does two things:
Provides a Refine This Search type feature
Provides a URL to a search that includes all options and can be shared with other users

In the search_results template look for :
<a href="search.php?$session[sessionurl]$searchquery"><strong>$vbphrase[search]:</strong></a>

Replace by:

<if condition="$displayWords"><!--Edit search Hack--><strong>&nbsp;$vbphrase[search]&nbsp;(<a href="search.php?$session[sessionurl]$searchquery" style="text-decoration: underline;">$vbphrase[edit]</a>):</strong><else /><a href="search.php?$session[sessionurl]$searchquery"><strong>$vbphrase[search]:</strong></a></if>

The link uses tcat css definition and is therefore not underlined and hence does not look like a link, which is one of the reasons why the feature is so hard to find, so i have forced the underline with style="text-decoration: underline;". Alternatively, you will surface lots of links disguised as plain text by editing the tcat css so that tcat links are underlined, which is what i do and recommend.

No new phrases are needed as i am only re-using phrases. And works for all languages.

The conditional is used to avoid the feature being shown on search results that are not quite such things, such as 'New Posts'.

Before and after screen dumps enclosed (keywords look like links in both cases because they are underlined. Not very intuitive really (they are not links), but the fix for this needs editing search.php where the <b> codes reside) :

06 Dec 2006, 03:56
the above code can be found in the search_results template

06 Dec 2006, 06:57
the above code can be found in the search_results template

Indeed, i forgot that very important piece of info. I have edited the initial post. Thanks.