0

How can I get parameter i.e node id from URL in views link path . Eg. - suppose in taxonomy term's view I am giving field name's custom link path is "document/getParameterFromCurrentURL/{‌{tid}}". where suppose getParameterFromCurrentURL is variable or etc so how can i get id from current Given node id 1 in image is static in that place where I want to add parameter from urlurl in getParameterFromCurrentURL.

1

You could try adding a "Global: Null" contextual filter to your Views display, configured to "Provide default value" with type "Content ID from URL".

The Null filter type doesn't change the output of your view. But it would make the Node ID available as a replacement pattern.

2
  • Dear your approach is approx right. I tried adding a "Global: Null" contextual filter to my Views display, configured to "Provide default value" with type "Raw value from URL" and selected path component "2" from drop down. And according to replacement patter my path looks like "documents/{{ raw_arguments.null }}/{{ tid }}" . after first click its working fine but second time it seems its storing in somewhere in cache and after click on other category showing result of old ID. means when i cleared its cache from config performance then again first time its storing right id . plz help – manoj kumar Srivastaw May 14 '20 at 7:48
  • Problem has been solved :D In advance tabI removed css caching to none. – manoj kumar Srivastaw May 14 '20 at 9:19

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.