How to create pre-made templates?

Version available: 0.10.28+
Version 1.0.0 support: supported (migration is required)

Glossary

  1. 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.
  2. Complex Artwork — the design which has no product, can be added to products which have no templates. Usually set up as a global list. 
  3. 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.
  4. Admin Mode Token —  by default GET var to open designer in Admin Mode (i.e. ?admin=true). Could be changed in LA.config.js
  5. Strict Template — 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:

  1. Create Template:
    1. Configure Default Product:
      1. For Product Template
        1. Set up product id
          - as a GET parameter (e.g. ?product_id=11)
                     or
          - in the main config file (i.e. config.defaultProductId)
      2. For Complex Artwork Template
        • Make sure product id is not configured (no GET var  ?product_id and no config.defaultProductId)
                     or
        • add additional ?caa_mode=true GET parameter 
          Added in 0.10.30
    2. Open Admin Mode
    3. Design Template, save it
  2. How to Edit Template (both Product Template and Complex Artwork Template)
    1. Open Admin Mode
    2. Add design_id GET var (e.g. ?design_id=123) where 123 - id of the template

Integration Info:

  1. Main config changes:
    1. saveTemplateUrl: string
      • link to save template service. See the service API below
    2. 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}
    3. options.hideDesignIdeas: boolean
      • default: false. If `false` - enable "Design Ideas" on UI
  2. Product list changes
    1. product.defaultTemplateId: string
      1. default template for a product
      2. Added in 0.10.30
  3. Save Design changes: 
    1. data.strict: boolean
      • default: false. `true` - if design has at least one object with restrictions.
      • Added in 0.10.30
  4. Save template service:
  5. Get templates service:

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.
  1. Product property product.template is deprecated. Use product.defaultTemplateId instead.
    1. Warning: template should be in products template list
    2. See http://liveart.github.io/slate/#products-list for more details
  2. All Strict templates should be resaved using Admin mode for proper functionality.

Feedback and Knowledge Base