I have a taxonomy vocabulary composed of college courses and a "course review" content type that references a term in this vocabulary when creating a new node of that type. I also have a view with this vocabulary, so when a user browses to a courses page they see a "Add your review" link at the top, which is basically a link in the form of "/node/add/review?course_reference_field=[tid]"
This makes it so that users can quickly add a course review without having to find it on a huge select list (which can also slow down the page significantly).
I tested this with a course that already has reviews written. The user navigates the course index. Chooses a course. Gets a list of all the reviews, plus an "add your review link." Working perfectly so far.
The view that lists all reviews for a certain course has the path "courses/reviews/%" where %=[tid], so [tid] is getting passed in the url. Here is the problem: if there is no existing content in the page's view page, then the link "add your review" now points to "node/add/review?field_course_reference=[tid]" without replacing the [tid] token, even though I have [tid] as a field and have arranged it to be on top of the list of fields.
The token is not being replaced for some reason, even though [tid] was originally passed in the url.
Any ideas how to fix this?
Thanks for reading
Comments
Comment #1
mfoda commentedOK. Found a work around: Instead of using [tid] == Taxonomy term: Term ID as a token replacement when outputting the link in the form of "/node/add/content_type/field_reference?=[id]" I used !1 == Content: Has taxonomy term ID input (under the list of available token replacements)
(Of course you have to have whatever argument you're passing in the url caught with the appropriate contextual filter.)
This resulted with the desired behavior of replacing the token with the [tid] that was passed in the page's url.
I assume this would work the same if you were using nid or something similar.
Not sure whether or not this means that the issue is closed.