My use case.

I have a portion of a URL of another site (www.example1.com) under each of my nodes (let's say node type B).

Each of these nodes can be related with another node (let's say node type A).

I need a view which show informations of A nodes and get the URL portions from B nodes using the relationship section of the view.

That's ok, I get what I want but I would like to create a URL with this URL's portion adding a constant/token at the beginning (www.example1.com) so that it can changed in a simple way (let's say www.example2.com) instead of modify each field of the view.

My best bet should be probably to rewrite the template of the view and using a constant (variable_get/set should be fine) but I would like to have this field configurable with the UI.


  • does the view show the correct fields (via the relationship) that hold the information you want to present in the link? If so, creating a customized link field should be simple.
    – Geoff
    Jun 28 '14 at 14:08
  • yes, my problem is only focused on how to use a constant or a token or whatsoever variable which can later be changed without changing the view. Think that: you put [my-custom-token]/path1 in the rewrite output of one field, [my-custom-token]/path2 in a second field, [my-custom-token]/pathN in the n-th field. If [my-custom-token] is externally configurable, you can have: [my-custom-token] = "myexternalurl1.com" and then you easily change it "myexternalurl2.com" if you want (that's exactly my case). Jun 30 '14 at 7:31

If I'm understanding the question properly, you can either use a hidden field on a node to create a node specific value which you can rewrite as a link if desired, or create a Global:Custom Text where you can include whatever static or variable data you desire, so long as the fields containing the information are present (visible or not).

  • Yes, you are right. If I create an hidden "Global: Custom Text" with value "www.example1.com" and then I use this value on the rewrite output of the fields that I need to rewrite, I can solve this problem. Then, if I need to change "www.example1.com" into "www.example2.com" instead of changing each field I can just change the value of the "Global: Custom Text" field. Thanks. Jul 1 '14 at 14:26

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.