elitedivision/amos-tag
Sistema AMOS per le TAG
Requires
- php:>=5.4.0
- elitedivision/amos-core:~1.9
- elitedivision/amos-admin:>=1.8
- elitedivision/amos-dashboard:~1.5
- elitedivision/amos-layout:^1.11.1
- creocoder/yii2-nested-sets:0.9.*
- lispa/yii2-tree-manager:~2.0.0
Requires (Dev)
- yiisoft/yii2-faker:*
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-master
- 1.10.0
- 1.9.0
- 1.8.1
- 1.8.0
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.12
- 1.4.11
- 1.4.10
- 1.4.9
- 1.4.8
- 1.4.7
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.6
- 1.3.5
- 1.3.4.x-dev
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1.x-dev
- 1.3.0.x-dev
- 1.2.x-dev
- 1.2.0
- 1.1.0
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-test/1.13.0/1
- dev-test/1.12.1/1
- dev-gianluca/1.12.1/2
- dev-gianluca/1.12.1/1
- dev-fabiano/1.13.0/1
- dev-fabiano/1.11.3/1
- dev-gianluca/1.11.3/tag_light
- dev-test/1.11.3/1
- dev-test/1.11.2/1
- dev-test/1.11.1/1
- dev-gianluca/1.11.0/1
- dev-gianluca/1.6.0/1
- dev-test/1.11.0/1
- dev-fabiano/1.10.0/1
- dev-la_francesca/1.10.1
- dev-test/1.10.0/1
- dev-prova_merge_ajax
- dev-la_francesca/tag_ajax
- dev-test/1.9.0/1
- dev-scarface/digiteca/1.7.1/2
- dev-risorsecomuni/1.6.0
- dev-gianluca/1.7.1/2
- dev-test/1.8.1/3
- dev-intranet_aria/1.6.0/1
- dev-test/1.8.1/1
- dev-stefan/test/1.8.0/1
- dev-test/1.7.1/2
- dev-stefan/test/1.6.0
- dev-test/1.6.1/1
- dev-scarface/ia_1.8.0/1
- dev-scarface/comune_ferrara_170
- dev-gianluca/1.7.0/1
- dev-test/1.7.1/1
- dev-stefano_1_8_0_1
- dev-test/1.8.0/1
- dev-test/1.7.0
- dev-dof/befe
- dev-fabiot
- dev-test/1.6.0
- dev-la_francesca/wizard_eventi
- dev-open20/1.4.11/1
- dev-test/1.5.0
- dev-riccardo/wizard_eventi
- dev-stefano/refactor_cwh
- dev-la_francesca/refactor_cwh
- dev-riccardo/1.4.10/1
- dev-test/1.4.11/1
- dev-test/1.4.10/1
- dev-dashboard_fullsize
- dev-POI_TEST/1.4.10/1
- dev-POI
- dev-POI_community_fullsize
- dev-cruscotto_lavoro
- dev-rete_comuni
- dev-arca/1.4.9/2
- dev-test/1.4.9/2
- dev-la_francesca/1.4.9/1
- dev-test/1.4.9/1
- dev-test/1.4.8/1
- dev-la_francesca/1.4.8/1
- dev-DEPLOY_POI_20180921
- dev-test/1.4.7/1
- dev-cinzia
- dev-DEPLOY_POI_20180702
- dev-test/1.4.6/1
- dev-test/1.4.5/1
- dev-riccardo/1.4.4/3
- dev-la_francesca/1.4.4/3
- dev-test/1.4.4/3
- dev-simonem/1.4.4/change-request-4
- dev-test/1.4.4/2
- dev-test/1.4.4/1
- dev-riccardo-CR4/1.4.3/1
- dev-test/1.4.3/1
- dev-test/1.4.1/1
- dev-test/1.4/7
- dev-pivanti
- dev-test/1.4/2
- dev-test/1.4/6
- dev-enrica/amos-layout
- dev-test/1.4/5
- dev-test/1.4/4
- dev-test/1.4/3
- dev-security
- dev-test/1.4/1
- dev-test/1.3.6/1
- dev-Matteo_1.3.6.1
- dev-la_francesca_1.3.6
- dev-enrica_1.3.4
- dev-pivanti_1.3
- dev-fabiot_1.3.1
- dev-simone_1.3.0
- dev-import_rudy
- dev-Grafica
README
Extension for tags and interest areas.
Installation
- The preferred way to install this extension is through composer.
Either run
composer require elitedivision/amos-tag
or add this row
"elitedivision/amos-tag": "dev-master"
to the require section of your composer.json
file.
Add module to your main config in backend:
`
php'modules' => [
'tag' => [ 'class' => 'elitedivision\amos\tag\AmosTag', 'modelsEnabled' => [ /** * Add here the classnames of the models for whose you want to enable tags * (i.e. 'elitedivision\amos\news\models\News') */ ] ],
],
`
To enable user-profile interest areas (tags to match with content tags), amos-cwh installation is needed
Apply migrations
a. amos-tag migrations
`
bash php yii migrate/up --migrationPath=@vendor/elitedivision/amos-tag/src/migrations`
or add this row to your migrations config in console:
`
php return [. . . '@vendor/elitedivision/amos-tag/src/migrations', . . .
];
`
Configuration
Tag management is available for admin role - url PlatformUrl /tag/manager. In tag manager it is possible to:
- To add new trees or tags
- enable tag trees (by root selection) for specific models - to all roles (rbac) or to the specified ones
- change tree settings eg. root visible will allow the user to select all tags by root in TagWidget (see below)
Widgets
Amos Tag provides two Widgets:
- TagWidget elitedivision\amos\tag\widgets\TagWidget
Draws tag tree to select values for a model. example of use in a form:echo elitedivision\amos\tag\widgets\TagWidget::widget([ 'model' => $model, 'attribute' => 'tagValues', 'form' => \yii\base\Widget::$stack[0], 'singleFixedTreeId' => $treeRoot, 'id' => 'third-tree', 'hideHeader' => true ]);
In a search form you can use the same widget with options :
$params = \Yii::$app->request->getQueryParams();
echo \elitedivision\amos\tag\widgets\TagWidget::widget([
'model' => $model,
'attribute' => 'tagValues',
'form' => $form,
'isSearch' => true,
'form_values' => isset($params[$model->formName()]['tagValues']) ? $params[$model->formName()]['tagValues'] : []
]);
If singleFixedTreeId is not specified, all enabled trees for the $model are considered (table tag_models_auth_items_mm). singleFixedTreeId is now possible an array (tag roots in singleFixedTreeId will be considered).
- ShowTagsWidget elitedivision\amos\tag\widgets\ShowTagsWidget
Draws the selected tags for a model (in view mode). It is possible to specify a tree (property 'rootId') or a set of trees (property 'rootIdsArray') to show; if nothing is specified, all enabled trees for the model are considered. Example:
<?= \elitedivision\amos\tag\widgets\ShowTagsWidget::widget([
'model' => $model,
'rootId' => $rootId
]) ?>
```