=== Tainacan Taxonomy Tail === Contributors: Steve Dogiakos for the Montana Dinosaur Center Tags: tainacan, taxonomy, accessibility Requires at least: 6.0 Tested up to: 6.7 Requires PHP: 8.1 Stable tag: 0.1.0 License: GPL v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.txt Text Domain: tainacan-taxonomy-tail
Trim Tainacan taxonomy hierarchies to show only the last N levels per block while keeping the full path accessible.
== Description ==
Tainacan Taxonomy Tail is a small companion plugin for Tainacan that trims long taxonomy hierarchy paths rendered by the Tainacan Item Metadatum block. Opt in per block to display only the final N levels of the taxonomy while preserving the complete breadcrumb as a tooltip for accessibility and context.
== Usage ==
- Configure the desired metadatum in Tainacan to expose the full hierarchy path on the front end.
- Edit the template or page that renders your items and select the Tainacan Item Metadatum block that shows this taxonomy field.
- In the block sidebar under Advanced → Additional CSS class(es) add a class such as
taxo-tail-4to keep only the last four levels. Replace4with the number of trailing terms you want to display (minimum1). - Update or publish the template or page.
When the block is rendered, only the requested number of trailing terms is displayed with a neutral › separator. Hovering or
focusing the value shows the entire original path via the title attribute for context.
== Manual Testing ==
- Activate the plugin alongside Tainacan.
- Create a taxonomy hierarchy metadatum with several levels and assign multiple terms to an item.
- Add the Tainacan Item Metadatum block to an item template, confirm the full path renders, and then add the
taxo-tail-NCSS class. - View the item on the front end:
- The value shows only the last N hierarchy levels separated by
›. - The full hierarchy remains available as a tooltip.
- Multiple hierarchy values separated by commas or
<br>elements each respect the tail setting.
- The value shows only the last N hierarchy levels separated by
- Remove the class and confirm the original behaviour is restored.
== Development Notes ==
- Trimming only runs for blocks with the
taxo-tail-Nclass (or a futuredataTailDepthattribute). - Linked breadcrumb markup and plain-text hierarchies are supported.
- The original value is preserved in a
titleattribute on the value container.
== Changelog ==
= 0.1.0 =
- Initial release with taxonomy tail trimming for the Tainacan Item Metadatum block.