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

Use variables in Notices

Andy.N

Well-known member
#1
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.
 

Jake Bunce

XenForo moderator
Staff member
#2
Notices don't have access to the normal container params. The token replacements are defined in this function:

XenForo_ViewRenderer_HtmlPublic::_getNoticesContainerParams

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

Andy.N

Well-known member
#3
Notices don't have access to the normal container params. The token replacements are defined in this function:

XenForo_ViewRenderer_HtmlPublic::_getNoticesContainerParams

Code:
$noticeTokens = array(
'{name}' => $user['username'] !== '' ? $user['username'] : new XenForo_Phrase('guest')
);
An addon is required to insert custom data.
Would it be hard to make that addon? Once it is done, we would have access to all custom variables?