netcore / module-category
Module for category management
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 1 162
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 7
Forks: 0
Language:CSS
Type:module
Requires
- php: >=7.0
- cviebrock/eloquent-sluggable: ^4.3
- kalnoy/nestedset: ^4.2
- dev-master
- 1.1.x-dev
- v1.1.1
- v1.1.0
- 1.0.x-dev
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- 0.1.x-dev
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/qs-6.3.3
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/follow-redirects-1.14.8
- dev-dependabot/npm_and_yarn/chownr-1.1.4
- dev-dependabot/npm_and_yarn/marked-0.3.19
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/tar-2.2.2
- dev-dependabot/npm_and_yarn/set-getter-0.1.1
- dev-dependabot/npm_and_yarn/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/lodash-4.17.21
- dev-dependabot/npm_and_yarn/y18n-3.2.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/axios-0.21.1
- dev-dependabot/npm_and_yarn/ini-1.3.7
- dev-dependabot/npm_and_yarn/http-proxy-1.18.1
- dev-dependabot/npm_and_yarn/node-sass-4.14.1
- dev-dependabot/npm_and_yarn/lodash.mergewith-4.6.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.3
- dev-dependabot/npm_and_yarn/lodash-4.17.19
- dev-dependabot/npm_and_yarn/websocket-extensions-0.1.4
- dev-dependabot/npm_and_yarn/jquery-3.5.0
This package is not auto-updated.
Last update: 2024-08-18 03:45:04 UTC
README
This module was made for easy management of categories.
Features
- Everything is translatable
- Each category has slug, manual slugs are allowed
- Drag'n'drop support for reordering
Pre-installation
This module is part of Netcore CMS ecosystem and is only functional in a project that has following packages installed:
- https://github.com/netcore/netcore
- https://github.com/netcore/module-admin
- https://github.com/netcore/module-translate
Installation
- Require this package using composer
composer require netcore/module-category
- Publish assets/configuration/migrations
php artisan module:publish Category
php artisan module:publish-config Category
php artisan module:publish-migration Category
php artisan migrate
Configuration
- Configuration file is available at config/netcore/module-category.php
Category groups
- Category groups are not editable from admin control panel. You should seed them.
// DatabaseSeeder.php: // For select2 type, you should create presenter first, read below about presenters. CategoryGroup::create([ 'key' => 'advertisment', 'title' => 'Advertisement categories', 'has_icons' => true, 'icons_for_only_roots' => true, 'icons_type' => 'select2', 'icons_presenter_class' => \App\Icons\ClassifiedIconsPresenter::class, 'levels' => 3, ]); CategoryGroup::create([ 'key' => 'forum', 'title' => 'Forum categories', 'has_icons' => true, 'icons_for_only_roots' => true, 'icons_type' => 'file', 'levels' => null, // no limit ]);
Icon set
- Create icons presenter. It should implement \Modules\Category\Icons\IconSetInterface
use Modules\Category\Icons\IconSetInterface; class CustomIconSet implements IconSetInterface { /** * Get array of available icons * * @return array */ public function getIcons(): array { return [ // Class => Text 'my-icon-1' => 'My Icon 1', 'my-icon-2' => 'My Icon 2' ]; } /** * Get template for select2 render * * @return string */ public function getSelect2Template(): string { return '<i class="::class::"></i><span>::text::</span>'; } /** * Get styles to inject * * @return array */ public function getInjectableStyles(): array { return [ '/link/to/your/css/style.css' ]; } /** * Get sprite to inject before container * * @return string */ public function getInjectableSprite(): string { return ''; // this is needed when using SVG icons. ex.: return view('svg/sprite')->render(); } }