Search Form Redirect

Status
Not open for further replies.

jarea

Member
I have a simple search form (index.php?option=com_fabrik&task=list.view&listid=20) All of the elements in the list are turned off on this page, so the user really only sees the two search entry fields. Once the search is completed, I want to go to another form that shows a defined set of elements.

It has a couple of search fields at the top and a redirect
The parameters for the redirect are

Published: Yes
Do: Redirect
In: Both
On: Both
Jump Page: index.php?option=com_fabrik&task=list.view&listid=11
Append jump url with data: No
Submission Message: empty
Use as Search Results: Yes
Condition: Empty

I submit the search and it just comes back to the same page. What might I be doing wrong.
 
I have a simple search form (index.php?option=com_fabrik&task=list.view&listid=20)
This URL is calling a list, not a form.
So you are doing list filtering?
Get some records but with no elements (columns) displayed, only edit and view buttons?
And then?
 
Yes, the searchable elements are unique so the result of the search will return one record, if one exists.

Based on your comment, I changed the redirect to index.php?option=com_fabrik&task=details.view&formid=11&listid=11&rowid=1

It still does not redirect, so maybe I am misunderstanding the function of the redirect.

Yes, it shows me just the edit, view and delete buttons and I would love to suppress those if there is a way.

In short, what I am trying to have is a simple search form where I put in a value to search for, when submitted, the form redirects either to a list or detail listing (based on the redirect that I have set) with the (in this case, single) record(s) that is returned from the search.
 
I think you are misunderstanding the redirect.
The redirect is a FORM plugin, you are submitting a record (e.g. creating a new one or editing an existing one) and then you are redirected to the jump URL.

Your URL your-site/index.php?option=com_fabrik&task=list.view&listid=20 is displaying a LIST (Websites in...) with a list filter (this is no search form).
With default settings the complete list (= all records) are displayed, after inserting some filter data only the matching records are displayed.
If you don't want to show the list data before any filter value is inserted set "require filter"=yes in list settings. This will display only the filter block (+ a message "please select at least one filter") and after "submitting" the filter values it will show the matching record(s) (or the message "no data".

Is this what you are looking for?
 
I think you are misunderstanding the redirect.
The redirect is a FORM plugin, you are submitting a record (e.g. creating a new one or editing an existing one) and then you are redirected to the jump URL.

Your URL your-site/index.php?option=com_fabrik&task=list.view&listid=20 is displaying a LIST (Websites in...) with a list filter (this is no search form).
With default settings the complete list (= all records) are displayed, after inserting some filter data only the matching records are displayed.
If you don't want to show the list data before any filter value is inserted set "require filter"=yes in list settings. This will display only the filter block (+ a message "please select at least one filter") and after "submitting" the filter values it will show the matching record(s) (or the message "no data".

Is this what you are looking for?

I think my confusion is related to how to properly construct a Search Form. I was attempting to do the search with filters at the top of a list form. As a newbie, I have had difficulty figuring out any other way to create a search form. Based on the Fabrik 2.0 tutorial (digging deeper, create a form that redirects) I did the following:
  • I created a new form by copying a list, form and group. (not per the tutorial, I had to figure that out)
  • I set the two elements that I wanted to have in the search form, with the element names equal to the element names that I want to search in the target list.
  • I set the form "Record In Database: to "No", turning it into a search form (again, something I had to figure out)
  • I applied the redirect to the form.

Is there a more appropriate way to create a search form in 3.3.2?

Your assistance is greatly appreciated.
 
In principle this is still the way to create a search form (you don't need to copy a/the list, you can directly start to create a new form and then adding the elements).

But I don't understand why you need a search form.
For standard list filtering you only need to enable the filter in element settings (as you have done in your list id 20).

Can you describe
a) what you want to achieve (use your actual list/form names for better understanding), which steps should the user do (frontend links, you can omitt your site name)
b) what you have done so far (e.g. to which form did you add the redirect)
 
In principle this is still the way to create a search form (you don't need to copy a/the list, you can directly start to create a new form and then adding the elements).

But I don't understand why you need a search form.
For standard list filtering you only need to enable the filter in element settings (as you have done in your list id 20).

Can you describe
a) what you want to achieve (use your actual list/form names for better understanding), which steps should the user do (frontend links, you can omitt your site name)
b) what you have done so far (e.g. to which form did you add the redirect)


(you don't need to copy a/the list, you can directly start to create a new form and then adding the elements).
Thanks for that advice - much more straightforward.

I have a test site on my localhost with a list "sites" that is a curated directory of websites. Each sites record has a unique URL.

I want the user to be presented with a single field search form for the element url. Right now I have been testing with the form quick_search.

The user submits the url to the search and ultimately gets the result directed to one of three pages:

  • The URL is found and the status is "accepted" and the user is redirected to the detail form (Websites) for that record
  • The URL is found but the status for that record is "rejected" and the user is redirected to form (Rejected Websites) that displays reasons for rejection
  • The URL is not found and the user is offered a button to click if they want to submit the site for consideration
I recognize there may be some custom PHP or JavaScript necessary to accomplish all of this, but as a first step, I am just trying to get the search form and redirect working.
 
Ok.
A search form doesn't search anything, it's only collecting data which then can be used for e.g. list filtering by adding a redirect plugin with "use as search data" or by creating a jump URL with params for list filtering (but in these cases the search/filtering is done on list display, i.e. AFTER the redirect) or for anything else e.g. in a php plugin.

In your case you must do the search before the redirect with custom php code.

add multiple redirect plugins and use the conditions to determine which plugin has to be run
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top