Simplify component.php to minimal layout with conditional analytics #82

Merged
Copilot merged 78 commits from copilot/fix-breaking-overrides into main 2026-03-17 21:42:02 +00:00
Copilot commented 2026-02-27 00:12:26 +00:00 (Migrated from github.com)

Pull Request

Purpose

Component view required minimal rendering: logo, content, footer only. Light theme forced. Analytics optional via template params.

Change Summary

Template Configuration

  • Removed theme switching logic from component.php
  • Hardcoded data-bs-theme="light" on html element
  • Load only template.light.standard CSS (no dark/custom variants)

Layout Simplification

  • Stripped to essential elements: brand logo, component output, footer modules
  • Removed sidebar, navigation, and theme toggle UI
  • Footer renders footer-menu and footer module positions if populated

Analytics Integration

  • Google Tag Manager: conditionally inject based on googletagmanager + googletagmanagerid params
  • Google Analytics: conditionally inject gtag.js based on googleanalytics + googleanalyticsid params
  • GA implementation includes consent defaults (analytics granted, ads denied) and IP anonymization
// Component params (lines 36-39)
$params_googletagmanager   = $this->params->get('googletagmanager', false);
$params_googletagmanagerid = $this->params->get('googletagmanagerid', null);
$params_googleanalytics    = $this->params->get('googleanalytics', false);
$params_googleanalyticsid  = $this->params->get('googleanalyticsid', null);

// Theme locked to light (line 97)
<html class="component" lang="..." dir="..." data-bs-theme="light">

Testing Evidence

Manual verification required in Joomla environment with component view rendering.

Risk and Rollback

Low risk - component.php isolated from main template rendering. Rollback via git revert if analytics injection causes issues.

Checklist

  • Follows Conventional Commits
  • Tests added or updated
  • Documentation updated if required
  • License header present where applicable
  • Linked issue(s) referenced

Reviewer Notes

Analytics scripts inject directly in body, not via Web Asset Manager. GTM noscript iframe included per Google requirements. GA configuration handles both GA4 (G-) and legacy Universal Analytics (UA-) IDs with deprecation warning.

Review and Approval

Verify analytics tags render correctly when params enabled. Confirm light theme applies regardless of user preference.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

# Pull Request ## Purpose Component view required minimal rendering: logo, content, footer only. Light theme forced. Analytics optional via template params. ## Change Summary **Template Configuration** - Removed theme switching logic from component.php - Hardcoded `data-bs-theme="light"` on html element - Load only `template.light.standard` CSS (no dark/custom variants) **Layout Simplification** - Stripped to essential elements: brand logo, component output, footer modules - Removed sidebar, navigation, and theme toggle UI - Footer renders `footer-menu` and `footer` module positions if populated **Analytics Integration** - Google Tag Manager: conditionally inject based on `googletagmanager` + `googletagmanagerid` params - Google Analytics: conditionally inject gtag.js based on `googleanalytics` + `googleanalyticsid` params - GA implementation includes consent defaults (analytics granted, ads denied) and IP anonymization ```php // Component params (lines 36-39) $params_googletagmanager = $this->params->get('googletagmanager', false); $params_googletagmanagerid = $this->params->get('googletagmanagerid', null); $params_googleanalytics = $this->params->get('googleanalytics', false); $params_googleanalyticsid = $this->params->get('googleanalyticsid', null); // Theme locked to light (line 97) <html class="component" lang="..." dir="..." data-bs-theme="light"> ``` ## Testing Evidence Manual verification required in Joomla environment with component view rendering. ## Risk and Rollback Low risk - component.php isolated from main template rendering. Rollback via git revert if analytics injection causes issues. ## Checklist - [x] Follows Conventional Commits - [ ] Tests added or updated - [ ] Documentation updated if required - [x] License header present where applicable - [ ] Linked issue(s) referenced ## Reviewer Notes Analytics scripts inject directly in body, not via Web Asset Manager. GTM noscript iframe included per Google requirements. GA configuration handles both GA4 (G-) and legacy Universal Analytics (UA-) IDs with deprecation warning. ## Review and Approval Verify analytics tags render correctly when params enabled. Confirm light theme applies regardless of user preference. <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2026-02-27 05:06:45 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoCassiopeia#82