Hi,

I tried to create a hook_menu implementation pointing for a view, embedded in my module as a "default" view and with a page and path but no menu item of its own. It seems this does not work, as my menu item won't show up if it shares a path with a view.

So I tried exposing the menu under my embedded view like this:

	$handler->override_option('menu', array(
	  'type' => 'normal',
	  'title' => 'Correspondence',
	  'weight' => '0',
	));

That works, I have a menu item, but it's on an admin screen so I really want an accompanying description. I tried adding it like this to no avail:

	$handler->override_option('menu', array(
	  'type' => 'normal',
	  'title' => 'Correspondence',
	  'description' => 'List of correspondence from the Contact Us page.',
	  'weight' => '0',
	));

Is there any way to add a description to a menu item exposed by a view, or use hook_menu to provide that menu item instead of the Views module so a description can be provided that way? It's not a big deal, but it is a bit annoying if I can't do this.

CommentFileSizeAuthor
#6 views_293832.patch4.15 KBdrewish
#5 views_293832.patch3.95 KBdrewish

Comments

alex_b’s picture

Version: 6.x-2.0-rc1 » 6.x-2.x-dev

Did you find out how to create such a description?

greg.harvey’s picture

Version: 6.x-2.x-dev » 6.x-2.2

No. =(

And, as you can see, no one ever came back with a suggestion. Switching version to current, in the hopes of attracting some attention. Would be nice to either a) get an answer or b) get this moved to a feature request.

merlinofchaos’s picture

Right now the only way I can think of to do this would be to use hook_menu_alter and add the description by hand, as Views doesn't support that field as it perhaps should.

You can use hook_menu to provide your own item and this is one case where loading the view and calling $view->execute_display() would work for you. See the views_embed_view() function for a bit of info on how this is set up.

drewish’s picture

Category: support » feature

marked #321701: Ability to specify a description on menu items as a duplicate... i think i'd submitted a feature request for this as well but can't seem to find it...

drewish’s picture

Status: Active » Needs work
StatusFileSize
new3.95 KB

here's the start of a patch.

drewish’s picture

Status: Needs work » Needs review
StatusFileSize
new4.15 KB

okay fixed the spelling of "transleateable". this also corrects the version comparison so that it doesn't report and error using Drupal 6.x-dev.

merlinofchaos’s picture

Status: Needs review » Fixed

menu title and description should not be translatable here, so I actually removed the translatability (and provided a comment). Otherwise, this patch is good, and is applied.

greg.harvey’s picture

Wonderful! =)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.