--- title: Article and Subscription model set description: A complete beta project demonstrating structured, prose and expression validation hints. editUrl: https://github.com/cmmf-project/cmmf-docs-web/edit/main/src/content/beta/examples/article.md --- An external article needs a source URL, and search exclusion needs an explanation. A subscription's quarterly price may depend on its monthly price. The canonical **1.3.0-beta.1** set records these needs without pretending every CMS can enforce them. [Download the complete beta project](/downloads/examples/1.3.0-beta.1/article.zip) · [Combined model JSON](/downloads/examples/1.3.0-beta.1/article.models.json) · [Matching schema](/schemas/1.3.0-beta.1/model.schema.json) ## Included models The set contains **Article, Page, Person, SEO Metadata and Subscription**, plus a manifest, schema, declaration checker, validator, bundler and pinned package dependencies. Keep all five definitions together so references resolve. ```yaml title="examples/manifest.yaml" specVersion: "1.3.0-beta.1" namespace: headlessco.content-model-master modelsPath: ./models defaults: required: false localisation: false ``` ## Article: conditional and cross-field intent This is one model from the complete set, rather than a standalone project. Its Person and SEO Metadata dependencies are included in the download. ```yaml title="examples/models/article.yaml" id: article name: Article kind: entry description: Editorial article content type. tags: - editorial fields: - id: title name: Title type: string required: true validations: minLength: 5 maxLength: 100 - id: slug name: Slug type: slug required: true editorial: helpText: Used in URLs. - id: summary name: Summary type: text validations: maxLength: 250 - id: body name: Body type: richText required: true richTextConfig: marks: - bold - italic - link blocks: - paragraph - heading-2 - heading-3 - unordered-list - ordered-list - quote embeds: - kind: asset - kind: reference targets: - person - id: hero_image name: Hero Image type: asset validations: mimeTypes: - image/jpeg - image/png - id: author name: Author type: reference targets: - person relation: ownership: linked - id: seo name: SEO type: object objectType: seo-metadata translationHints: preferredRepresentation: embedded - id: article_type name: Article Type type: enum required: true values: [internal, external] - id: source_url name: Source URL type: string - id: noindex name: Exclude from Search type: boolean - id: noindex_reason name: Search Exclusion Reason type: text validationHints: - id: external-requires-source description: External articles must provide a source URL. when: field: article_type equals: external then: require: [source_url] - id: author-or-source description: Provide at least one author or a source URL. then: atLeastOneOf: [author, source_url] - id: explain-noindex description: Explain why an external article is excluded from search. severity: warning when: allOf: - field: article_type equals: external - not: anyOf: - field: noindex isEmpty: true - field: noindex equals: false then: require: [noindex_reason] - id: check-source-rights description: Confirm permission to republish external source material. severity: info editorial: labelField: title preview: title: title description: summary image: hero_image governance: owner: platform-team status: active maturity: stable ``` ## Subscription: an expression escape hatch This rule uses a named dialect. The checker validates its wrapper; it does not execute the expression or establish support in a CMS. ```yaml title="examples/models/subscription.yaml" id: subscription name: Subscription kind: entry description: Illustrates a non-portable expression; CMMF does not execute it. fields: - id: monthly_price type: number required: true - id: quarterly_price type: number required: true validationHints: - id: quarterly-price-bound description: Quarterly price must exceed three times the monthly price. expression: dialect: jsonlogic rule: {">": [{"var": "quarterly_price"}, {"*": [3, {"var": "monthly_price"}]}]} ``` ## Validate the project Use Node 22.12 or newer: ```sh npm ci npm run validate npm run bundle ``` The project checks the complete model graph as well as schema shape and beta hint semantics, including direct field references, unique hint IDs, operator/operand types and regex syntax. It does not evaluate content or expressions. `npm run bundle` writes `models.json` from the same validated YAML definitions. The exact upstream manifest and model bytes are preserved. `SOURCE.md` records commit and schema hash; `SCHEMA-LICENSE.md` covers upstream material. [Validation guidance](/versions/1.3.0-beta.1/docs/guides/validation/) distinguishes these checks from content validation. [Translation](/versions/1.3.0-beta.1/docs/concepts/translation/) explains the required disposition for every hint.