Skip to content

Move pages from Paragraphs to DXPR Builder

You rebuild the paragraphs of each page as DXPR Builder elements, in a new field on the same content type. The paragraphs stay online until every page is done. Afterwards, editors design the page on the page itself instead of filling in paragraph forms. No tool converts paragraphs, but Drush can write prepared HTML into many pages at once.

Before you start

  • DXPR Builder is installed and your product key is saved, see General settings.
  • You can manage the fields and the display of the content type.
  • Every page of the content type counts as a content item once its display uses the DXPR Builder formatter. Check your limit on the Content Items tab.

Set up

  1. Go to Structure > Content types (/admin/structure/types) and click Manage fields for the content type.
  2. Add a field: choose Formatted text, then Long text, for example "Page content".
  3. Click Manage display and set the Format of the new field to DXPR Builder.
  4. Leave the Paragraphs field where it is and click Save.

Rebuild each page

  1. Open the page. The empty DXPR Builder field shows next to the paragraphs.
  2. Rebuild each paragraph with the matching element from the table below.
  3. Copy the text of each paragraph into the new elements.
  4. Click Save on the DXPR Builder toolbar.
Paragraph type DXPR Builder element
Text Text
Image Image
Text with image Row with two columns: Text and Image
Accordion Collapse panel on the Layout tab
Call to action Button
Video Video
Gallery Image carousel
Webform The webform block on the Drupal Blocks tab
Anything else HTML, or a combination of elements

Rebuild many pages with Drush

DXPR Builder turns Bootstrap 5 HTML into elements you can drag and edit. If you can export the old content as HTML, write it into each page with Drush. Try it with --dry-run first, which shows the change without saving:

drush dxb:page:update 42 --markup=@/tmp/page-42.html --dry-run
drush dxb:page:update 42 --markup=@/tmp/page-42.html

The command finds the DXPR Builder field on the default display of the content type. It saves a new revision, so you can roll back.

Finish the move

  1. On Manage display, move the Paragraphs field to Disabled and click Save.
  2. Check the rebuilt pages, also on a phone.
  3. Delete the Paragraphs field on Manage fields only when you no longer need its content. Deleting it removes the paragraphs for good.

What you see

Each page shows the content of the DXPR Builder field, and the paragraphs no longer appear. Editors with the Edit with DXPR Builder permission see the editing controls on the page. The Content items tab lists every page of the content type.

If you don't see the editor

  • The page shows the old and the new content. The Paragraphs field is still on the display. Move it to Disabled on Manage display.
  • Drush reports "No DXPR Builder field found". The default display does not use the DXPR Builder formatter. Set the Format on Manage display of the default view mode.
  • Drush reports "Multiple DXPR Builder fields found". The content type has more than one. Name the field, for example --field=field_page_content.
  • The field shows, but no editing controls. Your account lacks the Edit with DXPR Builder permission, or your licence limits are reached. See Licence and product key errors.

What's next?

Something wrong or missing on this page? Report it or edit the page.