MyBB Community Forums

Full Version: Cant embed HTML in announcemts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This won't work for regular forum announcements, but BAM announcements manager supports this explicitely if you need an announcement in your header. If you need javascript in an announcement, create a global template with the announcement's text, and name it bam_javascript_template. Put the following into the template:

<p class="{$bam_unsticky} {$class}" id="announcement-{$bcprefix}{$announcement_id}">{$announcement} [INSERT YOUR JAVASCRIPT HERE]<span class="bam_date">{$date}</span>
<span class='close_bam_announcement {$display_close}'>x</span></p>

Then create a normal BAM announcement, and anywhere in the announcement's text, add

Your announcement text [@template:bam_javascript_template]

This tag can be anywhere, and tells BAM to load a different template. It will allow you to put a javascript header banner on your forum.

OUGC announcement bars can do something like this as well! Smile
(2020-03-26, 11:50 PM)Darth Apple Wrote: [ -> ]This won't work for regular forum announcements, but BAM announcements manager supports this explicitely if you need an announcement in your header. If you need javascript in an announcement, create a global template with the announcement's text, and name it bam_javascript_template. Put the following into the template:

<p class="{$bam_unsticky} {$class}" id="announcement-{$bcprefix}{$announcement_id}">{$announcement} [INSERT YOUR JAVASCRIPT HERE]<span class="bam_date">{$date}</span>
<span class='close_bam_announcement {$display_close}'>x</span></p>

Then create a normal BAM announcement, and anywhere in the announcement's text, add

Your announcement text [@template:bam_javascript_template]

This tag can be anywhere, and tells BAM to load a different template. It will allow you to put a javascript header banner on your forum.

OUGC announcement bars can do something like this as well! Smile
Thanks,

This has worked! Smile
Glad to hear it. It was a last minute add on for the plugin, glad the feature was useful!
(2020-03-27, 03:04 AM)Darth Apple Wrote: [ -> ]Glad to hear it. It was a last minute add on for the plugin, glad the feature was useful!
Turns out its just the thing I was looking for!

I could find this quite useful in future for other things too.
Pages: 1 2