Blog

Luis Majano

July 08, 2016

Spread the word


Share your thoughts

 

ContentBox has what we call, a Global HTML manager. This manager allows you to seamlessly drop in JavaScript/CSS/HTML to specific theme and UI presentation life-cycle events.

Please note that the active theme must implement the life-cycle events in order for the Global HTML output to happen.

Purpose

The purpose of the Global HTML manager is to allow the integration of third-party scripts, CSS or HTML integrations easily without altering code or programming it in the theme. This allows for cross-theme output in a manageable manager.

Event Sections

The following are the sections where you can intercept and put data for output:

  • Global Layout
  • Blog Entries
  • Comments
  • Pages

You can add custom markup for any of the interception points show in this section, from after any content, before any comment, after any blog entry, etc.

Theme implementation

Implementing these events are super easy. All you have to do is announce the event using the ContentBox helper class's method: event() anywhere you want the content to output. Here is an example:





    #cb.event( "cbui_beforeHeadEnd" )#

The many events you can announce are:


"cbui_beforeHeadEnd",
"cbui_afterBodyStart",
"cbui_beforeBodyEnd",
"cbui_footer",
"cbui_beforeContent",
"cbui_afterContent",
"cbui_beforeSideBar",
"cbui_afterSideBar",
"cbui_preEntryDisplay",
"cbui_postEntryDisplay",
"cbui_preIndexDisplay",
"cbui_postIndexDisplay",
"cbui_preCommentForm",
"cbui_postCommentForm",
"cbui_prePageDisplay",
"cbui_postPageDisplay",
"cbui_preArchivesDisplay",
"cbui_postArchivesDisplay"

Summary

Hopefully now you can see how easy it is to output custom HTML, JavaScript, CSS or whatever you like in specific execution points of your theme. This allows you to easily integrate with things like social sharing, Google Analytics and much more.

Add Your Comment

(1)

Aug 10, 2016 09:26:32 UTC

by Dan OKeefe

What would be the approach to implement a theme based on bootstrap such as <a href=https://wrapbootstrap.com/theme/ace-responsive-admin-template-WB0B30DGR?">https://wrapbootstrap.com/theme/ace-responsive-admin-template-WB0B30DGR?</a> Would I use globalHTML like I would a layout? Or are layouts still respected? I am wondering if I have to pick a theme at all and still use contentbox to manage the site (module).

Recent Entries

BoxLang 1.14.0 : Sets, Ranges, Inner Classes, and a Runtime That Talks Back

BoxLang 1.14.0 : Sets, Ranges, Inner Classes, and a Runtime That Talks Back

BoxLang has never stood still, but 1.14.0 is something different. This is the release where the language stops filling gaps and starts defining what a modern dynamic JVM language looks like on its own terms. Sixty-five issues closed. Four innovative language features. A formatter that has grown up. And a companion module - bx-mcp - that fundamentally changes how you operate a running BoxLang application with AI.

Luis Majano
Luis Majano
June 03, 2026
BoxLang Image Module 1.7.0: Full Format Freedom with WebP, GIF, BMP, TIFF and Built-in CAPTCHA

BoxLang Image Module 1.7.0: Full Format Freedom with WebP, GIF, BMP, TIFF and Built-in CAPTCHA

The BoxLang image module just landed two back-to-back releases that make it significantly more capable. 1.6.0 brought CAPTCHA generation. 1.7.0 adds four new image formats, fixes a silent write bug that has been producing PNG files regardless of what extension you asked for, and adds proper alpha channel handling for formats that don't support transparency. Let's dig in. 🚀

Luis Majano
Luis Majano
June 01, 2026
🚀 Introducing BoxLang MCP: Give Your AI a Window Into Your Running BoxLang Application

🚀 Introducing BoxLang MCP: Give Your AI a Window Into Your Running BoxLang Application

You launch your BoxLang application, traffic flows, schedulers execute, caches warm, threads spin. And when something goes wrong, you jump between logs, dashboards, admin panels, and monitoring tools to piece together the full picture. Meanwhile, your AI coding assistant only understands your source code. It has no visibility into your running application. It cannot tell you why your thread pool is saturated, whether cache performance is degrading, or which scheduled task silently failed overnight.

Luis Majano
Luis Majano
June 01, 2026