It would be nice to add new menu tokens which would allow to output menus using tokens (e.g. in blocks or even nodes using Token Filter module)

I created simple module that allows this, but it would be much nicer to integrate this (or make it a submodule) of Token module itself.
Please check https://github.com/m1n0/token_menu_render and let me know if you want to use it.

CommentFileSizeAuthor
#1 render-menu-using-tokens_2163679_1.patch2.68 KBm1n0
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

m1n0’s picture

Alternatively, I created patch to include this in token module itself - can we discuss this please?

Dave Reid’s picture

Just wanted to say this is really nice work. I can definitely see somehow we can move this forward.

I think that having a 'Token embeddables' module that contains all the embeddable things like blocks, menus, views, etc and controls them inside the [embed-menu:menu-name] or [embed-block:module-delta] namespace for tokens. I'm not sure if it's a separate contrib module, or a sub-module inside Token module yet.

Andy_Read’s picture

I was just looking for a menu equivalent to token_embed_views and was really surprised that this has only just been started in the last 6 weeks. m1n0's module is a very good starting point and works well as it stands. A worthy addition to token or as a stand-alone contrib module.

Just to 'push the envelope' I was interested in the possibility of embedding a menu with icons added using menu_icons, but this doesn't seem to be compatible with token_menu_render in its current form. I'd be interested to explore how to get these to work together.

Another useful extension would be to allow embedding tokens for sub-menus, i.e. children of a menu.

m1n0’s picture

Thanks for your support guys - it seems that there are already some modules doing some token embeddable functionality though. Dave, do you think we could move this into token as a submodule and then add more 'embeddables' in future iterations (and after discussions which entities could/should be embeddedable)?

wizonesolutions’s picture

What became of this one? I'd love to see a contrib module with this functionality for the time being m1n0. Maybe it'd get merged into Token later. Could be called token_embed_menus and be Token Filter-compatible? :)

Stuff like this is great for when we need to rush out content changes in a production environment but want to avoid using the PHP Code text format.

m1n0’s picture

I published the module - https://drupal.org/project/token_menu_render. This issue might be obsolete now, if there will be will to do more work on this together with token module, we shall start new issue.

m1n0’s picture

Status: Active » Closed (won't fix)
m1n0’s picture

Status: Closed (won't fix) » Active

I believe we could reopen this and get this merged directly into Token - this way we do not need another contrib module.