Use this when a new page should start from one the business already has: a second landing page, a page per service, a page per location. Build Studio has no Duplicate button, so the copy is made from the record.
Ask first
- Which page is the source? By its URL or name. Confirm it is the one that renders at that URL (step 1).
- The new page's URL and title, and which site it goes on if not the same one.
- What changes in the copy? The headline, the text, the images, a product category, a form. Everything else stays as it is.
- Should the copy be visible right away? On a site that serves drafts, it is live from the moment it is created.
Steps
1. Build Studio: read the source page
Find it with repo_find on page ({ "data.site": "<site>", "data.name": "<name>" }, or by slug), then read the full record with repo_find_one on page and its id. A find result is partial and has no style.
What a copy carries:
| Part | Where |
|---|---|
| The page's content | data.screens[] (each a full HTML document, with its variants and animations in config), data.activeScreenId, and data.html (the mirror) |
| Page CSS / JavaScript | the top-level style (css, javascript, styleLinks, scriptLinks) |
| SEO and social block | the top-level post, if there is one |
| Its wrapper | data.parent, if it has one |
| Page data settings | data.initData, data.datatype, if set |
If the source has no screens but a non-empty data.content or data.sections, it is an older-format page. Copying works, but the copy is in the same older format; say so, and offer Build a website page for a fresh one instead.
Hands on: the full source record.
Check: the record has screens (or html) with the content you see on the site, and style at the top level if the page has code.
2. Site settings: a free URL for the copy
Check the new slug and name as in Build a website page step 1: not a built-in or feature URL, not starting with sitemap, assets or tt, and no page on the site with that name or slug.
Hands on: the new name and slug. Check: nothing on the site already has them.
Stop: on a site that serves drafts (publishedPagesOnly not true), the copy is live at its URL as soon as it is created. Tell the person the URL and wait for yes.
3. Build Studio: create the copy
Create it in one call so the style comes with it — call_appengine PUT /repository/create:
{
"datatype": "page",
"isNew": true,
"data": { "…every field of the source's data…": "",
"name": "spring-offer", "slug": "spring-offer",
"title": "Spring offer", "description": "…" },
"style": { "…the source's style…": "" },
"post": { "…the source's post, if any…": "" }
}- Send the source's
datawith onlyname,slug,titleanddescriptionchanged (andsite, to copy to another site). Leave outdata.thumbnail; Build Studio makes a new one on the next save. - Never send the source's
sk,_id,pk,versionor dates. They belong to the original. repo_createcan't setstyle. If you use it, follow withpage_writeon the new id with the source'sjavascript,css,scriptLinksandstyleLinks, andreplaceStyle: true.
Answers to expect:
| Answer | Means |
|---|---|
| 200 with the new record | made; its sk is the copy's id |
409 { "reason": "duplicate", "field": "name" } | that name is taken on the site; pick another |
| 200 with no record | the same create was sent twice in a row and the second was dropped as a repeat. Look the copy up by name; don't send it again. |
Hands on: the copy's id.
Check: repo_find_one on the copy: same number of screens as the source, activeScreenId the same, style.javascript present if the source had it. Read the source again: its name, slug and version are unchanged.
4. Build Studio: change what was asked
Edit the copy, never the source:
- Text and images: change the active screen's HTML and keep
data.htmlas its mirror —page_writewith{ "id": "<copy id>", "html": "<new document>" }writes the active screen, thenrepo_updatewithpatch: { "html": "<same document>" }. - A list's filter (a category, a tag): edit the
data-source-payloadin the HTML. - Code that names the page, such as a slug or a page-specific id in
style.javascript: replace it withpage_writeandreplaceStyle: true. - To another site: links to pages that only exist on the source site, and image URLs, still point where they did. Check each link.
Hands on: nothing new.
Check: open the copy in Build Studio at /app/build-studio/<new name>; the canvas shows the changed page. Open both URLs on the site: the copy shows the changes, the source shows none.
Templates from the platform
The page templates Appmint ships (shown when a new site is set up) are copied with call_appengine PUT /repository/create-extended and { "data": { "datatype": "page", "data": { "site": "<site>" } }, "action": "create-page-from-template", "options": { "template": { "templateName": "<template site>", "name": "<template page>" } } }. The copy's name and slug get a random 6-character suffix (landing-page-x7k2qa), so rename it after.
When it's done
Tell the person: the copy's URL and name, what was changed in it, that it carries the source's Page settings code, whether it is already live, and that the source is unchanged. Open the copy in Build Studio and on the site.
What it can't do yet
- No Duplicate page button in Build Studio. Copies are made through the API.
- No link between a copy and its source. Changing the source later changes nothing in the copies; a shared part belongs in the shared header and footer or a parent page instead.
- Template copies get a random suffix on name and slug.
Don'ts
- Don't copy from a
findresult; it has nostyleand the HTML may be cut. - Don't send the source's
sk,_idorversionin the create. - Don't write to the source page while changing the copy.
- Don't make a copy at a URL a built-in page or a site feature owns.
- Don't resend a create that came back empty; find the copy first.