Best Practices? Create dynamic links with static titles on node full view page As with anything drupal, there are a million different ways to do something. I am asking this question for 1) Because I actually have to do something similar and 2) Because I would like to know all the different ways this could be achieved and the pros and cons of each. Is creating a custom field the way to go or should you just dump some dynamic code in the node-album.tpl.php template? Which way is the most flexible? Which is the most non-coder friendly?

Scenario: You have two content types (say, photo and album) where photo has a file field for an image and album is a collection of photo nodes.

If a user is viewing an album node type, how would you go about creating a "add photo" link on the full node view to add a photo to that specific album? Using the entity reference prepopulate module.

So how would you give users a way to click on a link/button for:

http://www.domain/node/add/photo?field_album_reference=[node:nid]
This is how I do mine if it's entity reference prepopulate:

&lt;?php 
        $l = l( t('Add Photo'), 'node/add/photo',   array('query' =&gt; array('field_album_reference' =&gt; $nid)  ));
        echo $l; 
?&gt;


But I usually use node reference widget when for example adding an album coming from venue content type. Code example:

&lt;a href="&lt;?php print url('node/add/venue-photo-album/' . $node-&gt;nid); ?&gt;"&gt;Add Photo album&lt;/a&gt;