PHPackages                             drunomics/contextual\_views - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. drunomics/contextual\_views

ActiveDrupal-module

drunomics/contextual\_views
===========================

Provides contextual views blocks.

1.0.5(4y ago)011.0kPHP

Since Mar 10Pushed 2y agoCompare

[ Source](https://github.com/drunomics/contextual_views)[ Packagist](https://packagist.org/packages/drunomics/contextual_views)[ RSS](/packages/drunomics-contextual-views/feed)WikiDiscussions 8.x-1.x Synced 1mo ago

READMEChangelogDependenciesVersions (8)Used By (0)

Contextual Views
================

[](#contextual-views)

Drupal module that provides contextual views blocks.

- Project homepage: [https://www.drupal.org/project/contextual\_views](https://www.drupal.org/project/contextual_views)

Composer
--------

[](#composer)

- It's suggested to install the module via composer:

    `composer require drunomics/contextual_views`

    The module is also available as `drupal/contextual_views` via the drupal.org release system, however only `drunomics/contextual_views` gets patch level releases. This is as drupal.org does not support semantic versioning for modules yet.

Installation
------------

[](#installation)

Install as usual, see for further information.

Usage instructions
------------------

[](#usage-instructions)

- Define a block plugin with the same plugin ID as used automatically. E.g. `views_block:news-news_by_channel` . The pattern is `views_block:{{ view }}-{{ display }}`. This way the defined class will be used automatically instead of the default one.
- Extend the class `Drupal\contextual_views\Plugin\Block\ContextualViewsBlock`
- Define the necessary context on the plugin using annotations, e.g. the node context.
- Alter the block form to add additional config as needed, e.g. a textfield that contains the name of the field holding the term reference.
- Override build(), get the context value (e.g. the node), derive the views argument (the taxonomy term) from the context and set it on the view as argument using `$view->setArguments()`. Then call the parent build.

A complete code example for the described block can be viewed here:

Todos
-----

[](#todos)

- Write more documentation
- Provide a configuration form for satisfying views context based upon available block context.

Contributing
------------

[](#contributing)

Always use the [Module issue queue](https://www.drupal.org/project/issues/contextual_views).

Development happens on GitHub using the pull request model: in case you are not familiar with that, please take a few minutes to read the [GitHub article](https://help.github.com/articles/using-pull-requests) on using pull requests.

There are a few conventions that should be followed when contributing:

- Always create an issue in the [drupal.org issue queue](https://www.drupal.org/project/issues/contextual_views)for every pull request you are working on.
- Always cross-reference the Issue in the Pull Request and the Pull Request in the issue.
- Always create a new branch for every pull request: its name should contain a brief summary of the ticket and its issue id, e.g **readme-2276369**.
- Try to keep the history of your pull request as clean as possible by squashing your commits: you can look at the [Symfony documentation](http://symfony.com/doc/current/cmf/contributing/commits.html)or at the [Git book](http://git-scm.com/book/en/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages)for more information on how to do that.

For further information on how to contribute please refer to [the documentation](https://www.drupal.org/contribute/development/).

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~320 days

Recently: every ~400 days

Total

6

Last Release

1745d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/132232?v=4)[Wolfgang Ziegler](/maintainers/fago)[@fago](https://github.com/fago)

---

Top Contributors

[![fago](https://avatars.githubusercontent.com/u/132232?v=4)](https://github.com/fago "fago (13 commits)")[![mbm80](https://avatars.githubusercontent.com/u/19147241?v=4)](https://github.com/mbm80 "mbm80 (1 commits)")

### Embed Badge

![Health badge](/badges/drunomics-contextual-views/health.svg)

```
[![Health](https://phpackages.com/badges/drunomics-contextual-views/health.svg)](https://phpackages.com/packages/drunomics-contextual-views)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
