Enable BU Alert for a Sandbox
There are many times BU needs to issue an alert across the University. BU Alerts are only displayed on production sites and specifically targeted sandboxes. The alerts can sometimes cause complications with some components like custom navigations and positioned elements. There are two ways that you can add the BU Alert for testing and styling on your sandbox.
Edit your wp-config.php file
The following method only works if IS&T has specifically targeted your sandbox.
- Open your FTP client and navigate to your symlinked current folder
- Locate the wp-config.php file and edit line:75
- Comment out the following, define(‘BU_SUPPRESS_ALERTS’, true)
- Upload file and refresh
*If you don’t notice the alert you more than likely have not been added to the sandbox list selected to display the alerts and should follow the instructions below.
Add BU Alert Component JS
- Visit github.com/bu-ist and search for bu-alert-component
- Copy the raw .js code and paste it into your js-dev/script.js file
- Edit the following lines of code:
component = $('component = $('<div id="bu-alert-component"></div>').prependTo( 'body' );
to
component = $('<div id="bu-alert-wrapper"></div>').prependTo( 'body' );
also comment out the following line;
setInterval(check, 5000);
Add the Alert styles
Finally, you will need to add the alert.css styles in order to mirror the production styles.
function add_FUNCTION-NAME-HERE() {
wp_enqueue_style(‘UNIQUE-HANDLE-NAME’, // Unique handle name.
‘https://www.bu.edu/alert/css/alert.css‘ // Location of asset);
}
add_action( ‘wp_enqueue_scripts’, __NAMESPACE__ . ‘\\add_FUNCTION-NAME-HERE’ );