Skip to content

Views Agent — example prompts

Every prompt below was run against a live site through ddev drush agent views_agent and produced the expected View configuration. This file is the curated result, kept short on purpose. Use plain language - the agent handles the technical translation for you.

Quick start

Create a view of published articles, sorted newest first, showing just the title.

Fully explicit (when you want to specify everything up front)

Create an entity type node listing view with the default display, title field with label Title, sort in descending order by created date, filter by published status 1, and filter by type article.

Viewing configuration

  • "List all views on the site."
  • "What displays does the node_article_listing view have?"

Creating views

  • "Create a user directory view based on the users table."
  • "Set up a taxonomy term listing view."

Adding displays

  • "Add a page display to the node_article_listing view at /articles with the title 'Articles'."
  • "Add a block display to the node_article_listing view."

Displays are referred to by their exact machine name once created (page_1, block_1, not "the page display") — the agent will tell you the ID it assigned when it creates one, and can list existing ones if you ask.

Adding fields, filters, and sorts

  • "Add the title and created date fields to the node_article_listing view."
  • "Add a published status filter to only show published content."
  • "Add a sort by created date, descending."
  • "Add a contextual filter for content type."
  • "Add a relationship to the author field."
  • "Add the author's email address as a field on the page_1 display, using a relationship to the user account." Name the display explicitly — a field added to default without naming a display may not appear on a page display whose own fields have already been configured separately.
  • "Add a field showing the name of the tags referenced by each article, using a relationship to the taxonomy term."

Configuring display settings

  • "Set the node_article_listing view to show 5 items per page with a full pager."
  • "Change access on the node_article_listing view to require the authenticated role."
  • "Turn off caching on the node_article_listing view."
  • "Set the style to a table" / "Set the style to a grid with 3 columns."
  • "Render the full teaser view of each item instead of individual fields."
  • "Add the CSS class 'featured-articles' to the page display."
  • "Add a 'View all' more link below the results, pointing to the page display."
  • "Disable the page display without deleting it."

Exposed filters

  • "Expose the status filter so visitors can filter by it, with the label 'Published'."

Admin views

  • "Create an admin content listing view with a bulk operations column, an operations column, and access limited to the 'access content overview' permission."
  • "Make the page display use the admin theme."

Feed displays

  • "Add a feed display to the node_article_listing view at articles-feed.xml, using the node_rss row style with the rss view mode."

Attachment displays

  • "Add an attachment display to the node_article_listing view that attaches before the page_1 display." Name the exact target display ID if the view has more than one of the same type — see "Viewing configuration" above to confirm it first.

Handler management

  • "Update the title field label to 'Article Title'."
  • "Remove the type filter from the node_article_listing view."

What it will refuse to do

  • Deleting a View. It gives you the direct Views UI delete link (/admin/structure/views/view/<view_id>/delete) to do it yourself instead, or ask to disable/empty it instead.
  • Changing an existing View's base table (entity type). Create a new View with the right base table instead.

Complete setup, one prompt

Create a blog listing page at /blog showing articles with title, image, summary, author, and date, sorted by newest first with a pager.