Description of the need
If a Layout made its contexts available to its custom blocks, this would allow people to use tokens related to the entities in the context. Use case: create a custom block that displays some node properties like the created date, which are otherwise not selectively available.
Currently the layout contexts are not available to BlockText, which is the class that custom blocks use. While BlockText::getContent() does invoke token_replace() it does so without any context, meaning that only global tokens are fulfilled.
Recent comments
Thank you for your answer. What I want to do is display usernames or user images in a menu, similar to many community websites. The basic menu that Backdrop currently provides is a "...
How can I display the username or user profile picture in the menu?
Just go to the menu where you want to add your link. Add your link and in the path search for "user". It's done. No need to use a token. Or perhaps this ? menu_attributes
How can I display the username or user profile picture in the menu?
Please can you provide more information about the use case for this and also a screenshot or mockup of what you are trying to achieve. There is a request here (https://github.com/backdrop-...
How can I display the username or user profile picture in the menu?