drupal-text-formats-editors

Standardize Drupal HTML text formats and CKEditor configurations.

34|12|Updated Mar 10, 2019
One-click install
npx skills add https://github.com/theodorosploumis/drupal-best-practices --skill drupal-text-formats-editors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drupal-text-formats-editors
Source: https://github.com/theodorosploumis/drupal-best-practices/tree/main/ai/skills/text-formats-editors
Command: npx skills add https://github.com/theodorosploumis/drupal-best-practices --skill drupal-text-formats-editors

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill standardizes Drupal text formats and CKEditor settings to ensure safe, consistent authoring across sites.

Core Features & Use Cases

  • Standardize on one HTML format with consistent CKEditor button sets.
  • Align allowed tags and access to minimize format switching.
  • Document permissions and ensure editor configurations match policy.

Quick Start

Create a single HTML text format with CKEditor settings aligned to allowed tags and access controls.

Frequently Asked Questions about drupal-text-formats-editors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize text formats and CKEditor settings across a Drupal site?

Standardizing text formats means creating a single HTML format with aligned CKEditor button sets and allowed tags. Configure one format in Drupal, mirror its permitted HTML tags in the editor toolbar, restrict user access to format switching, and validate settings using the provided validation script to ensure consistency across all authors.

What's the difference between allowed tags and CKEditor buttons, and why do they need to match?

Allowed tags define which HTML elements users can save; CKEditor buttons control which formatting options appear in the editor. Mismatched settings create confusion—users see buttons for tags they cannot save, or vice versa. Alignment ensures the editor surface reflects actual permissions, preventing failed submissions and support requests.

How do I prevent authors from switching between multiple text formats in Drupal?

Control format access through Drupal's permission system and text format administration. Assign specific formats to user roles, hide unused formats from the format selector, and document the mandated format in authoring guidelines. Validation ensures no role accidentally retains access to deprecated formats.

What security risks come from inconsistent text formats and editor configurations?

Inconsistent formats can expose XSS vulnerabilities if some formats allow dangerous tags while others restrict them. Authors may bypass intended safeguards by switching formats, or malicious markup may slip through unvalidated editor configurations. Standardization on a single audited format eliminates these divergence risks.

Can I use this approach for sites with multiple content types requiring different HTML rules?

This Skill enforces one mandated HTML format site-wide. If your site requires different HTML rules per content type, you'd need separate formats per type and corresponding access controls. The validation script confirms alignment within your chosen standardization scope, not across multiple formats.

How do I validate that my CKEditor buttons and allowed tags are properly aligned?

Use the provided validation script ./ai/scripts/validate-text-formats.sh to test your configuration. It checks that CKEditor button sets match allowed tags, permissions are correctly scoped, and no format-switching loopholes exist. Run it after any configuration change to confirm standardization is maintained.