Search code examples
drupal-7

User Tokens in menu are visible only when cache is cleared.


I am using Menu Token (menu_token) module to use "users token" in menu in order to display current users name in menu like this :

Welcome [current-user:name]

Whenever I login to site, it shows just Welcome , but when I clear cache it displays username. I also tried to clear cache on login using drupal_flush_all_caches() function but it was helpless. What should I do to resolve this ?

Thanks.


Solution

  • Sometimes Drupal Token is creating issue. Whenever we are using lots of caching module like memcache, APC or aggregate JS/CSS modules then this type of issue is arise. One possible solution for this is instead of using token menu module use custom drupal code or Welcome User Drupal module

    After installing this module you have to select region to display "welcome user" block.