0

how can I create view content link that links to data based on taxonomy terms?

I have stores in stores page...stores are in views..each store should have a link that links to its products.

4
  • you need to explain better, but I guess you want something like a breadcrumb? – Sohail Feb 18 '16 at 20:41
  • No ...I have a page that have stores ( carrefour,pull&bear,nike,adidas..etc) these stores should have links ..each store should have a link ..the link should take the user to the store products – Bara'a Sa'adeh Feb 18 '16 at 20:43
  • make a views of your taxonomy, just simply showing the parent term for your stores page, once you created that view, once a person click on a taxonomy term, it will load the content related to that term, nothing fancy needed. – Sohail Feb 18 '16 at 20:50
  • can you make it clearer ? – Bara'a Sa'adeh Feb 18 '16 at 20:51
1

Here's how to achieve this:

  • Add relationship that references the taxonomy field you use in the content type.
  • Add a Taxonomy term: Term ID field in Views. Exclude it from output.
  • Add a Custom Text field in Views.
  • Under Rewrite Results check the Output this field as a link checkbox. In the link path use the token for taxonomy term id - [tid]. If you want to use the core page, just enter taxonomy/term/[tid].

Hope it helps.

10
  • Sure, glad it helped! – Aram Boyajyan Feb 18 '16 at 20:59
  • Wait there is a problem hehehe Im sorry but its taking me to "Page not found" ../taxonomy/term/%5Btid%5D – Bara'a Sa'adeh Feb 18 '16 at 21:04
  • You need to make sure that the taxonomy term ID field is listed before the custom text, otherwise Views won't replace the value. Does [tid] appear in the Replacement Patterns for custom text field? – Aram Boyajyan Feb 18 '16 at 21:05
  • it doesn't appear – Bara'a Sa'adeh Feb 18 '16 at 21:06
  • Then make sure that the [tid] is before the custom link field; you can reorder the fields by clicking on the Rearrange local task in views. – Aram Boyajyan Feb 18 '16 at 21:07

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.