I'm working on tripal with drupal 7.x I have created new view. i had chosen the fields and i have this table. enter image description here

i want to add the link for each row of the column map Name. i put this tag enter image description herebut i want to change the ID (85) for each row it correspondd to the ID of the map. How can i do? Thank you

  • Is this what you mean by tripal? github.com/tripal/tripal/issues Is this question related to usual Drupal configuration or is it specific to tripal? It's not clear what you're trying to do. Can you edit your question and include more information about the Map field, what ID you need to replace? A translation of the screenshot in a language other than English might also help. – prkos May 21 '19 at 19:59

It seems you're trying to override output of a field in Views using information from one of the fields.

If you turn on the option to Output the field as a link, you shouldn't include the anchor HTML <a href="..., Drupal does that on its own when you turn this option.

If you want to control the HTML you shouldn't use the Output as link option. Instead enter your HTML into the Text area of the Rewrite field.

Or, if you want to use the Overwrite as link option only enter the HREF value into that field.

If we assume that the ID is a separate field then it needs to be added to the Views.

You can use the Exclude from display option if you don't want that field to be visible, but it must be present if you want to be able to use it.

Rearrange the order of the fields so the ID field is above the Map name field.

If the ID number is a part of the Map name field then you have the ID information already available as a token under Replacement patterns.

Edit the Map name field and open the Rewrite results option, then open the Replacement patterns under it. You will see a token for all fields available for that field. One of them will be the ID field. Copy that token and paste it into your HTML override, or the Link href (depending on which option you're using).

Save and check that your token is evaluated correctly and that the link/href is working as expected.

  • It is working perfectly !! Thanks a lot – Yosra May 22 '19 at 9:38

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.