We need to be able to let users show menus in the sitemap, but have different titles than what shows up by default where the menu actually exists. We would like a "sitemap title" option on the menu edit form so that they can specify a title to use specifically for that page.

CommentFileSizeAuthor
#1 sitemapmenutitleoverride.patch2.12 KBcamprandall
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

camprandall’s picture

Status: Active » Needs review
FileSize
2.12 KB

I have a minor patch that adds a sitemap menu title field to the edit menu form, saving the results in variables, and then shows the alternate title on the sitemap configuration form as well as the sitemap itself.

vikramkanav’s picture

vikramkanav’s picture

Hi Campradll
I used your given patch but its does not over ride the title sitemap menu. Please tell the solution for it.

daffodilsoftware’s picture

Hi Vikram
Its working fine . We have reviewed the patch given by camprandall. There is no issue in it.

vikramkanav’s picture

I agree the patch is working it was my mistake.

camprandall’s picture

Status: Needs review » Reviewed & tested by the community

I'm updating this to "reviewed and tested" since multiple people have verified that it works.

darrell_ulm’s picture

Issue summary: View changes

@frjo another one, should I incorporate to dev and push it in? Thanks!

colan’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/site_map.admin.inc
@@ -74,6 +74,11 @@ function site_map_admin_settings_form() {
+  //Override menu title if a sitemap menu title is provided

Coding standards: Missing space before the sentence and punctuation after. See https://www.drupal.org/coding-standards.

+++ b/site_map.module
@@ -412,7 +412,7 @@ function _site_map_menus() {
+        $title = t(variable_get('site_map_menu_title_'.$mid, $menu['title']));

Missing whitespace around the ".".

+++ b/site_map.module
@@ -728,3 +728,28 @@ function _site_map_set_option(&$options, $option_string, $get_param, $equal_para
+ * Implements hook_form_alter

Would probably be better to use hook_form_FORM_ID_alter(). Also, missing "().".

+++ b/site_map.module
@@ -728,3 +728,28 @@ function _site_map_set_option(&$options, $option_string, $get_param, $equal_para
+ * Custom submit functionality to save sitemap menu title

Missing punctuation.

Finally, new variables are being adding without being deleted in hook_uninstall().

colan’s picture

Actually, what about having a single variable (array) to store all of these? Then we could declare it with the Variable module, and wouldn't have to worry about uninstalling? See #1545422: Expose configuration options to variable module to enable per language settings for an example.