addContainer Method

Callable

  • Adds a channel container to the print area.

    example
    // Initialize a product with the "card.psd" template.
    const productDefinition = {
        surfaces: ["card"]
    };
    
    // Load the editor.
    CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition)
    
        // If the editor has been successfully loaded.
        .then(function (editor) {
            // When we get the product.
            editor.getProduct().then(function (product) {
                // Add a container to the print area.
                product.currentSurface.printAreas[0].addContainer({
                    name: "foil",
                    type: "texture",
                    texture: "texture.jpg",
                    // Expects a translated string for the FOIL key in translations.json.
                    translationKey: "ObjectInspector.FOIL"
                });
            });
        });
    

    Parameters

    Returns Promise < Container >

    An instance of the added container.