# Themes Package — Developer Notes ## Top navbar menu Each package self-registers via `$gBitSystem->registerAppMenu()` in its `bit_setup_inc.php`. Rendered by `kernel/templates/top_bar.tpl` — no built-in role gate at the dropdown level. Config switches (stored in kernel_config, set via Themes > Admin > Menus): - `menu_$pkg = 'n'` — disable dropdown for all users - `${pkg}_menu_text` — custom dropdown label - `${pkg}_menu_position` — sort position For role-based visibility, override `top_bar.tpl` in `config/themes/merg/kernel/`. ## CSS load order `BitThemes::loadStyleData()` loads CSS in this order: 1. Package CSS (around position 300) — each package's `html_head_inc.tpl` 2. `themes/css/config.css` — position 300 (default); canonical floaticon/icon/actionicon rules 3. Style CSS (`getStyleCssFile()`, position 998) — the active theme's main CSS 4. Browser CSS (`getBrowserStyleCssFile()`, position 999) Site-specific CSS lives in `/etc/webstack/domains/{site}/themes/{site}/{site}.css` and is the active theme file for that site (position 998). Site theme images go in `themes/{site}/images/` within that domain dir — referenced via `{$gBitThemes->getStyleUrl()}images/`. **`.floaticon` / `.icon` audit note** — `themes/css/config.css` defines `.floaticon { float:right }` at position 300. Site theme CSS at position 998 **wins** over this. If a site theme has `.icon { float:left }` (common in older themes for sprite icon layout), it breaks `.floaticon` by causing child icons to float left and collapse the container. **Fix**: strip the bare `.icon { float:left }` from the site CSS — do not scope it or patch it elsewhere. ## Asset locations - **Site-specific images** — `/etc/webstack/domains/{site}/themes/{site}/images/`; referenced in templates as `{$gBitThemes->getStyleUrl()}images/filename.ext` - **Cross-site org assets** (RDM logo, cookie-consent images) — `util/images/`; referenced as `{$smarty.const.UTIL_PKG_URL}images/filename.ext` or `/util/images/filename.ext` in CSS - **Fonts** — `util/fonts/{family}/`; referenced as `/util/fonts/...` in `@font-face` CSS - `config/css/`, `config/js/`, `config/fonts/`, `config/images/` are all dead and removed from servers — do not recreate them ## Smarty notes - `{tr}...{/tr}` for translation in templates; `KernelTools::tra()` in PHP - `tra` is NOT a Smarty modifier — `"string"|tra` will throw a compiler error - `{form}` block plugin auto-injects `` (CSRF ticket) - **`form-search` hides Bootstrap submit buttons** — Bootstrap 2 `.form-search` suppresses the submit control. Use `class="minifind"` alone on floaticon filter forms; never add `form-search`. - `{strip}` removes whitespace between HTML tags; keep `•` separators inside valid `