#Views

Tips

Validate views contextual filter to provide as block config

Views lets you configure the default value for a contextual argument.

We often might use the content id from url, for example.

This will work automatically if the block is placed on a node page that is intended to be the contextual argument.

Quickly create content with Views Add Button and Admin Dialogs

Views lets you create pages that list content, but doesn't provide a way to add new items to the list.

Here's how to add a button to the top to create any content entity.

  1. Install the Views Add Button and Admin Dialogs modules.
  2. Set up a view, add an Entity add button to the header.
  3. For Node content, select the type, and pick ViewAddButtonNode for the rendering and access plugin.
  4. Customize additional settings if needed, like the button text or class.

Now your view should have a button that links to the entity add form.