Hi, we have developed a plugin which accesses a hosted application on a separate server via an API call, and returns search results. However, at the moment it just accepts the search parameters via the tag parameters - see below for a simplified version with just one search parameter.
{exp:rentpro:search town_id='123'}
<strong>ID {property_id}:</strong> {address1}<br>
{/exp:rentpro:search}I need to be able to get these results showing in response to someone submitting a search form, which will have been previously populated with town IDs from a previous API call. Any ideas how / if this can be done?
Thanks, Diarmid
Anyone any advice or experience of this? It’s basically like a normal application’s form submit, which will return results for display. Except in this case the form in the template needs that submit action to retrieve results from an API (via the plugin) and then display the results on the subsequent screen. Not sure if I’m missing something obvious.
Appreciate any pointers… Thanks, Diarmid
You could do something like this:
{exp:rentpro:search town_id='POST'}
<strong>ID {property_id}:</strong> {address1}<br>
{/exp:rentpro:search}function search()
{
global $IN, $TMPL;
$town_id = $TMPL->fetch_param('town_id');
if ($town_id == 'POST')
{
$town_id = $IN->GBL('town_id', 'POST');
}
}Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.