1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Use variables in Notices

Discussion in 'XenForo Questions and Support' started by Andy.N, Oct 28, 2011.

  1. Andy.N

    Andy.N Well-Known Member

    I have a few variables from custom addons that can be used in any templates. Is it possible to use them in Notices, just as you are able to include the username currently?

    How would I be able to achieve it? My plan is to create a non-dismissible notice and display all the variables from our custom addons as a status bar/panel.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Notices don't have access to the normal container params. The token replacements are defined in this function:


    				$noticeTokens = array(
    					'{name}' => $user['username'] !== '' ? $user['username'] : new XenForo_Phrase('guest')
    An addon is required to insert custom data.
    Andy.N likes this.
  3. Andy.N

    Andy.N Well-Known Member

    Would it be hard to make that addon? Once it is done, we would have access to all custom variables?

Share This Page