3

Is there a way to allow logged in users to search on the front-end by ID number?

I’ve got a list of entries here (http://dev.andover-tc.gov.uk/allotments/maintenance).

What I need to do is setup the search box at the top of the page to allow logged in users to type an entry_id number in and only that entry be displayed.

I’m thinking I may be able to use the URL to control this (i.e. allotments/maintenance/147) but can’t work out how to take the data from an input field and use this to create a URL.

Alternatively, if there’s an easier way I’m open to that too.

Thanks in advance,

Tom

2

You could use EvoPost to take the submitted value and send the user to a link. I wrote up a blog post about doing that here. But essentially you'll create your form and have the action url for that form go to a template in your site that has the following or similar code:

{exp:evopost:getpostdata}
  {redirect="/template_group/template_name/{ep_entry_id}/"}
{/exp:evopost:getpostdata}

And voila you'll be pulling up the correct entry.

Hope this helps.

| improve this answer | |
2

You could use something like Mo Variables to access $_GET, then do something like this in your 'search' template:

{redirect="/entry/path/{get:entry_id}"}

Then just have your search form do this:

<form action="pathto/quicksearch-template" method="get">
  <input type="text" name="entry_id">
</form>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.