Skip to content

How to Use Pattern in the Expand Block?

Key Takeaways

  • Nexter Blocks Pro incluye el bloque Expand, y se activa en Nexter > Blocks dentro del panel de WordPress.
  • Pattern source inserta un patrón guardado dentro del bloque Expand, así el mismo contenido plegable aparece en cualquier lugar y se actualiza en todas sus instancias cuando se edita el patrón.
  • AJAX debe permanecer desactivado porque, con él activado, el bloque se abre vacío y no se hace ninguna solicitud; Backend Visibility está desactivado por defecto y solo sirve para previsualizar el patrón en el editor.
Table of Contents

A block of content you use on twenty pages should be edited once, not twenty times.

The Pattern source puts a saved pattern inside the Expand block, so the same collapsible section can appear anywhere and stay in step.

For every Expand setting in one place, see the Expand block guide.

Before You Start

  • Edition: Pro — the Expand block is part of Nexter Blocks Pro.
  • Block to enable: Expand, switched on under Nexter > Blocks in your WordPress dashboard.
  • A saved pattern holding the content you want to collapse.
An Expand block sourcing a saved pattern, collapsed to its Max Height
The same pattern after the Read More button is clicked

Steps

  1. Add the Expand block to your page and click Design from Scratch.
  1. Type a Title if you want one above the box.
  1. Set Content Source to Pattern.
The Content Source setting
  1. Choose your saved pattern from the Pattern dropdown.
Content Source set to Pattern, with the pattern chooser
  1. Leave the AJAX option switched off.
  1. In Extra Options, set Max Height — how tall the box is before anyone clicks. Make it shorter than your content.
The Max Height setting
  1. Set the Text for the open and closed labels.
The expand and collapse label fields
  1. Publish and click the toggle.

Max Height has to be smaller than your content. If the content already fits, there is nothing to collapse and the toggle does nothing useful — measured with a short paragraph in a 100 pixel box, where expanding actually made the box smaller.

How It Behaves

  • The pattern really renders inside. Measured: the box opened from 100 to 165 pixels and the pattern’s own links were present in the page.
  • Editing the pattern updates every place it is used, including inside this block.
  • Backend Visibility previews the pattern in the editor. It is off by default because it makes editing heavier; switch it on to check, then off again.
  • Everything else — labels, height, fade, direction — works exactly as with the other sources.

Limitations

  • Pro only.
  • The AJAX option is broken. With it on, the box opens completely empty and no request is ever made — measured on the front end. Leave it off.
  • A pattern built for full width may not sit well in a narrow collapsed box. Check it at the width it will actually appear.
  • Editing the pattern changes it everywhere, which is the point but also the risk.
  • Hidden content is still in the page’s HTML. This is a presentation choice, not a way to keep anything private or to make the page lighter.

Troubleshooting

The box opens but is empty

The AJAX option is on. Turn it off — with it on the content is never loaded at all.

Nothing appears in the editor

That is Backend Visibility, which is off by default. Switch it on to preview.

The button does nothing

The pattern is shorter than Max Height. Lower the Max Height.

Related Docs

Share your Thoughts

Still in Doubt? Let’s Assist You

Have Feedback or Questions?

Join our WordPress Community on Facebook!