← All learning materials
Templates & Previews · 35 MIN READ · DEVELOPER GUIDE

How manifests and template previews work

Trace a template from JSON configuration to a preview and showcase page.

Learning progress is saved in this browser when local storage is available.

The manifest is structured content

Template manifests are JSON arrays containing records such as name, category, feature, URL and design file. They describe templates; they do not execute PHP. The PTR manifest is shared by Photography, Real Estate and Travel, so changing it requires preserving the other categories.

From manifest to catalog

wh_solution_distinct_templates() merges relevant manifests. template-catalog-loader.php merges current generated templates into the catalog so showcase selection can resolve the correct identity. feature-template-showcase.php builds a template-showcase URL using the name and SHA-256 of its catalog URL.

Preview identity and assets

The Travel preview PHP route allows only known Travel template hashes and inserts an asset base matching the template folder. Catalog identity still uses the original template URL. CSS/HTML hashes change preview cache versions after edits; an identity hash is a lookup key, not a password.

Syntax in practice

A focused learning example. Read the referenced source file for its full application context.

$templates = wh_solution_distinct_templates('travel', 'custom-itineraries');
foreach ($templates as $template) {
    $id = hash('sha256', $template['url']);
    // Keep the source URL stable when changing presentation.
}
PUT IT INTO PRACTICE

Try it yourself

Find one Travel template in the manifest and trace its URL to the showcase lookup without editing other categories.

Work on a development copy, then explain what changed and how you verified it.

Project file map

Find these paths in your local WebsHigher checkout. Source paths are references, not public downloads of application code.

  • includes/ptr-feature-template-manifest.json
  • includes/template-catalog-loader.php
  • includes/feature-template-showcase.php
  • travel-template-preview.php

Keep learning

Start here: the WebsHigher codebase →Run the project locally →PHP syntax and reusable page components →
Get Started