0

I have a Drupal 8 site with a view that uses a taxonomy term as a contextual filter. In a block display for this view, we have a custom button, defined in the footer, that links to a page showing the full page display of the view.

We want the "Read More" custom link in the footer to carry the taxonomy term over to act as a filter on the page display of the view. However, when I go to edit the footer, under "AVAILABLE GLOBAL TOKEN REPLACEMENTS", "view", I see only these:

[view:base-field] - Base field: The base field used for this view.
[view:base-table] - Base table: The base table used for this view.
[view:current-page] - Current page: The current page of results the view is on.
[view:description] - Description: The description of the view.
[view:id] - ID: The machine-readable ID of the view.
[view:items-per-page] - Items per page: The number of items per page.
[view:label] - Label: The label of the view.
[view:page-count] - Page count: The total page count.
[view:title] - Title: The title of current display of the view.
[view:total-rows] - Total rows: The total amount of results returned from the view. The current display will be used.
[view:url] - URL: The URL of the view.

I don't see a token for contextual filter values. Am I looking in the right place? Is there a module that already does it? Or should I write my own?

Edit So I've been poking around, and I found that if I check "Use replacement tokens from the first row", it shows me the following "REPLACEMENT PATTERNS":

{{ path }} == Content: Link to Content
{{ field_image }} == Card Image (rewritten)
{{ title }} == Content: Title
{{ arguments.term_node_tid_depth }} == Content: Has taxonomy term ID (with depth) title
{{ raw_arguments.term_node_tid_depth }} == Content: Has taxonomy term ID (with depth) input

So none of these are the taxonomy value that I want. In the page the display, the filter in the url looks like this socks-and-shoes, when the term is Socks and Shoes. So what I need is the token to generate socks-and-shoes from that term. Just as a shot in the dark, I tried raw_arguments.term_node_term, but that gave me no value.

I also grepped the codebase trying to discover more tokens, specifically view argument taxonomy terms, but I didn't turn up anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.