WP Manifestindependent plugin directory
manifest / editor / dhali-breadcrumbs

Dhali Breadcrumbs

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/dhali-web/dhali-breadcrumbs/archive/refs/heads/master.zip
Updates itself. It ships its own updater, so new versions appear under Dashboard → Updates.

A breadcrumb trail block for FSE templates: Home → (post type archive, if a custom post type) → (primary taxonomy term, if one exists) → (page ancestors) → current page title.

Managed centrally by Dhali Extension Manager, which installs and activates this plugin on a site from this repo directly. It's also a fully standalone, valid WordPress plugin — you can install it manually the normal way if you ever need to.

What it does

Adds a "Dhali Breadcrumbs" block (create-block/dhali-breadcrumbs), meant for a single/page template's header area. On the front end it builds a trail in this order:

  1. Home — always first, links to the site root.
  2. Post type archive — only if the current post is a custom post type (not a core Page or Post) and that post type has archives enabled.
  3. Primary taxonomy term — see the configuration note below.
  4. Page ancestors — for hierarchical pages/sub-pages, each parent in the chain.
  5. Current page title — plain text, not a link.

Two attributes control the separator: crumbsSeparator (default >) and separatorSpacing (default 6, in pixels).

⚠️ Requires per-site configuration — hardcoded taxonomy slug

src/dhali-breadcrumbs/render.php has a taxonomy slug hardcoded, with a comment marking it as a placeholder left in from the original site:

// REPLACE 'program_colonie_type' with your actual taxonomy slug from CPT UI
$taxonomy_slug = 'program_colonie_type';

This is not generic — install it on a new site and the taxonomy lookup will just silently find nothing (harmless, but the taxonomy breadcrumb level won't appear). Before relying on it:

  • If the new site has no relevant custom taxonomy, this whole block just degrades gracefully — the archive/taxonomy segments are skipped and you still get Home → ancestors → current page.
  • If the new site does have a taxonomy you want represented in the trail, replace program_colonie_type with that site's actual taxonomy slug (visible in CPT UI, or Tools > Site Health > Info under taxonomies).
  • Longer term, this should probably become a block attribute (editable per-instance in the sidebar) rather than a hardcoded constant — worth doing before this gets reused on a third site.

Also worth knowing: block.json's own "description" field is still the literal @wordpress/create-block scaffold placeholder text ("Example block scaffolded with Create Block tool") — it was never updated to describe the real behavior above. Worth fixing so the block inserter shows something meaningful.

Requirements

  • WordPress 6.8+
  • PHP 7.4+

Usage

Insert the "Dhali Breadcrumbs" block into a template — typically just below the header, inside a single/page template. Adjust the separator character and spacing from the block's settings panel.

Development

Scaffolded with @wordpress/create-block. Source lives in src/, compiled output in build/ — both are committed to this repo, since Dhali Extension Manager installs directly from the repo's files and does not run a build step of its own.

npm install
npm start     # dev build with watch
npm run build # production build — run this before committing

If you edit anything in src/, always run npm run build and commit the updated build/ output in the same commit — otherwise the site installs whatever build/ last had, not your source changes.

Keeping this updated on sites where it's already installed

This plugin should carry its own update-checker (includes/dhali-plugin-updater.php) and an Update URI: header pointing at this repo, the same way Dhali Copyright does — confirmed working there as of 0.2.0. If this repo doesn't have that wired up yet, copy the pattern from Dhali-Copyright: the header line, the require_once/init() call, and the updater class file itself.

Once wired up: bump Version:, push to master, done — sites already running this plugin will see a normal "Update available" notice without any manual redeploy.