Skip to content

Conversation

@CySSoO
Copy link
Contributor

@CySSoO CySSoO commented Jan 15, 2026

Motivation

  • Provide parent-level layout controls for the Simple Image prettyblock so non-dev users can choose grid/slider/columns without manually adding classes per item.
  • Preserve existing html_class/css_class per-item overrides so developers keep full control when needed.
  • Compute layout classes once at parent level and apply them to items unless an item explicitly provides a class, avoiding duplicated logic in the repeater.
  • Keep backward compatibility with existing slider behavior and avoid forcing manual classes.

Description

  • Added new parent configuration fields in EverblockPrettyBlocks for the Simple Image block: display_mode, columns_desktop, columns_tablet, columns_mobile, and gap to drive default layout behavior from the block settings.
  • Updated views/templates/hook/prettyblocks/prettyblock_img.tpl to calculate Bootstrap column classes and gap classes once using the parent settings and to set a layoutItemClass that is applied to each item by default.
  • Implemented the override rule where an item with css_class keeps only that manual class while items without css_class get the computed parent classes, and ensured the slider mode uses the parent display_mode and responsive columns for data-items-mobile.
  • Kept existing slider options and behavior intact while replacing hard-coded per-item col-* usage with the centralized layout computation.

Testing

  • No automated tests were executed for this change.
  • Manual inspection: template changes are static and preserve previous conditional visibility and slider logic (no runtime test run requested).

Codex Task

@CySSoO CySSoO merged commit d630b37 into master Jan 15, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants