Home › Toolset Professional Support › [Resolved] Search by age / location CREDS VIEWS
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
Tagged: Toolset Forms, Views, Views plugin
This topic contains 12 replies, has 2 voices.
Last updated by Minesh 6 years, 8 months ago.
Assisted by: Minesh.
Tell us what you are trying to do? I have a business directory. I would like to be able to search by age or location as well as taxonomy) To do this? does age and location have to be a category? or custom post fields? How does the search work? How do I get them set in CREDS (front-end form) so my customers can select the age / location from a drop down so they show up in searches? If they are categories can these be added into the content template in place of fields or is it the field which are searchable?
Work already done= I have created a custom post type already set custom post fields (they currently include ages and location) and a content template. Also completely done all the taxonomy hierarchy (currently does not include ages and location).
I think the problem is that I still don't understand how this next bit works? I really need to understand what the search requires to function. Step by step process would be wonderful with a bit of an overview as to how it all slots together.
What is the link to your site? hidden link
Hello. Thank you for contacting the Toolset support.
Well - it depends on you how you want to setup your structure as view's supports both taxonomy and custom field filters that means you can filter your view by taxonomy as well as custom field.
If you are keen to learn how Toolset works and view's filter works, I strongly suggest to create a test site on our test platform - discover-wp.com and try to play with it.
We offer number of really good reference sites that will eventually help you to understand how view's filter works:
=> https://discover-wp.com/site-templates/
Following links may help you as well:
=> https://toolset.com/documentation/getting-started-with-toolset/filter-content-lists-and-add-custom-search/
=> https://toolset.com/documentation/user-guides/front-page-filters/
Manesh, Sorry for delay. I have had a technical issue on my site which has taken time to resolve.
You did not answer my question:
I am creating a creds form:
1) How do I get a drop down in CREDS (front-end form) so business listings owners can can select the age / location suitable for their business listing
2) How do I get my taxonomy and child taxonomy in the CREDS for so my so business listings owners can can select the age / location suitable for their business listing
Thank you to answer this direct question.
Looking forward to your reply
Holly
Question 2 should read: 2) How do I get my taxonomy and child taxonomy in the CREDS for so my so business listings owners can can select the taxonomy category and subcategory that their listing falls into.
1) How do I get a drop down in CREDS (front-end form) so business listings owners can can select the age / location suitable for their business listing
==> Well - again, it depends on you how you want to setup your structure. You can create the select field for drop-down with options using Types and when you auto-generate the CRED form, the same field will be populated automatically.
If you do not want to create field with Types - you can use CRED Generic field to create your custom field that you can eventually use with CRED form.
=> https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/
For example:
[cred_generic_field field="age" type="select" class="" urlparam=""] { "required":0, "validate_format":0, "persist":1, "default":[], "options":[{"value":"","label":"Choose one"}] } [/cred_generic_field]
2) : 2) How do I get my taxonomy and child taxonomy in the CREDS for so my so business listings owners can can select the taxonomy category and subcategory that their listing falls into.
=> Same thing, if you have assigned taxonomy to your CTP for which you are creating the CRED form - when you auto-generate the CRED form the attached taxonomies and custom field will be automatically available as form field for CRED form.
More info:
=> https://toolset.com/documentation/user-guides/learn-what-you-can-do-with-cred/
Hi Minesh,
You said: "if you have assigned taxonomy to your CTP for which you are creating the CRED form - when you auto-generate the CRED form the attached taxonomies and custom field will be automatically available as form field for CRED form."
I do but I am not able to get them to show as a drop down. See how they look right now: hidden link (blue form) It makes the form too long!
They are currently set up using this html;
<div class="form-group">
<label>Eating Out</label>
[cred_field field='eating-out' display='checkbox' output='bootstrap']
</div>
How do I do that?
Can I do it using this code from you previous message? If yes where do I put the cred shortcode? eg: [cred_field field='eating-out' display='checkbox' output='bootstrap']
---
[cred_generic_field field="age" type="select" class="" urlparam=""]
{
"required":0,
"validate_format":0,
"persist":1,
"default":[],
"options":[{"value":"","label":"Choose one"}]
}
[/cred_generic_field]
---
looking forward to your reply
Thanks
Holly
You should try the following shortcode:
[cred_field field='eating-out' display='select' single_select='true']
More info:
=> https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field
-- <strong>display. </strong> Optional. Used by fields for Hierarchical Taxonomies (like Categories) to signify the mode of display (ie. "select" or "checkbox"). -- <strong>single_select. </strong> Optional. Boolean. If the display=select argument is set, then single_select=true will only allow a single option to be selected (by default multiple options can be selected). Defaults to fals
Hi Minesh,
thank you so much I have applied your Cred shortcode see: hidden link and we are certainly getting there....However it preselects 1 subcategory from each category section automatically which will not work.
I would like to see a --not set-- option at the top of each drop down. An example can be see of what i need to achieve in this shortcode below: (a screen shot is attached) (also can be seen here: "LOCATIONS" hidden link)
<div class="form-group">
<label>Locations</label>
[cred_field field='locations' post='business-listing' value='' urlparam='' select_text='--- not set ---' class='form-control' output='bootstrap']
</div>
Can you help?
Thanks again Holly
Well - you should try to add following code to your CRED form's JS box:
jQuery(document).ready(function($){ jQuery("select[name='to-do[]']").prepend('<option value="0">-- not set --</option>'); jQuery("select[name='to-do[]']")[0].selectedIndex = 0; jQuery("select[name='education-care[]']").prepend('<option value="0">-- not set --</option>'); jQuery("select[name='education-care[]']")[0].selectedIndex = 0; jQuery("select[name='party[]']").prepend('<option value="0">-- not set --</option>'); jQuery("select[name='party[]']")[0].selectedIndex = 0; jQuery("select[name='health-wellness[]']").prepend('<option value="0">-- not set --</option>'); jQuery("select[name='health-wellness[]']")[0].selectedIndex = 0; jQuery("select[name='shops[]']").prepend('<option value="0">-- not set --</option>'); jQuery("select[name='shops[]']")[0].selectedIndex = 0; jQuery("select[name='useful-info[]']").prepend('<option value="0">-- not set --</option>'); jQuery("select[name='useful-info[]']")[0].selectedIndex = 0; jQuery("select[name='save-time[]']").prepend('<option value="0">-- not set --</option>'); jQuery("select[name='save-time[]']")[0].selectedIndex = 0; jQuery("select[name='eating-out[]']").prepend('<option value="0">-- not set --</option>'); jQuery("select[name='eating-out[]']")[0].selectedIndex = 0; });
Could you please confirm - is this resolved?
Minesh, Can you help I have run across a problem today which has only just started happening. I have had a data entry person adding my listings all week from our previous database via the Cred form found on: hidden link
Today however I recieved an email for an actual client who tried to upload a business listing and icouldnt. She said it was not submitting.
I have since been trying to find out the problem I have tried to add a listing myself via the form to trouble shoot what is wrong and I have also found that it is no longer working. The error is to do with the logo upload (see attached)
The data entry person also can no longer add entries and is having the same problem
I have touched nothing on the CRED form since it was working fine.
Please help me trouble shoot this issue
Thank you
Holly
Well - this is new issue and I'm happy that your original issue is resolved to display taxonomy as dropdowns.
May I kindly ask you to open a new ticket with your each new question. This will help other users searching on the forum. Thank you for understanding.
Even you can create a new ticket and assign it to me.
Cold you please mark this ticket resolved as your original issue is resolved with this ticket and I'm happy to help you with another ticket.