Slider Enhancements for Bricks
Slider Enhancements for Bricks adds external controls & live information to the Bricks Nestable Slider (Splide). Place a counter, buttons, progress bar, thumbnails or a custom pagination anywhere on the page and point it at a slider. You can also link two sliders together and pull per-slide metadata from ACF.
Version: 0.7.7 · Requires: Bricks Builder. ACF is only needed for ACF mapping. · See the live demo (now with an ACF query-loop slider, every option, one-way links, card-style pagination, autoplay and a sidebar layout)
Please note: this is an early release. It has been run on this playground but not yet tested widely, so stage & back up before using it on a live site.
What it does
- Adds eight elements to Bricks: Slider Navigation, Slider Counter, Slider Progress, Current Slide Info, Slider Thumbnails, Link Two Sliders, Slide ACF Metadata and Slider Template Pagination.
- Works with the Nestable Slider only. It does not support the classic Swiper Slider.
- Every control finds its slider by the six character Bricks element ID, so controls can sit outside the slider, in a different section, or in a sticky bar.
- Updates live as the slider moves, and reconnects after Bricks AJAX pagination.
Finding the slider ID
Use the six character element ID Bricks gives the Nestable Slider (shown in the builder next to the element name, and in the page HTML as brxe-abcdef). Do not use a custom CSS ID.
The elements
Slider Navigation
Previous & Next buttons, with editable labels. Tick Include first/last controls to add buttons that jump to either end. Buttons disable themselves at the ends unless the slider loops.
Slider Counter
Shows the current position as a fraction (03 / 12), as text (Slide 3 of 12) or as a percentage (25%). It is announced politely to screen readers.
Slider Progress
A progress bar with the correct progressbar role & values. Style the track with .seb-progress-track and the fill with .seb-progress-fill.
Current Slide Info
Prints one piece of information about the visible slide: title, caption, description, image alt text, link URL or a custom key. Set a fallback for slides without the value.
Slider Thumbnails
Builds a button with a thumbnail of each slide image (or the slide number if there is no image). Set a maximum to limit the count. The current thumbnail has aria-current="true", which you can style.
Link Two Sliders
- Create two Nestable Sliders, for example a large gallery & a thumbnail carousel.
- Add the Link Two Sliders element anywhere on the page and enter both element IDs.
- Choose Bidirectional, Primary controls secondary or Secondary controls primary.
Keep the slide order the same in both. If the slide counts differ, the secondary slider wraps by slide count, so matching counts work best. Linking syncs the position only, not the content. Clicking a slide in the navigating slider (the strip, in bidirectional or primary-controls-secondary mode) jumps both sliders to that slide, and the strip can have its own arrows or drag. Use non-looping sliders for the cleanest result.
Slide ACF Metadata
Place it inside a slide. Add mappings of an output key to a source: an ACF field, static text or a Bricks dynamic tag, each with an optional fallback. Inside a query loop the current post is used, or enter a fixed post ID. ACF arrays are stored as JSON, so text, date & number fields give the most readable results. A slide can also carry its own data-seb-title, data-seb-caption or any data-seb-key attribute directly, using Bricks attributes.
Then add a Current Slide Info element outside the slider, choose Custom attribute and enter the key, such as camera.
Slider Template Pagination
- Build a Bricks template for one pagination item, not the whole bar.
- On any text element inside it, add a Bricks attribute named
data-seb-bindwith the valueindex,total,title,caption,description,image-altor a custom key. - Add Slider Template Pagination, then enter the slider ID & the template post ID. Set a maximum number of items if you want fewer than one per slide, and an accessibility label prefix such as Go to slide.
- Style
.seb-pagination-itemand.seb-pagination-item.is-active.
The plugin copies the template markup for every slide & fills in the text safely. Element IDs inside the template are not repeated: each one is moved to a data-seb-id attribute and its CSS rules are re-pointed at it, so the page keeps unique IDs and the template styling still applies. Avoid forms, scripts or interactive widgets inside the template. Only text values are bound, not image URLs or inner blocks.
Styling
The plugin ships almost no styles, so the controls match your theme. Useful classes: .seb-navigation, .seb-counter, .seb-progress, .seb-current-info, .seb-thumbnails, .seb-template-pagination & .seb-pagination-item. The demo page keeps its small stylesheet in the page, so you can copy it.
Scripting
Call window.SEB.refresh() after you add controls or sliders dynamically.
Limitations
- Nestable Slider only.
- Template pagination duplicates rendered HTML (without repeating IDs).
- Splide loop mode clones slides, which repeats any IDs inside them, so prefer the non-looping slider type.
- Binding changes text values only.
- Linking syncs position, not different slide data.
- Test against your own Bricks, ACF & theme versions.
Changelog
- 0.7.7 — one-way link modes now behave exactly as named: only a multi-slide strip selects by click, and every strip shows the selected slide.
- 0.7.6 — Slide ACF Metadata now resolves Bricks dynamic tags, and the slider controls keep their element IDs, classes and builder styles.
- 0.7.5 — a linked thumbnail strip no longer drives the large slider by its scroll position (which sent it back to the first slide). Clicking a strip image selects that slide.
- 0.7.3 — template pagination now works for logged-out visitors, no longer repeats element IDs, and clicking a slide in a linked strip jumps both sliders.
- 0.7.2 — fixed a fatal error on activation caused by duplicate property declarations in the shared trait.
- 0.7.1 — renamed from the earlier internal prefix. Custom code using the old identifiers needs updating.