New answers tagged

0

There are two parts to this question: getting the Contextual filtering to reduce the results to only the term IDs you specify in the URL, and using Aggregation for counting and sorting the results according to that count. Contextual filter for Taxonomy term ID Create your Views list of nodes with the Taxonomy reference field showing the tags, and ...


0

You need to look at creating views you can start by watching as many as the following to get the idea: https://www.google.com/search?q=drupal+8+how+to+create+a+view&source=lnms&tbm=vid


0

Taxonomy is hierarchical by nature, you can create category/sub stuff in it. AFAIK, there is not any field widget as you describe in drupal core with taxonomy field. Maybe some contrib module (have a look at term_reference_fancytree ). You also may define your own and generate a field widget dedicated to taxonomy.


0

Instead of using unset(), you can use #access = FALSE, like this: $build['field_terms'][0]['#access'] = FALSE;


0

If you want to group Assets just by the Campaign (taxonomy) image, you can easily set the Grouping feature under Format to the Image field. You have to add the Relationship for the taxonomy field first, as you have found out, then you get all the information related to the referenced taxonomy term into the Views. Without that Relationship you only have the ...


2

The entities aren't loaded by default (for performance reasons), but TermStorage::loadTree takes a $load_entities parameter: If TRUE, a full entity load will occur on the term objects. Otherwise they are partial objects queried directly from the {taxonomy_term_data} table to save execution time and memory consumption when listing large numbers of terms. ...


0

Change the Color to color in ['target_bundles' => ['Color' => 'Color']]) if you create a vocabulary caller Color the machine name will be color Not Color So try with: $fields['color'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Color')) ->setDescription(t('The color of the fruit.')) ->setSetting('...


0

You need to copy existing views-view-unformatted.html.twig file from views module directory core/modules/views/templates/views-view-unformatted.html.twig (As You already did) Then You need to Add Field From (Taxonomy Term) View in order to get that field's value in your twig's {{ row }} variable


Top 50 recent answers are included