How to create pre-made templates?
Version 1.0.0 support: supported (since 1.0.0-beta.8 - migration is required)
Glossary
- Premade Template (Product Template) — design, based on the particular product which is set up by the admin. Objects in such design may have additional restrictions (e.g. select, remove, move). If the product contains at least one template, it is loaded automatically.
- Design Idea (Complex Artwork) — the design which has no product, can be added to products which have no templates. Usually set up as a global list.
- Open Admin Mode — start LiveArt in a special mode (Admin Mode) for creating/editing Product Template or Complex Artwork. See Admin Mode Token for more info.
- Admin Mode Token — GET var used in LiveArt designer component URL to enable Admin Mode (i.e.
?mode=createPremadeTemplate
). Could be changed in LA.config.js - Strict Template — product template with at least one object with restrictions. Changing to/from such template means canvas should be cleaned up, as restricted objects may not belong other product or design.
Usage Info:
- Open Admin Mode adding respective
GET
var (Admin Mode Token)
- Create Premade Template
?mode=createPremadeTemplate&product_id={productId}
- product_id is optional, will be used
config.defaultProductId
from the main config file
- product_id is optional, will be used
- Edit Premade Template
?mode=editPremadeTemplate&design_id={designId}
- Create Design Idea
?mode=createDesignIdea
- Edit Design Idea
?mode=editDesignIdea&design_id={designId}
- Create Premade Template
- Design Template, Save it
- Load Template:
- Premade Template is available when the respective product is selected
- Design Ideas are available if at least one Design Idea is created
Integration Info:
- Main config changes:
saveTemplateUrl
: string- link to save template service. See the service API below
getTemplatesUrl
: string- link to get template service, contains
${product_id}
place holder. See the service API below - sample:
services/getTemplates.php?product_id=${product_id}
- link to get template service, contains
- Product list changes
product.defaultTemplateId
: string- default template for a product
- Added in 0.10.30
- Save Design changes:
data.strict
: boolean- default:
false
. `true
` - if design has at least one object with restrictions. - Added in 0.10.30
- default:
- Save template service:
- see details - http://liveart.github.io/slate/#savetemplate-post
- Get templates service:
- see details - http://liveart.github.io/slate/#gettemplates-get
Previous Version Docs:
Usage Info (0.10.*):
- Create Template:
- Configure Default Product:
- For Product Template
- Set up product id
- as a GET parameter (e.g.?product_id=11
)
or
- in the main config file (i.e.config.defaultProductId
)
- Set up product id
- For Complex Artwork Template
- Make sure product id is not configured (no GET var
?product_id
and noconfig.defaultProductId
)
or - add additional
?caa_mode=true
GET parameter
Added in 0.10.30
- Make sure product id is not configured (no GET var
- For Product Template
- Open Admin Mode
- Design Template, save it
- Configure Default Product:
- How to Edit Template (both Product Template and Complex Artwork Template)
- Open Admin Mode
- Add
design_id
GET var (e.g.?design_id=123
) where123
- id of the template
Integration Info (0.10.*) UPD:
- Main config changes:
options.hideDesignIdeas
: boolean- default:
false
. If `false
` - enable "Design Ideas" on UI
- default:
Migration Notes (0.10.28[29] to 0.10.30):
This feature was added in 0.10.28 release as a beta version. If your LiveArt version is 0.10.28 or 0.10.29 we hardly recommend updating to 0.10.30+ using this migration notes.
- Product property
product.template
is deprecated. Useproduct.defaultTemplateId
instead. - Warning: template should be in products template list
- See http://liveart.github.io/slate/#products-list for more details
- All Strict templates should be resaved using Admin mode for proper functionality.
Migration Notes (0.10.30 to 1.0.0-beta.8):
- Instead of
?admin=true
GET var use:- Create Premade Template
?mode=createPremadeTemplate&product_id={productId}
product_id
is optional, if skipped -config.defaultProductId
will be used from the main config file
- Edit Premade Template
?mode=editPremadeTemplate&design_id={designId}
- Create Design Idea
?mode=createDesignIdea
- Edit Design Idea
?mode=editDesignIdea&design_id={designId}
- Create Premade Template
- Option
options.hideDesignIdeas
is deprecated- Return empty array in
getTemplatesUrl
instead
- Return empty array in