Enabled with the flick of a switch in a custom field's settings, this feature converts a field's outptut to a link in listings and reviews, allowing users to click and find entries with the same selected value.
Overview
Enabled with the flick of a switch in a custom field's settings, this feature converts field outptut to a link in listings and reviews, allowing users to quickly find, with a click, other entries with the same selected value.
The feature is available for text, single select, multiple select, radiobutton, and checkbox fields.
Getting Started
-
Enable Click2Search within the field settings
When creating or updating a field, enable Click2Search under Display Settings
.
-
Enable search in the fields manager
In the fields manager check that the field is enabled for search. This is the toggle under the search icon header in the list of fields.
-
Confirm Advanced Search menu exists
As mentioned in the Search & Filters page, the first thing you need to do when it comes to search in JReviews is to create an Advanced Search menu.
Now you can visit any listing that has a value for this field and you should see the output is clickable.
Click2Search URL
Having direct access to the Click2Search URL format means you can add parameters, or completely replace the URL.
Listing Type Filtering
The default Click2Search URL format is:
tag/{fieldname}/{optionvalue}/?criteria={criteriaid}
The tags in the format will be automatically replaced and it will be transformed into a search URL.
- If you created an advanced search menu for specific listing types, then this menu will be used as the base URL if found and the results will be automatically filtered by the current listing's listing type.
- If a listing-type-specific advanced search menu is not found, then the main advanced search menu will be used. This menu must be created on all JReviews installs as part of the initial setup.
Category Filtering
To use the current listing's category as a filtering parameter change the format as shown below. This will also change the click2search URL to include the category menu as the base URL.
tag/{fieldname}/{optionvalue}/?cat={catid}
Custom Ordering
To change the ordering of the results you can add an order
parameter.
tag/{fieldname}/{optionvalue}/?cat={catid}&order=jr_productprice
Perform a standard search and then re-order use the ordering list to see the different order
values in the URL that you can use for custom params.
To add extra filtering parameters to the generated links, include the parameters as you see them in search URLs. Check the custom params page for ideas.
To include filters for other custom fields:
tag/{fieldname}/{optionvalue}/?cat={catid}&jr_fieldname=value
Using a field tag {jr_fieldname}
, you can even replace the value for the extra field filter with a dynamic value found in the field within the same listing:
tag/{fieldname}/{optionvalue}/?cat={catid}&jr_fieldname={jr_fieldname}
Custom Theme Suffix
To force the search results output template to load with a specific theme suffix, you can also pass it as a parameter:
tag/{fieldname}/{optionvalue}/?cat={catid}&tmpl_suffix=_suffix1
Custom List URLs
You may not always want or need to do this. However, for extreme control over the generated links and landing pages, you can combine Click2Search with custom lists.
-
Create a custom list page for each field option value, and make sure the menu/page URL format for the custom list includes the option value in its structure. For example, when using this approach for Brands
you could create one menu for each brand so the URLs have this format:
-
Change the Click2Search URL format:
/{optionvalue}
The additional control does require a bit of extra work depending on the number of field options. You would also need to remember to create new menus if new field options are added to the field.
The output format gives you control over the HTML markup used to generate the Click2Search links. The default format is:
<a href="{click2searchurl}">{optiontext}</a>
You can add CSS classes to change the appearance of the link, modify the anchor text, etc.