In the function "nodeownership_claim_form" (found in file nodeownership.pages.inc) the following existing line retrieves node titlefrom the database, but then nothing is done with it:
$node_title = db_query("SELECT title FROM {node} WHERE nid = :nid", array(':nid' => $nid))->fetchField();
It would be useful to:
1. Retrieve the title in a way that takes possible translations and the current language into account.
2. Include the node title within the page title, thus giving additional context to the user.
The following workaround is a replacement for the above line of code:
$claimed_node = node_load($nid);
$page_title = t('Claim control of:').' '.$claimed_node->title;
drupal_set_title($page_title);
Slightly more complex, but more useful, would be for the claim page's title to be configurable on the module's admin page, with a token avaialable for %node_title. The current fixed title "Claim node" is unlikely to be a desirable title in most cases, as users generally have no idea what a "node" is.
Comment | File | Size | Author |
---|---|---|---|
#5 | adding_space-2401479-5.patch | 691 bytes | Sonal.Sangale |
#2 | nodeownership-better-claim-page-title-2401479-2.patch | 661 bytes | sja1 |
#1 | nodeownership-better-claim-page-title-2401479-1.patch | 673 bytes | sja1 |
Comments
Comment #1
sja1 CreditAttribution: sja1 commentedAttaching patch.
Comment #2
sja1 CreditAttribution: sja1 commentedFixing malformed patch.
Comment #3
rajeshwari10 CreditAttribution: rajeshwari10 as a volunteer and at Blisstering Solutions commentedHi All,
I have reviewed the latest patch and its working as per required.
Thanks!
Comment #4
ashishdalviDrupal Coding standard suggestion.
1. Always use a space between the dot and the concatenated parts to improve readability.
https://www.drupal.org/coding-standards#concat
Comment #5
Sonal.Sangale CreditAttribution: Sonal.Sangale at Blisstering Solutions commentedAdded space in string and concatenation operator.
Comment #6
swarad07Thanks!
Comment #8
ashishdalviThank for patch and Review.