Provide a "node type" views default argument

Created on 24 January 2024, 5 months ago
Updated 25 January 2024, 5 months ago

Hello,

I'd like to make a feature request for views module.

Problem/Motivation

Sometimes users might need to filter on current node's type (aka content type).

Steps to reproduce

Create a reference field on a node type (field_node_type)
Create a view of anything you'd like
Add an argument based on field_node_type

Now you can't provide content type from URL, such as "Content ID from URL"

Proposed resolution

Add a ViewsArgumentDefault plugin.
This plugin is exactly the same as Content ID from URL, but will return the content type machine name instead of the ID.

✨ Feature request
Status

Closed: works as designed

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated less than a minute ago

Created by

πŸ‡§πŸ‡ͺBelgium Ludo.R Brussels

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024