How to create pre-made templates?

Version available: 0.10.28+
Version 1.0.0 support: supported (since 1.0.0-beta.8 - migration is required)

Glossary

  1. 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.
  2. 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. 
  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 —  GET var used in LiveArt designer component URL to enable Admin Mode (i.e. ?mode=createPremadeTemplate). Could be changed in LA.config.js
  5. 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:

  1. Open Admin Mode adding respective GET var (Admin Mode Token)
    1. Create Premade Template ?mode=createPremadeTemplate&product_id={productId}
      1. product_id is optional, will be used config.defaultProductId from the main config file
    2. Edit Premade Template ?mode=editPremadeTemplate&design_id={designId}
    3. Create Design Idea ?mode=createDesignIdea
    4. Edit Design Idea ?mode=editDesignIdea&design_id={designId}
  2. Design Template, Save it
  3. Load Template:
    1. Premade Template is available when the respective product is selected
    2. Design Ideas are available if at least one Design Idea is created

Integration Info:

  1. 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}
  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:

Previous Version Docs:



Usage Info (0.10.*):

  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 (0.10.*) UPD:

  1. Main config changes:
    1. options.hideDesignIdeas: boolean
      • default: false. If `false` - enable "Design Ideas" on UI

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.

Migration Notes (0.10.30 to 1.0.0-beta.8):


  1. Instead of ?admin=true GET var use:
    1. Create Premade Template ?mode=createPremadeTemplate&product_id={productId}
      1. product_id is optional, if skipped - config.defaultProductId will be used from the main config file
    2. Edit Premade Template ?mode=editPremadeTemplate&design_id={designId}
    3. Create Design Idea ?mode=createDesignIdea
    4. Edit Design Idea ?mode=editDesignIdea&design_id={designId}
  2. Option options.hideDesignIdeas is deprecated
    1. Return empty array in getTemplatesUrl instead


Feedback and Knowledge Base