Skip to content

tmdinosaurcenter/tainacan-taxonomy-tail

 
 

Repository files navigation

=== 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 ==

  1. Configure the desired metadatum in Tainacan to expose the full hierarchy path on the front end.
  2. Edit the template or page that renders your items and select the Tainacan Item Metadatum block that shows this taxonomy field.
  3. In the block sidebar under Advanced → Additional CSS class(es) add a class such as taxo-tail-4 to keep only the last four levels. Replace 4 with the number of trailing terms you want to display (minimum 1).
  4. 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 ==

  1. Activate the plugin alongside Tainacan.
  2. Create a taxonomy hierarchy metadatum with several levels and assign multiple terms to an item.
  3. Add the Tainacan Item Metadatum block to an item template, confirm the full path renders, and then add the taxo-tail-N CSS class.
  4. 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.
  5. Remove the class and confirm the original behaviour is restored.

== Development Notes ==

  • Trimming only runs for blocks with the taxo-tail-N class (or a future dataTailDepth attribute).
  • Linked breadcrumb markup and plain-text hierarchies are supported.
  • The original value is preserved in a title attribute on the value container.

== Changelog ==

= 0.1.0 =

  • Initial release with taxonomy tail trimming for the Tainacan Item Metadatum block.

About

Trim Tainacan taxonomy metadatum display to the last N ancestors, per-block via a class like "taxo-tail-4".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PHP 68.3%
  • JavaScript 24.8%
  • Shell 6.9%