Skip to content

Quickstart

This walkthrough takes about fifteen minutes. You will create a category and a product blueprint, add a product in two languages, and publish it to a channel.

You need a workspace where you are an owner or admin. To try Attricat on your own machine, run curl -fsSL https://docs.attricat.com/install.sh | sh and sign in with the credentials it prints. See Try it on your machine for the details.

Open Manage → Blueprints → New blueprint and paste:

format_version: 1
code: category
name: Category
kind: record
attributes:
- code: name
value_type: string
- code: parent
value_type: relationship
target_blueprint: category
tree: true
context_editable: default
views:
dropdown_option:
type: dropdown_option
fields: [name]

Save it, then Publish revision 1.

parent points at another category, and tree: true makes categories a tree, which is what lets a filter on a category include everything under it. A tree is shared by every context, so parent needs context_editable: default. kind: record makes this a record blueprint.

Create a second blueprint:

format_version: 1
code: product
name: Product
kind: record
record_schema: '{"type":"object","required":["sku","title"]}'
attributes:
- code: sku
value_type: string
context_editable: default
- code: title
value_type: string
- code: price
value_type: number
value_schema: '{"type":"number","minimum":0}'
- code: categories
value_type: relationship
target_blueprint: category
views:
dropdown_option:
type: dropdown_option
fields: [title, sku]
separator: ' / '
table:
type: table
columns:
- {field: sku, label: SKU}
- {field: title}
- {field: price}

Publish it.

record_schema holds the record schema. It is a top-level key, so it sits at the same indentation as attributes, not under an attribute. A key indented under the last attribute would become part of that attribute.

Open the Record explorer, choose Category, and Create record twice:

  1. name = Apparel
  2. name = Shirts, parent = Apparel

Choose Product in the Explorer and create one:

  • sku = SH-0001
  • title = Linen shirt
  • price = 49
  • categories = Shirts

Try saving without a title: the record schema rejects it. Try a price of -1: the value schema rejects it.

Open Manage → Contexts → Create context. Create PL under the root, with metadata {"language": "pl"}.

Open the product and choose the PL tab under Data. Every field shows Inherited from default context. Set title to Lniana koszula and leave the field to save it. sku is read-only here because it is managed in the default context.

In the Explorer, open Search scope, the sliders button next to the blueprint selector, and switch Context between default and PL to see the title change.

Open Manage → Exports and turn on Export channel for PL.

Back on the product, select the PL context. The globe icon in the record toolbar shows Not published. Choose Actions → Publish.

Now change the product’s price and leave the field. The publication is withdrawn: the icon shows Not published again, because the approved state is no longer the current one. Choose Actions → Publish again to approve the change.

With a few more products and categories:

  • search categories.name:shirts;
  • in the Browse by panel, shown on wide screens, pick Apparel to include everything under it;
  • Add filter for price less than 50;
  • Save search to keep the result.