Create a URL dynamically from channel field data for Low Search results
I have a channel where I am pulling in tags from Solspace Tag. I am showing 3 random posts of the possible number of entries being returned.
I want to link to a search results page with all the entries related to the tags.
Can I dynamically create a Low Search URL for a button or pass the data from the fields to a results templates to show all the entries related to the associated tags.
One way is to have form fields hidden with the button submitting to show the results template.
Alternatively I was wondering if it were possible to output the field data to a URL (where the template contains a Low Search results tag) . eg. {path='/search/{tag_field_data}'}
Replies
Low 23 Feb 2015 14:42
You're after the URL tag. You should be able to link to tag-related entries by using a tag like:
{exp:low_search:url tag_id="{tag_id}"}
Use any parameter there that you would use on a Results tag.
zizther 23 Feb 2015 15:10
I knew you would have thought of something :)
Can it use tag_name and multiple tag names with a seperator, e.g. tag_one+tag_two
Low 23 Feb 2015 15:47
Yeah, you can use any param provided by the Tags filter:
tag_name="tag_one|tag_two"
Now, how you generate the pipe-separated list is up to you.
zizther 23 Feb 2015 15:48
That is cool.
Yeah I have the content being passed to a embed file ready to go :)
Thanks for your help.