npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tunghtml/strapi-plugin-filtered-relation

v1.1.3

Published

A Strapi custom field plugin for displaying filtered relations with dynamic placeholder support and status change capability

Readme

Strapi Plugin Filtered Relation

A Strapi 5 custom field plugin for displaying filtered relations with dynamic placeholder support and status change capability.

Features

  • Display filtered relations based on field values
  • Support dynamic placeholders (e.g., {{documentId}})
  • Change status directly from the relation list via dropdown
  • Auto-refresh when status changes
  • Fully configurable and reusable

Installation

Local Development

This plugin is currently being used as a local plugin. It's located in backend/src/plugins/filtered-relation.

NPM Package (for publishing)

npm install @tunghtml/strapi-plugin-filtered-relation
# or
yarn add @tunghtml/strapi-plugin-filtered-relation

Configuration

Add to config/plugins.js:

module.exports = {
  "filtered-relation": {
    enabled: true,
    resolve: "./src/plugins/filtered-relation", // for local plugin
  },
};

Usage

Schema Configuration

Add the custom field to your content type schema:

{
  "pendingInvestors": {
    "type": "customField",
    "customField": "plugin::filtered-relation.filtered-relation",
    "options": {
      "displayField": "investors",
      "targetModel": "Meeting Participation Status",
      "filterField1": "participantStatus",
      "filterValue1": "Pending",
      "filterField2": "meeting.documentId",
      "filterValue2": "{{documentId}}",
      "statusField": "participantStatus"
    }
  }
}

Options

| Option | Type | Required | Description | | -------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | displayField | string | Yes | The relation field name to display from target model (e.g., "investors") | | targetModel | string | Yes | Target collection display name (e.g., "Meeting Participation Status"). Will auto-convert to API ID format. | | filterField1 | string | Yes | First filter field name (e.g., "participantStatus") | | filterValue1 | string | Yes | First filter value (e.g., "Pending"). Supports {{documentId}} placeholder for current entity. | | filterField2 | string | No | Second filter field name (e.g., "meeting.documentId") for additional filtering | | filterValue2 | string | No | Second filter value. Supports {{documentId}} placeholder. | | statusField | string | No | Field name for status dropdown (e.g., "participantStatus"). When configured, enables status change feature with dropdown. Must be an enum field in target model. |

Status Change Feature

When statusField is configured, a dropdown appears at the end of each item allowing quick status changes.

Requirements:

  • statusField must be an enum field in the target model
  • Target model must have records for each status value
  • All records must be linked to the same parent entity (via filterField2)

How it works:

  1. Dropdown shows current status and all available enum options (fetched from schema)
  2. User selects a new status
  3. Plugin automatically:
    • Removes the item from current status record (disconnect)
    • Adds the item to target status record (connect)
    • Refreshes all filtered relation fields on the page
  4. No page reload needed - all lists update automatically via custom events

Example Use Case

For a Meeting with multiple investor status lists (Pending, Accepted, Rejected, etc.):

  1. Each list shows investors filtered by their participation status
  2. Click the dropdown on any investor to change their status
  3. The investor automatically moves to the appropriate list
  4. All lists refresh to reflect the change

Version

Current version: 1.1.0

License

MIT