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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

darrell_ulm’s picture

Status: Active » Needs review

Looking into it. Can anyone else confirm?
Thank you.

Tom Ash’s picture

Thanks, 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...

darrell_ulm’s picture

Status: Needs review » Active

Changing back to active, thought there was a patch.

darrell_ulm’s picture

Changed to active until there is a patch.

daffodilsoftware’s picture

I 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.

daffodilsoftware’s picture

I 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?

frjo’s picture

Is it not simpler to just print "theme('site_map')" instead of "site_map_page()"?

darrell_ulm’s picture

Agreed, 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.

truyenle’s picture

patch #5 work for me.

darrell_ulm’s picture

Thanks @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.

darrell_ulm’s picture

Issue summary: View changes

updating broken dev site URLs

darrell_ulm’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community
colan’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/site_map.module
@@ -162,7 +162,8 @@ function site_map_block_view($delta = '') {
+  if(drupal_get_title() == 'Site map')
+    drupal_set_title(variable_get('site_map_page_title', t('Site map')));

Missing space after the "if" and missing squiggly brackets around the contents of the condition.