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
- Create a Paragraph type with a Views Reference field.
- Create a View that uses a Views Bootstrap grid style (e.g., Grid/Cards) with specific column settings.
- Add two Paragraphs referencing the same View where each context needs different grid columns (e.g., 2-col vs 4-col at
md). - 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_bootstrapto 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.
- Create plugin class under
Remaining tasks
- Confirm the exact set of grid options that should be overrideable per reference.
- Implement the
ViewsReferenceSettingplugin(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_bootstrapgrid style).
API changes
- New
ViewsReferenceSettingplugin class(es) provided byviews_bootstrap; no breaking changes to existing APIs.
Data model changes
- No changes required — settings schema for
ViewsReferenceSettingplugins is handled by theviewsreferencemodule.
Issue fork views_bootstrap-3541040
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
trackleft2Comment #6
shelane