Add a new ViewsReferenceSetting plugin to allow per paragraph handling of the grid settings.

Created on 12 August 2025, 5 days ago

Problem/Motivation

When embedding a View via the Views Reference field (commonly on a Paragraph type), site builders cannot adjust views_bootstrap grid-related options (e.g., columns per breakpoint, gutter/row behavior) per instance. Today this forces duplication of Views displays just to vary grid settings by context, increasing maintenance overhead and limiting flexibility.

It would be useful if views_bootstrap exposed a ViewsReferenceSetting plugin so editors can override grid settings per referenced View instance, similar to how other modules integrate with Views Reference. Reference implementation pattern: viewsreference/src/Plugin/ViewsReferenceSetting.

Steps to reproduce

  1. Create a Paragraph type with a Views Reference field.
  2. Create a View that uses a Views Bootstrap grid style (e.g., Grid/Cards) with specific column settings.
  3. Add two Paragraphs referencing the same View where each context needs different grid columns (e.g., 2-col vs 4-col at md).
  4. Observe: there is no per-reference UI to change the grid; you must duplicate the View/display to achieve different grids.

Proposed resolution

  • Add a ViewsReferenceSetting plugin in views_bootstrap to expose grid-related options on the Views Reference widget/form, enabling per-entity overrides.
  • Initial options to expose (subject to maintainer feedback):
    • Columns per breakpoint (e.g., xs/sm/md/lg/xl/xxl or Bootstrap row-cols equivalents).
    • Gutter/row behavior (where applicable).
    • Optional flags such as equal height/stacking if provided by the chosen style plugin.
  • Implementation sketch:
    • Create plugin class under Plugin/ViewsReferenceSetting/BootstrapGrid.php (or per-style variants) that reads/writes the style options and applies them via the Views Reference settings alter hook.

Remaining tasks

  • Confirm the exact set of grid options that should be overrideable per reference.
  • Implement the ViewsReferenceSetting plugin(s) with form elements and value mapping to the style plugin options.
  • Add automated tests (kernel/unit) to verify option persistence and runtime application.
  • Update documentation with usage examples and screenshots.
  • Changelog entry and release note.

User interface changes

  • New settings section on the Views Reference widget/edit form exposing grid controls (visible only when the referenced display uses a views_bootstrap grid style).

API changes

  • New ViewsReferenceSetting plugin class(es) provided by views_bootstrap; no breaking changes to existing APIs.

Data model changes

  • No changes required β€” settings schema for ViewsReferenceSetting plugins is handled by the viewsreference module.
✨ Feature request
Status

Active

Version

5.5

Component

Grid

Created by

πŸ‡ΊπŸ‡ΈUnited States trackleft2 Tucson, AZ πŸ‡ΊπŸ‡Έ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024