Drupal Views

Normalize Drupal Views metadata including machine names, titles, tags, and per-display documentation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you create Drupal Views that are organized, performant, and secure, preventing common issues like confusing machine names, insecure access, and inconsistent content rendering. It ensures your content listings are robust and easy to manage.

Core Features & Use Cases

  • Normalized Machine Names: Automatically remove default suffixes (e.g., _1) and ensure Views have clear, descriptive machine names, titles, and administrative tags.
  • Permission-Based Access: Enforce the use of permission-based access controls for each View display, enhancing security.
  • Entity Rendering via View Modes: Promote rendering entities through their view modes (e.g., "Teaser", "Full") to maintain consistent styling and reduce theme complexity.
  • Use Case: Design a "Latest News" View by asking Claude to ensure its machine name is latest_news, it has a clear administrative description, access is restricted to "View published content," and it renders articles using the "Teaser" view mode.

Quick Start

Design a View for article teasers with normalized machine names, per-display titles, access controls, and a No Results message that uses the teaser view mode.

Frequently Asked Questions about Drupal Views

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

FAQPage Schema
How do I normalize Drupal Views machine names and ensure consistent naming?

Normalize Drupal Views by removing default suffixes like `_1` and assigning clear, descriptive machine names, titles, and administrative tags. Use the validation script `./ai/scripts/validate-views.sh` to enforce naming standards across your site-building workflow.

What's the best way to control access to Drupal Views displays?

Apply permission-based access controls to each View display instead of relying on blanket settings. Restrict access using specific permissions such as 'View published content' per display to enhance security and prevent unauthorized content exposure.

How do I render content consistently across Drupal Views?

Render entities through view modes—such as 'Teaser' or 'Full'—rather than direct field output. This maintains consistent styling, reduces theme complexity, and ensures per-display rendering aligns with your site's content display strategy.

Can I set custom titles and No Results messages per Drupal View display?

Yes. Configure per-display titles and No Results messaging to provide context-specific feedback for each display. This improves user experience and keeps content listings informative across different View contexts.

Why should I avoid blanket CSS classes and default Ajax in Drupal Views?

Blanket CSS classes and default Ajax settings create performance and maintainability issues. Use intentional, scoped styling and explicit Ajax configuration per display to optimize performance and prevent unintended behavioral side effects.

Do I need administrative documentation for Drupal Views?

Yes. Add admin descriptions and tags to Views so site builders can quickly understand purpose, access controls, and rendering approach. Clear metadata prevents confusion and enforces best practices across your Drupal site-building workflow.