Hi - I have a tough issue I’ve been struggling with for some time. A few of the makers of the plugins which I use to accomplish I have flat out told me they won’t support this, so I’m looking for another way:I have a form in one template which collects data in the form of dynamic parameters. For example:
<form action="{site_url}index.php/affiliates/affiliates_search_results/" method="post">
<select name="search:affiliate_region">
{exp:weblog:entries weblog="geography" dynamic="off"}
<option>{title}</option>
{/exp:weblog:entries}
</select>
</form>Then the receiving template displays the results, and paginate themI use the search_fields plugin to simplify the process:
{exp:search_fields weblog="affiliate_network" dynamic_parameters="search:affiliate_regionparse="inward"}
{exp:weblog:entries entry_id="{search_results}" dynamic="off" operator="OR" orderby="url_title" sort="asc" limit="10" paginate="bottom"}
DISPLAY RESULTS HERE
{paginate}
Page {current_page} of {total_pages} pages {pagination_links}
{/paginate}
{/exp:weblog:entries}
{/exp:search_fields}The pagination accurately detects the total number of entries, but when I go to the second page of results, all that post data is lost, so I end up getting all the results from all weblogs. I’m wondering if there is a way to store the post data in some variables that I can pass to an embed, with some sort of dynamic offset, or create a dummy form with a bunch of hidden fields that mimic the search form’s selections, or something. I’d love to hear any solutions or suggestions. Thanks in advance!
Oh, and this is the search plugins link:
http://ellislab.com/forums/viewthread/130518/
Dynamic parameters are a great idea, but their reliance on $_POST data is frustrating and stupid because it breaks pagination.
You will need to modify the core.paginate.php file. Add the following at the top of the show_links method:
if ($this->path !== '')
{
$this->suffix = '?' . http_build_query(array_merge($_GET, $_POST));
}This will get the search data into the pagination links.
And at the top of the search results template add this:
<?php
$_POST = array_merge($_POST, $_GET);
?>Make sure you also turn ‘on’ PHP on input for this template. This should work, but if not post your results to the forum and we can go from there.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.