Envisioning LogoEnvisioning App (1.0.3)
Configuration

Pages

Configure page layouts and content blocks

Overview

Pages define what content is displayed for each route. Each page specifies which blocks to render in different areas (main content, side panel, header, footer).

import type { Config } from "@envisioning/app";

const pages: Config["navigation"]["pages"] = [
  {
    id: "technologies",
    menuId: "techs",
    label: { en: "Technologies" },
    content_blocks: ["entitiesList"],
    context: {
      schemaKey: "entities",
      plurality: "many",
    },
  },
];

Properties Reference

PropertyTypeRequiredDescription
idstringYesUnique page identifier
menuIdstringYesAssociated menu item ID
labelI18nYesPage display label
content_blocksstring[] | Record<DisplayMode, string[]>YesMain content block IDs
rightContent_blocksstring[]NoSide panel block IDs
leftContent_blocksstring[]NoFull-page left content
headerContent_blocksstring[]NoHeader block IDs
footerContent_blocksstring[]NoFooter block IDs
footerPanel_blocksstring[]NoPanel footer blocks
preview_blocksstring[]NoPreview blocks (hover/preview mode)
contextobjectNoData context configuration
sortOptionsarrayNoAvailable sort options
groupOptionsarrayNoGrouping options
showFavoritebooleanNoShow favorite button in top bar
textContentstringNoTemplate for text/markdown content

Page Types

Static Pages

Pages without data context display static content:

{
  id: "about",
  menuId: "about",
  label: { en: "About" },
  headerContent_blocks: ["coverImage"],
  content_blocks: ["spacerSm", "aboutText", "evLogo"],
  textContent: `{{data.project.about}}`,
}

List Pages (Many Items)

Display multiple items from a schema object:

{
  id: "technologies",
  menuId: "techs",
  label: { en: "Technologies" },
  context: {
    schemaKey: "entities",
    plurality: "many",
  },
  content_blocks: ["entitiesList"],
  footerPanel_blocks: ["panelSearch"],
  showFavorite: true,
  sortOptions: [
    { title: "Title", sortCriteria: { title: 1 } },
    { title: "TRL", sortCriteria: { "trl.value": 1 } },
  ],
  groupOptions: [
    { label: { en: "Collection" }, joinKey: "collection" },
    { label: { en: "TRL" }, joinKey: "trl" },
  ],
}

Detail Pages (Single Item)

Display a single item's details:

{
  id: "technology",
  menuId: "techs",
  label: { en: "Entity" },
  context: {
    schemaKey: "entities",
    plurality: "one",
  },
  content_blocks: [
    "spacerMd",
    "contextSummary",
    "trlChart",
    "contextDescription",
  ],
  footerPanel_blocks: ["techsPagination"],
  preview_blocks: ["entity-preview-item"],
  showFavorite: true,
}

Content Blocks

Simple Block List

content_blocks: ["entitiesList", "spacer", "pagination"]

Display Mode-Aware Blocks

Different blocks for list vs card view:

content_blocks: {
  list: ["entitiesList"],
  cards: ["entitiesCards"],
}

Page Areas

AreaDescription
headerContent_blocksFull-width header area
content_blocksMain content area
rightContent_blocksSide panel (when in panel mode)
leftContent_blocksLeft column (when in full-page mode)
footerContent_blocksFull-width footer area
footerPanel_blocksPanel footer (search, pagination)
preview_blocksHover preview card content

Context Configuration

The context object tells the page which data to load:

context: {
  schemaKey: "entities",    // Schema object key
  plurality: "many" | "one" // List or detail view
}
  • plurality: "many" - Lists all items, provides context._items array
  • plurality: "one" - Single item, provides context with item data

Sort Options

Define how users can sort list pages:

sortOptions: [
  {
    title: "Title",
    sortCriteria: { title: 1 },  // 1 = ascending
  },
  {
    title: "TRL",
    sortCriteria: { "trl.value": 1 },
    fixed: { collection: 1 },  // Optional: always sort by collection first
  },
]
PropertyTypeDescription
titlestringDisplay label
sortCriteriaRecord<string, 1 | -1>Sort fields (1 = asc, -1 = desc)
fixedRecord<string, 1 | -1>Optional fixed sort applied first

Group Options

Define how users can group list pages:

groupOptions: [
  {
    label: { en: "Collection" },
    joinKey: "collection",
  },
  {
    label: { en: "TRL" },
    joinKey: "trl",
  },
]

Text Content (AI/Export)

The textContent field provides a text representation of the page for AI assistants and exports:

{
  id: "technology",
  textContent: `{{context.summary}}
Collection: {{context.collection.title}}
{%- for ass in context.assessment %}
Assessment for {{ass.country.code}}:
  - TRL: {{ass.metric1.value}}
  - Cost: {{ass.metric2.value}}
{%- endfor%}`,
}

Uses Nunjucks templating syntax.


Complete Example

export const pages: Config["navigation"]["pages"] = [
  // Home page
  {
    id: "home",
    menuId: "home",
    label: { en: "Home" },
    headerContent_blocks: ["coverImage"],
    content_blocks: ["spacerSm", "scopeItem", "homeIntro"],
    textContent: `{{data.project.description}}`,
  },

  // List page
  {
    id: "technologies",
    menuId: "techs",
    label: { en: "Technologies" },
    context: {
      schemaKey: "entities",
      plurality: "many",
    },
    content_blocks: { list: ["entitiesList"], cards: ["entitiesCards"] },
    footerPanel_blocks: ["panelSearch"],
    showFavorite: true,
    sortOptions: [
      { title: "Title", sortCriteria: { title: 1 } },
      { title: "TRL", sortCriteria: { "trl.value": 1 } },
    ],
    groupOptions: [
      { label: { en: "Collection" }, joinKey: "collection" },
    ],
  },

  // Detail page
  {
    id: "technology",
    menuId: "techs",
    label: { en: "Technology" },
    context: {
      schemaKey: "entities",
      plurality: "one",
    },
    content_blocks: [
      "spacerMd",
      "contextSummary",
      "dash",
      "trlChart",
      "contextDescription",
    ],
    footerPanel_blocks: ["techsPagination"],
    preview_blocks: ["entity-preview-item"],
    showFavorite: true,
  },

  // About page
  {
    id: "about",
    menuId: "about",
    label: { en: "About" },
    content_blocks: ["aboutText", "evLogo"],
    textContent: `{{data.project.about}}`,
  },
];

On this page