Append query to search results path

Created on 6 February 2017, over 7 years ago
Updated 3 July 2023, 12 months ago

Hi,

Bit of a random support request, but any help would be gratefully received...

I currently have a form in a block using search autocomplete, which populates node results from a view and then upon selection, takes the user to the node they have searched for. Perfect.

Current page: Any
URL that search autocomplete links to from search block: http://www.example.com/page/city/county

What I am now trying to achieve is appending a query to the URL from the search results dependent on the taxonomy page they are currently on:

Current page: Taxonomy page
URL that I WANT search autocomplete links to from search block: http://www.example.com/page/city/county?tid=CURRENT_TAXONOMY_ID

Basically, what I am trying to do, is style the information via a views contextual filter on the page that they arrive at, based upon the taxonomy page they were on when they used the search autocomplete block, i.e. page they link through to has extra information based around the taxonomy page they were on. I have already set all of that functionality up and it works with a static term ID added, BUT I can't figure out how to append ?tid=?tid=CURRENT_TAXONOMY_ID dynamically onto the URL of the selected node from the form.

What I Have Tried:

I tried appending the query through the populating view by adding a PHP field which checks for the current pages' taxonomy term id and then rewrite it into the URL field. All looked fine, but it appears that when it is doing the current taxonomy term id lookup, the view isn't recognising that it is on the taxonomy page so isn't pulling the correct id number in.

Like I said, very specific probably, (and probably appallingly described) but any help would be greatly appreciated.

πŸ’¬ Support request
Status

Closed: outdated

Version

4.7

Component

Miscellaneous

Created by

πŸ‡¬πŸ‡§United Kingdom stuhannaford

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024