I have a search page created with embedded filters in Drupal 8 View. In the list of fields I have a fields - [Field_program_id]. I also have a button 'Learn more' when clicking this button I want to pass the [field_program_id] and show the details of the Programs in that page. Not sure where to start. Any guidance?!

My view looks as below:

enter image description here

The '968' is the Program ID. Upon clicking the learn more, I want my url to be https://myproj/search?nodeid=[field_program_id]

and in this page I want to show the details again. Any help?!


In replacement to your "Learn more" add "Custom text" field after "Field_program_id" in your views. In "Text" add "a" tag like

<a href="/search?nodeid={{field_program_id}}" class="button">Learn more</a>

Take a look in "Replacement patterns" for available fields. Read description there too for a guidance.

(this is in Drupal 8)

It is the almost the same in Drupal 7, just with [] instead {{}}. Class for "button" depends of the theme.

  • Thanks. Unfortunately the field is not pulling the corresponding program ID. I am trying to use a PHP file to query the node ID from the database using the Program ID and link it with the button – Rick Jan 21 '20 at 21:28

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.