Skip to content

FIX SS6 template compatibility - remove $TitleTag references#16

Merged
jsirish merged 1 commit into3from
feature/ss6-template-fix
Oct 22, 2025
Merged

FIX SS6 template compatibility - remove $TitleTag references#16
jsirish merged 1 commit into3from
feature/ss6-template-fix

Conversation

@jsirish
Copy link
Member

@jsirish jsirish commented Oct 21, 2025

Summary

Fixes ElementCard template for SilverStripe 6 compatibility by removing incompatible $TitleTag and $TitleSizeClass variables from wedevelopnl/silverstripe-elemental-grid package.

Changes

  • Removed <$TitleTag class="element__title $TitleSizeClass">$Title</$TitleTag>
  • Replaced with standard <h2 class="element__title">$Title</h2>

Reason

The $TitleTag and $TitleSizeClass variables come from the wedevelopnl/silverstripe-elemental-grid package which is not yet compatible with SilverStripe 6. Using these variables caused broken HTML output showing raw template syntax on the frontend.

Testing

  • Verified card element displays correctly on frontend
  • Screenshot: template-preview-fixed.png showing corrected layout without broken HTML

Related

  • Part of SilverStripe 6 upgrade effort
  • Complements fixes in silverstripe-elemental-templates PR #33

- Remove references to $TitleTag and $TitleSizeClass from template
- These variables are from wedevelopnl/silverstripe-elemental-grid which is not compatible with SS6
- Change to standard h2 heading tag with element__title class
- Fixes broken HTML rendering in SilverStripe 6
Copilot AI review requested due to automatic review settings October 21, 2025 23:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes SilverStripe 6 compatibility issues in the ElementCard template by removing dependency on the incompatible wedevelopnl/silverstripe-elemental-grid package variables.

  • Replaced dynamic title tag variables ($TitleTag, $TitleSizeClass) with hardcoded <h2> element
  • Ensures proper HTML rendering on the frontend by removing broken template syntax

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

<div class="card-body h-100 d-flex align-items-center">
<div>
<% if $Title && $ShowTitle %><$TitleTag class="element__title $TitleSizeClass">$Title</$TitleTag><% end_if %>
<% if $Title && $ShowTitle %><h2 class="element__title">$Title</h2><% end_if %>
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Hardcoding the title as <h2> may create heading hierarchy issues if this element is nested within other sections. Consider whether the heading level should be configurable or if semantic HTML structure is maintained across the page.

Suggested change
<% if $Title && $ShowTitle %><h2 class="element__title">$Title</h2><% end_if %>
<% if $Title && $ShowTitle %>
<% if $HeadingLevel %>
<h{$HeadingLevel} class="element__title">$Title</h{$HeadingLevel}>
<% else %>
<h2 class="element__title">$Title</h2>
<% end_if %>
<% end_if %>

Copilot uses AI. Check for mistakes.
@jsirish jsirish merged commit 38ee8a1 into 3 Oct 22, 2025
23 checks passed
@jsirish jsirish deleted the feature/ss6-template-fix branch October 22, 2025 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant