johnhenry / matrix-block-anchor
Anchor field that allows a user to copy a link to the ID of a Matrix block
Installs: 13
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:craft-plugin
pkg:composer/johnhenry/matrix-block-anchor
Requires
- php: >=8.2
- craftcms/cms: ^5.0.0
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/phpstan: dev-main
This package is auto-updated.
Last update: 2026-02-08 19:24:56 UTC
README
Matrix Block Anchor is a Craft CMS field that enables content editors to create anchor links directly to Matrix Blocks without needing developer assistance. It automatically retrieves the Matrix Block ID, allowing editors to easily copy the link and use it anywhere.
Features
- Automatic Anchor Generation - Automatically retrieves Matrix Block IDs and generates anchor links without any developer intervention
- Custom Anchor Support - Allow editors to create meaningful, human-readable anchor IDs (like
#about-usor#pricing-section) instead of auto-generated ones (Craft CMS 5) - SEO-Friendly - Custom anchors improve SEO with descriptive anchor text and maintain consistent links even when content is reordered (Craft CMS 5)
- Configurable Prefix - Customize the anchor ID prefix (default:
blockIdAnchor) to match your naming conventions - Validation Built-in - Ensures anchor IDs don't start with numbers, contain spaces, or duplicate existing anchors within an entry (Craft CMS 5)
- Easy Integration - Works seamlessly with Matrix page builders - just add the field to any Matrix block type
- Copy to Clipboard - One-click copying of anchor links for editors to use anywhere on the site
- Legacy Support - Backward compatibility option for users upgrading from older plugin versions to prevent broken links (Craft CMS 5)
Perfect For
- Matrix-based page builders
- Long-form content with table of contents navigation
- Single-page websites with section navigation
- Documentation and help centers
- Landing pages with anchor-based navigation
Documentation
Full Documentation can be found at https://plugins.johnhenry.ie/matrix-block-anchor/