Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a page on a dev site containing 'print site_map_page();' ( http://gwwc2.centreforeffectivealtruism.org/about-us/site-map.php ). This causes the search results page for any search which turns up this page (e.g. http://gwwc2.centreforeffectivealtruism.org/search/node/aid ) to have the title 'Site Map', which is the title of this page.
Comment | File | Size | Author |
---|---|---|---|
#5 | sitemap-changestitleofcurrentpage-1510080-5.patch | 575 bytes | daffodilsoftware |
Comments
Comment #1
darrell_ulm CreditAttribution: darrell_ulm commentedLooking into it. Can anyone else confirm?
Thank you.
Comment #2
Tom Ash CreditAttribution: Tom Ash commentedThanks, I'm sure this is a genuine issue :)
I should say the URLs I gave above have changed to http://gwwc2.centreforeffectivealtruism.org/about-us/site-map.php and http://gwwc2.centreforeffectivealtruism.org/search/node/aid as I've changed my dev site's URL. I'll edit my OP accordingly...
Comment #3
darrell_ulm CreditAttribution: darrell_ulm commentedChanging back to active, thought there was a patch.
Comment #4
darrell_ulm CreditAttribution: darrell_ulm commentedChanged to active until there is a patch.
Comment #5
daffodilsoftware CreditAttribution: daffodilsoftware commentedI have created a small patch that checks the current page title if the page is sitemap page then only it sets the title entered in configuration of sitemap otherwise it keeps the current page title intact.Please review the patch and provide feedback.
Comment #6
daffodilsoftware CreditAttribution: daffodilsoftware commentedI also came across an alternate solution where we can change the hook_menu
from
$items['sitemap'] = array(
'title' => 'Site map',
to
$items['sitemap'] = array(
'title' => variable_get('site_map_page_title', t('Site map')),
It works well but it has a barrier that after any change in value of Page title in sitemap configuration the user need to clear the drupal cache.
darrellulm let me know if you want me to create a patch for same?
Comment #7
frjo CreditAttribution: frjo commentedIs it not simpler to just print "theme('site_map')" instead of "site_map_page()"?
Comment #8
darrell_ulm CreditAttribution: darrell_ulm commentedAgreed, w/ comment above this one:
http://drupal.org/node/1510080#comment-6452010
And I need to take the time to look at your patches and some other ones.
Comment #9
truyenle CreditAttribution: truyenle commentedpatch #5 work for me.
Comment #10
darrell_ulm CreditAttribution: darrell_ulm commentedThanks @truyenle, let me (or someone) test that with the current dev release so we can see if the patch applies. You may have done this already.
Looks like a reasonable solution.
Comment #10.0
darrell_ulm CreditAttribution: darrell_ulm commentedupdating broken dev site URLs
Comment #11
darrell_ulm CreditAttribution: darrell_ulm commentedComment #12
colanMissing space after the "if" and missing squiggly brackets around the contents of the condition.