Add a saved section to an Avada or WPBakery page

ContentIntermediate~10 min

Before you start

Plugin version 1.12.0 or newer with Avada or WPBakery Page Builder active. Use the tools for the builder that owns the page and switch on its library read, its page read and its insert tool; all start off. The agent needs edit access to the page and to the item. A global Avada item needs a user who can edit private posts, and an item holding a code block, raw HTML or raw JS needs a user who may post unfiltered HTML. The restore point needs revisions on and more than one kept per post.

You already built the testimonial strip once and saved it to the library. Now it needs to go on six landing pages, under the pricing table, and dragging it in by hand on each one is slow. Both builders keep saved sections you can reuse: Avada in its Library, WPBakery in its template library (or Templatera, when that add-on is active).

This prompt finds the saved item, agrees on the exact spot, and places it there.

The prompt
I want to add our saved [Testimonials] section to the [Pricing] page
(id [77]), directly [after] the [pricing table].
First tell me which builder owns the page. If it is Avada, list the Avada
Library with avada-list-library; if it is WPBakery, list the templates with
wpbakery-list-templates. Show me the items whose names match and wait for me
to pick one. Tell me if the Avada item is global, because then the page will
show the shared item rather than a copy.
Read the page outline with include_structure and find the [pricing table].
Tell me its index and tag, and the placement you will use. Do not insert
anything until I say go. Then insert the item with the page fingerprint from
that read. Afterwards, read the outline again to confirm where the section
landed, and give me the restore_revision_id.

Why this is safe to run

The library list and the page read change nothing, and you pick the item and the anchor element before any write. The insert needs the page fingerprint from the last read, so a page someone edited in the meantime is refused with nothing saved. Other elements’ positions can shift after an insert, which is why the prompt reads the outline again before anything else happens.

The content checks come from the builder tools themselves. An item may hold at most 50 elements nested at most 6 deep. For a user who may not post unfiltered HTML, an item’s text may hold no square bracket, percent-encoded bracket, data-* attribute, unfinished tag or HTML WordPress would remove. An Avada global item it shows by reference gets the same access and content checks, at any depth, and a reference loop is refused. After a WPBakery insert, the page’s generated CSS is rebuilt.

When revisions are on, the write returns restore_revision_id, and Restore revision takes the page back to how it was. These inserts are not in the Changes tab. Each tool is off until you switch it on, runs as the user you bound the agent to, and is logged.

To bring in a ready-made section from Avada Studio first, see import an Avada Studio section and place it.

Already connected? Ask your agent for the “add a saved section” recipe, name the section and the page, and it runs the same flow on your own site.

How it works

  1. List the saved items in the builder's library and confirm which one you want.
  2. Read the page outline and agree on the element to place it next to.
  3. Confirm the placement: before, after, or as the first or last child.
  4. Insert the item with the page fingerprint from the read.
  5. Read the outline again and keep the restore_revision_id.

Questions

Is the section copied or linked?
An ordinary Avada item and a WPBakery template are copied byte for byte, so later edits to the page do not touch the library. A global Avada item is placed as a reference, the way Avada's builder does it, so the page keeps showing the item itself. A Templatera template can be placed as a reference with mode reference.
What if the section does not fit where I asked?
Each builder's own nesting rules apply. On Avada a saved section goes at the top level, a saved column inside a row and a saved element inside a column. On WPBakery the top level takes rows and sections. A place that breaks those rules is refused with nothing saved.
Can it put a section on an empty page?
On WPBakery, yes: leave out the anchor on an empty post with no builder and the template starts the page, where WPBakery's editor is on for that post type. On Avada, this recipe places the item next to an element already on the page.