← Product Templates Academy

Build the solution · 4 / 4

Offer a configurable booklet

Let customers choose a printable page count.

YOUR TASK

Make this happen

3 steps
  1. Add required pages configuration: integer 8–64, multipleOf 4, PAGE_COUNT dimension, applying to text. Keep stock selection and all operations.

  2. Keep the working capabilities from the previous lesson and connect the new pieces to the same solution.

  3. Check the complete solution, then inspect any unmet requirements.

This step starts with the earlier solution and one new challenge. Each lesson keeps its own draft.

Read the starter files

main.cococo

product_template "booklet" {
  name = "Customer booklet"
  sku = "BOOKLET-A5"
  components = [{
    localId = "text"
    kind = "TEXT"
    name = "Booklet pages"
    totalPages = 16
    mediaSelectors = [{
      localId = "house_silk"
      name = "Silk text stock"
      weight = {
        range = {
          min = 120
          max = 150
        }
      }
      coatings = ["SATIN"]
    }]
  }]
  operations = [{
    localId = "print"
    componentLocalId = "text"
    kind = "DIGITAL_PRINTING"
    name = "Print pages"
    dependsOn = []
  }, {
    localId = "fold"
    componentLocalId = "text"
    kind = "FOLDING"
    name = "Fold pages"
    dependsOn = ["print"]
  }, {
    localId = "bind"
    kind = "SADDLE_STITCHING"
    name = "Bind booklet"
    dependsOn = ["fold"]
  }]
}

Reference: product-templates · authoringschemas · authoring