Hello, I’m trying to make a plugin for getting the search results assigned categories with the result count. I’m stuck at using the search keyword tag in my plugin.
{exp:search_results_categories search_term="{exp:search:keywords}"}
<-- plugin o/p-->
{/exp:search_results_categories}Can I use like mentioned ?
$this->EE->TMPL->fetch_param('search_term')displays same hash code everytime for diff searches.
Srikanth
Moved to Development and Programming by Moderator
Hi Srikanth,
You can do this but you need to add 1 more parameter to your plugin tag. You need to tell EE to parse the {exp:search:keywords} tag BEFORE it parses your plugin parameters and tags. Since EE parses the tags as they’re encountered in the template, your plugin is getting parsed FIRST which means it’s literally using “{exp:search:keywords}” as the value of your parameter.
The parameter you add is parse=”inward” which makes the exp: tag get parsed first. Try this:
{exp:search_results_categories search_term="{exp:search:keywords}" parse="inward"}
<-- plugin o/p-->
{/exp:search_results_categories}Erik, even after using the above code I’m not able to fetch the value.
{exp:search_results_categories searchterm="{exp:search:keywords}" parse="inward"}
<-- plugin o/p-->
{/exp:search_results_categories}
$searchterm = $this->EE->TMPL->fetch_param('searchterm');
echo $searchterm;Diplays some hash code everytime. Please help.
But
{exp:search:keywords}ouputs the search term when used normally.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.