drupal-module termstatus
This module adds a status-flag to taxonomy terms. Using this flag it is possible to specify whether terms should be published or not. Users with the appropriate permission may access unpublished terms.
nelson-ph/termstatus
This module adds a status-flag to taxonomy terms. Using this flag it is possible to specify whether terms should be published or not. Users with the appropriate permission may access unpublished terms.
- Monday, April 30, 2018
- by nelson-ph
- Repository
- 0 Watchers
- 0 Stars
- 2 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 1 Versions
- 0 % Grown
Taxonomy Term Status
This module adds a status-flag to taxonomy terms. Using this flag it is
possible to specify whether terms should be published or not. Users with the
appropriate permission may access unpublished terms., (*1)
Installation
composer require nelson-ph/termstatus
- Enable the module. In the admin UI, it is listed under Taxonomy Term Status package.
- Set appropriate permissions, existing roles are granted view permissions to keep the core logic.
Usage
After installation a Published field is added to all Terms, which controls the access to Term pages., (*2)
Since the module extends the Term entity class by using the TermWithStatus class for taxonomy_term entity in the hook_entity_type_build() hook, you also need to change all instanceof() checks from \Drupal\taxonomy\Entity\Term to \Drupal\termstatus\Entity\TermWithStatus., (*3)
The extension is done to allow usage of isPublished and get/set methods for the status field, but the extension also keeps all the core logic the Term entity has or will ever have. This is because the extended class does not provide any additional annotations and relies solely on the original Term entity class to be built., (*4)
To do
- Vocabulary settings to set default state for the terms.
- ~~Update Term entity to allow usage of isPublished().~~
- On /admin/structure/taxonomy/manage/{vid}/overview page display the terms status.
- ~~Add views field support.~~
dev-8.x-1.x
dev-8.x-1.x
https://github.com/nelson-ph/D8-termstatus
This module adds a status-flag to taxonomy terms. Using this flag it is possible to specify whether terms should be published or not. Users with the appropriate permission may access unpublished terms.
Sources
Download
MIT
The Development Requires
by
Nelson PIRES HASSANALI