I'm working on this funeral site, which has a listing of obituaries. On each individual obituary page, there are buttons for visitors to send their condolences and/or to make a memorial donation. I have a template set for these content types with the following snippets of code:

<h2><?php print l(t('Send Your Condolences'), 'node/add/condolences', array('query' => array('field_obit' => $node->nid))); ?></h2>

This creates a link for the visitor to click to send their condolences. 'field_obit' is a field that exists when creating a content type "condolences" that is an entity reference select list listing all of the names of the people listed in the obituaries. The code grabs the current node ID and matches that value to one in the drop down list, resulting in a URL like this:

/node/add/condolences?field_obit=100

So, for example, if the node ID for Jim Bob's obituary was 100, clicking the "send your condolences" link on his obituary page would send the visitor to the add condolences page, where "Jim Bob" would automatically be selected from the select list. I have something similar set up for memorial donations.

What the client wants, however, is a different URL for sending condolences and making donations. Something closer to this:

/name-of-deceased/condolences

What I was wondering was if there was a module that could deal with giving a URL alias to node/add, node/edit, and node/delete. I tried digging around a bit myself but came out empty-handed. I also tried looking in Home » Administration » Configuration » Search and metadata » URL aliases but didn't find anything that would help. I also need to find a way to translate that node ID into a string.

Comments

vm’s picture