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 🙏

© 2024 – Pkg Stats / Ryan Hefner

strapi-plugin-categorizer

v2.0.8

Published

A plugin that lets you categorize content quickly.

Downloads

44

Readme

Strapi plugin categorizer v.2

A plugin that lets you categorize content quickly.

categorizer

WARNING 2.0.X is ALPHA VERSION

From version 2.0.0 categorizer changes the npm package to strapi-plugin-categorizer, v2 not backward compatible to v1.

Installation

yarn add strapi-plugin-categorizer
yarn build

Guide

  1. Create your custom collection type. (Category)
  2. Add string field name
  3. Add relation hasOne to Category, name the relation field parent.
  4. Switch to content manager view, add your categories to collection:
  • if no parent assigned, - parent is null, this is a root
  • if category has parent, this is a leaf - a subcategory
  1. After you created your Categories structure, you have to add two fields to your target collection:
  • categories - hasMany relation to Categories
  • categoriesCategorizer - the categorizer field, that is going to be used to build relations
    • Name - categoriesCategorizer
    • target - categories
    • targetName - name
    • maxDepth - 4
  1. After you set up, you should be able to select relations based on your structure, when you hit save, you should get array of relations in categories field.

FEATURES

  • [x] supports multiple categorizer fields per collection
  • [x] supports user created collections
  • [x] feature: multiple categorizers on one target*
  • [x] feature: clear for categorizer dropdown
  • [ ] need validation for user entered configuration data

* multiple categorizers on one target - allows to target same relation field from more then one categorizer to handle case where you need additional categories, like Gifts or New.

About

categorizer is a kind of relation builder based on json created in custom field. The categorizer field would let you select filtered relations one by one, then in beforeCreate or beforeUpdate, those json would be used to build actual relations for categories field.

Collection that should have following structure:

 _______________________         _______________________         _______________________
|                       |       |                       |       |                       |
|        "root"         | ____\ |        "child"        | ____\ |    "childs child"     |
|     parent: null      |     / |     parent: "root"    |     / |    parent: "child"    |
|_______________________|       |_______________________|       |_______________________|

Requirements

This plugin tested with Strapi ^4.6.0

@strapi/strapi < 4.11.0 - [email protected] @strapi/strapi >= 4.11.0 - strapi-plugin-categorizer

The plugin will add:

  • Custom Field Categorizer
  • Lifecycle hooks for contentType that are going to target categorizer json fields.

NOTICE:

  1. Categories can have only one parent.
  2. Relations are not updated in Content Editor View if updated from lifecycle hook.
  3. It's recommended to hide or disable editing for field categories, since on every updated the relations would regenerate from categorizer.

The purpose of this is to be able to do that:

http://localhost:1337/api/cars?filters[categories][title][$eq]=sedan
P.S. This is developed in free time, and this is not magic, so be kind and use it wisely.