1

What I have right now is an obituary page, with a listing of obituaries. Clicking on one of those listings takes you to that person's obituary page. There are links on that page for visitors to send their condolences to or make a memorial donation. The links look similar to http://shawnjacksonfuneralhome.simalam.ca/node/add/condolences?field_obit=131 and http://shawnjacksonfuneralhome.simalam.ca/node/add/memorial-donations?field_obit_donation=131. The text after the question mark is there to prepopulate a select list of entity references on the next page.

There are 2 things we are trying to do here. First, we want to change the title from the standard "Create Condolences/Memorial Donations" to something like "Send Condolences to the family of X" where X is the name of the deceased person. I've tried using the drupal set message function to find the value selected in the list.

drupal_set_message("Obit Name:

" . print_r($node->field_obit, TRUE) . '
');

According to those results, the value of the prepopulated select list should be like this:

$obit_name = $node->field_obit['und'][0]['entity']['title'];

However, it doesn't display anything (either with echo, print, or print render()).

The second thing we are trying to do is after the visitor submits their condolence/donation, we want them to be redirected back to the obituary page they were just on, along with a message thanking them for their actions. I've tried using the Rules Module to redirect and display a message, but it won't do both for some reason. It will not redirect to the previous page, either.

1 Answer 1

0

For the dynamic node titles you might want to take a look at Automatic Nodetitles module. It allows you to use tokens in the node title. These token can represent text from node fields.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.