web replace
This block is part of the web group and was last modified in core v15.0.1.
web replace v15.0.1 Replaces one element of the page (a row, a card, a button) with new HTML, rendered on the server.
- flow
- key
valueThe element's data-key: a row of web for each, or the key a web action received.
- target
valueA CSS selector instead of a key, e.g.
#cart-count. - html
valuerequiredThe new HTML, e.g. from web template.
- flow
Adds a browser update to the web action's answer: the element is replaced by `html` (outerHTML, so the new markup is the element itself; when it has no data-key the browser keeps the old key on it). Addressed by `key` (matches [data-key="<key>"]) or, when key is empty, `target` (a CSS selector); neither is an error that stops the flow. Only in a flow started by web_action (an error elsewhere). Updates apply in the order the blocks ran.
rerender row |
swap html |
update row |
web replace swaps one element for new HTML, outer tag included. Here a subscribe form stores the address with create document, and the form itself is found by a CSS selector on the target pin and replaced by a thank you. To replace one row of a table, wire the key of on web action into the key pin instead: target is only used when key is empty, and neither of them is an error that stops the flow.
Used in these guides
These documentation pages use or explain this block:
- Common Blueprint Patterns
- Escaping and Security
- Migrating from State Pages
- Web Actions
- Example: Booking System
- Example: E-Commerce Catalog
- Example: Inventory Tracker
- Example: Simple Blog
Version history
Introduced in v15.0.1.
v15.0.1: block added in this release.
Back to
web Return to the main group to view all sub-groups Back to web actions Return to the group to view all blocks within this group 