PolyCMS Visual Portal and Publishing Engine for RISE CRM

Building a Custom Theme for PolyCMS on RISE CRM

Editing the default PolyCMS theme directly guarantees lost templates and broken styles the moment you apply a plugin update. Creating a dedicated custom theme isolates your brand layouts, typography, and CSS tokens inside an upgrade-safe directory under RISE CRM.

Using a clean theme.json manifest and CodeIgniter 4 view inheritance, your team can customize headers, blog archives, and landing templates in minutes.

Need custom backend logic or hooks alongside your design? Pair your theme with Building a Custom Plugin for PolyCMS on RISE CRM.

Theme Directory / FileRequired?Role in Rendering Pipeline
theme.jsonYesRegisters theme name, version, author, and supported widget zones
layouts/main.phpYesDefines HTML document shell, head metadata, header, and footer
templates/page.php & single.phpRecommendedControls markup for static pages and individual blog articles
templates/archive.phpOptionalCustomizes post grids for categories, tags, and search results
assets/css & assets/jsRecommendedStores scoped stylesheets, CSS tokens, and deferred JS bundles

Step 1: Scaffold theme.json and Core Layout Inheritance

Create a lowercase folder inside the PolyCMS Themes directory, such as plugins/PolyCMS/Themes/acme-brand/, and place a valid theme.json manifest at its root. Declaring widget regions and navigation menu locations in theme.json exposes them immediately inside the RISE CRM admin appearance panel.

  • Create theme.json with slug, name, version, screenshot path, menu_locations, and widget_areas keys.
  • Build layouts/main.php containing semantic header, main, and footer landmarks plus the PolyCMS head and footer asset hooks.
  • Register primary sidebar and multi-column footer widget slots following Widgets and Sidebars in PolyCMS for RISE CRM.
  • Activate your theme under PolyCMS > Appearance > Themes and verify the live homepage renders your layout shell.

Step 2: Override Templates and Optimize Theme Assets

Only copy the specific templates you need to change, such as single.php, archive.php, or 404.php, allowing PolyCMS to fall back cleanly for untouched views. Once your theme renders, test a live article workflow using Quick Start: Your First Blog Post in PolyCMS for RISE CRM to validate typography, featured images, and mobile breakpoints.

  • Define CSS custom properties for colors, spacing, and dark/light surfaces inside a single minified stylesheet.
  • Set explicit width and height attributes on theme logos and featured image thumbnails to maintain zero Cumulative Layout Shift (CLS).
  • Add defer to non-critical frontend scripts and ensure zero console errors or blocking inline scripts on public routes.
  • Include a full-width page template file so MTBuilder landing pages can bypass default article container constraints.

Common Pitfalls & Quick Fixes

  • Theme Not Listed in PolyCMS Appearance Screen: Check that theme.json sits directly inside your theme root folder (not nested inside an extra zip subfolder) and passes JSON validation.
  • 404 Errors on Theme CSS and JS Assets: Verify asset URLs use the PolyCMS theme_asset() helper rather than hardcoded relative paths that break on nested category routes.
  • Widget Areas Missing After Activating New Theme: Ensure widget_areas slugs in theme.json are properly formatted and reassign saved widgets under Appearance > Widgets.

Frequently Asked Questions

Will a PolyCMS plugin update overwrite my custom theme folder?

No, provided you keep your custom theme inside its own unique folder slug rather than modifying the bundled default theme files directly. During updates, PolyCMS refreshes core views and default assets safely while leaving third-party and custom theme directories completely untouched.

Can I add multiple custom page templates inside one PolyCMS theme?

Yes. Add named template files inside your theme’s templates/pages/ folder and declare them cleanly in theme.json or template header comments. Editors can then pick templates such as Landing Canvas, Documentation Sidebar, or Case Study directly from the Page Edit screen.

Should I put custom post types or CRM integrations inside my theme?

No. Keep themes focused strictly on presentation, templates, and frontend assets. Any business logic, custom database models, REST endpoints, or CRM workflow integrations belong in a dedicated PolyCMS plugin so features keep running even if you redesign your theme later.

How do custom themes interact with MTBuilder visual blocks?

Your theme controls the global header, footer, typography variables, and page wrapper, while MTBuilder renders its responsive grid and blocks inside the content area. Providing clean CSS reset and container rules in your theme ensures every MTBuilder block aligns seamlessly.


Comments

Leave a Reply

Your email address will not be published.Required fields are marked *