KupieTools Add Preview To Details Elements
WordPress plugin to display preview excerpts of the contents of closed HTML <details> disclosure elements.
by Michael Kupietz · github.com/kupietools/ktwp-wp-plugin-add-details-previews · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/kupietools/ktwp-wp-plugin-add-details-previews/archive/refs/heads/main.zipDeclares an update source (https://michaelkupietz.com/my-plugin/kupietools-add-details-previews/), so updates arrive through the plugin's own updater.
From the readme
KupieTools Add Preview To Details Elements
A WordPress plugin that automatically generates and displays content previews for HTML elements when they are in a closed state.
Features
- Automatically generates preview text from the content inside elements
- Shows the preview only when the details element is closed
- Hides the preview when the element is opened
- Customizable CSS styling for previews
- Control which elements to include or exclude through configurable selectors
- Configuration panel in WordPress admin under "KupieTools" menu
- Responsive design - works well on all device sizes
How It Works
When a user encounters a closed element, the plugin:
1. Extracts the first 250 characters of content inside the element
2. Creates a preview of this content with an ellipsis
3. Displays the preview next to the summary
4. Automatically hides the preview when the element is opened
Configuration Options
In the WordPress admin panel under KupieTools:
- Set which selectors to apply previews to (defaults to .entry-content details, .postlistsubdetail)
- Define which elements to avoid in the preview summaries
- All settings are saved in WordPress options
Use Cases
- Improve user