Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I'm unable to find where/how to add tokens to the Menu Block title. The description underneath the 'Block title' field on the block edit page shows:
Override the default title for the block. Use to display no title, or leave blank to use the default block title. This field supports tokens.
Where do I find the tokens that this supposedly supports? I need to set a token for the title to display the top/parent menu item for a menu block. Maybe I'm not as familiar with Tokens yet as I should, in case this functionality is already done, but am I looking in the wrong place then?
Comments
Comment #1
bas.hr CreditAttribution: bas.hr commentedWell, Token module adds "This field supports tokens." part to the description and is responsible for that. Btw here is the list of tokens.
Have you tried leaving the title blank? At least I'm getting parent menu item if the "menu block" is showing 2nd level of items.
Comment #1.0
bas.hr CreditAttribution: bas.hr commentedRe-worded a sentence.
Comment #2
batdesign CreditAttribution: batdesign commentedI've tried adding standard tokens in the title field and get a The Block title is using the following invalid tokens: for everything I try.
I was trying it because despite leaving the block title blank, my block title had an element-invisible class applied to it....
Comment #3
batdesign CreditAttribution: batdesign commentedUpdate: Nothing to do with menu block. I was using my main menu, and Drupal just adds the element-invisible class to the block title for the main menu automatically. No option to actually show the block title...
I overwrote the css that the element-invisible class applies, in my own css. Painful, but easier than overwriting core code...
Comment #4
nattyweb CreditAttribution: nattyweb commentedThanks to bas.hr (#1) - saved me a while trying to figure out how to add the parent menu to the block title! Which, yes, of course I'd know if I'd read the documentation properly...).
Comment #5
Puppetmast0r CreditAttribution: Puppetmast0r commentedFor what it's worth, I have exactly the same problem as batdesign in #2 and #3, but in a custom menu, not the main menu. ("The Block title is using the following invalid tokens:")
I'll use the same, dirty, fix of overrding the element-invisible css class for this instance.