XF 1.5 Parsing Out Alerts By Type

king8084

Well-known member
I'm trying to identify a way to parse out users' alerts based on alert type (quote, likes, mentions, etc.). Is there a unique var that's utilized (and if so, where is it stored?) which can be used to group the alerts by category? ex: is there a way to identify a 'quote-alert', versus a 'mention-alert' or 'like-alert'? I've tried using the helper dump function in 'account_alerts_popup' & the 'alert' templates, but have come up empty thus far.
 
The variables available to the alert templates are basically the same as what fields are available in the xf_user_alert table.

A few special cases are
  • {$extra} which is the unserialized additional data passed to the alert template
  • {$content} the content to which the alert relates
  • {$user} some basic user info
You'll perhaps want to see what you can do with the {$content_type} and {$action} variables as these identify the type of alert at a high level.
 
The variables available to the alert templates are basically the same as what fields are available in the xf_user_alert table.

A few special cases are
  • {$extra} which is the unserialized additional data passed to the alert template
  • {$content} the content to which the alert relates
  • {$user} some basic user info
You'll perhaps want to see what you can do with the {$content_type} and {$action} variables as these identify the type of alert at a high level.
Thanks a lot for the reply - sorry I didn't get back to you sooner. I was finally able to mess around with it again and {$action} did exactly what I was looking for. {$alert.action} allowed me to add a action-based class to each alert :)

I appreciate it!
 
Top Bottom