Skip to content

lymarrie/site-attributes

Repository files navigation

Sites Products Starter - Site Entity Implementation

This repo contains an implementation of site attributes via Streams, instead of global.json. On the Knowledge Graph side, this was accomplished by:

  1. Creating a site entity
  2. Adding a custom field (c_relatedSite) to the product entity type that relates the product with the site entity (example)
  3. Converting all static pages in the repo to stream-based pages

Typically by convention, all pages in Sites starter repos are divided into two directories - based on whether or not they rely on Streams:

  • /pages - (holds static pages - e.g. index, about, etc.)
  • /templates - (page templates for entity pages - e.g. location, product, faq, etc.)

This repo differs in that:

  • all static pages defined in the /pages directory now rely on a Stream scoped to this saved filter (which contains a single site entity)
  • all templates defined in /templates now include a reference to the site entity as a related field in frontmatter (refer to line 16)

Therefore, when a site entity is updated in KG, every single page template in the repo is affected, and therefore gets updated as a result.

The resulting deploy can be viewed in the platform here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published