Questions tagged [taxonomy-terms]
"Taxonomy" refers to Drupal's content classification mechanism, organised into vocabularies and terms.
3,633
questions
0
votes
1
answer
25
views
Allow certain user role to add tags
I have added a taxonomy entity reference on a node. I want users of certain roles to only select from the list and not allow them to create a new one.
A user role A to select from the list or add a ...
0
votes
0
answers
45
views
403 when trying to retrieve data via the JSON:API
I'm trying to find all taxonomy terms, where one field IS NULL via the JSON API.
So I'm testing to retrieve a node via the name and it works without any issues:
/jsonapi/taxonomy_term/tax?filter[title-...
0
votes
0
answers
32
views
View media with group permissions
I have a file media type and these files will be private files, with different access levels (1, 2 etc).
What I need
View page only for registered users, if the user has granted access level 1, the ...
0
votes
1
answer
17
views
Hide date field on taxonomy page
How do I hide this date field on this page? The page is a taxonomy term, not a node.
Under Manage Display, I've set Taxonomy Post Date to "Visually Hidden" but it persists.
1
vote
2
answers
107
views
Remove an item from list of taxonomy terms based on the value of a Boolean field
I have set up terms for a taxonomy vocabulary ("User Group"). Each taxonomy term has a field "Hide from selection", which defaults to False.
When rendering the widget (as a ...
0
votes
1
answer
33
views
How to hide terms from entity reference field on node form
I've been searching quite a bit on this already and was not able to find a solution.
installation is d10
So on my node I have an entity reference field which is showing Taxonomy terms. Two of those ...
0
votes
0
answers
35
views
Inline Entity Form - is it possible to add field from child entity's taxonomy reference field
I have the below structure on my Drupal 9 site:
Product content type
-- field_product_integration (references contents of type Integration)
Integration content type
-- field_product_feature (...
0
votes
1
answer
51
views
How to render the image or several images in the table render element?
I have a form. In the last step of the form, I display in the table what was saved in the fields in the previous steps.
Where there is a comment in the code, I need to render the all images from the $...
0
votes
0
answers
43
views
Alphabetically sorting by taxonomy name
I have a content type with a taxonomy term entity reference tagged to it. I am trying to make a view that lists all nodes of this content type but I want the sorting to be alphabetical based on the ...
0
votes
1
answer
132
views
How can I change the label of the title field "Name" of my taxonomy?
I want to customize the title label of my taxonomy, the name field. By default, its value is "Name".
I know I can use the mymodule_form_alter hook and do as followed:
$form['title']['widget']...
1
vote
1
answer
41
views
How to access the node/term field-values in a cleaner way?
My code is filled with methods like these to access field values:
\Drupal::entityTypeManager()->getStorage('node')->get('field_name')->getValue()[0]['value'];
\Drupal\taxonomy\Entity\Term::...
0
votes
1
answer
40
views
is it posible to get the value of other fields right inside the buildForm() method without having to save configuration?
I have a config form with two select fields. The first one(vocabulary) gets populated automatically without problems with options taken from the available vocabularies for users to pick up one. The ...
0
votes
1
answer
42
views
"Most popular" tags of the day
How can I create a list of the most popular tags of the day, based on the actual date, using view?
The most voted answer for Most popular tags in a list as a block helped me to set a list of the "...
0
votes
0
answers
16
views
target separate fields of my taxonomy term in my view using twig
I have a view displaying taxonomy terms as fields by making use of a responsive grid. I have a twig file based on views-view-grid-responsive.html.twig.
in this twig file there is a loop {% for item in ...
0
votes
0
answers
25
views
Responsive Background Image offers theme code for paragraphs, but I need it in taxonomy
Responsive Background Image module offers theme code for paragraphs, but I need it in taxonomy. Taxonomy is a little different in that it is an array inside of an array. How do I change this code to ...
1
vote
0
answers
29
views
Excluding some taxonomy terms from a view when grouped by taxonomy
For node type 'people' I have tags A, B, C etc. Some people have multiple tags.
On my view I'm grouping them by taxonomy term and selecting A,B,C,D etc under 'Select terms from vocabulary People type' ...
0
votes
1
answer
98
views
Creating taxonomy terms via REST API using POST: proper formatting of json?
On Drupal 9.4 here and I want to create taxonomy terms via the api. Is there a good example of what I need to POST to an API end point?
0
votes
1
answer
24
views
Override a field in a taxonomy terms view
I have a taxonomy terms view, filtered by a vocabulary. I would like to add the dashes before the term name like in the Parent terms field on the edit term page. The code in TermForm.php does that ...
1
vote
1
answer
122
views
Get the value of taxonomy custom user field
I am trying to get a taxonomy field in hook_user_insert().
The logic is that if the taxonomy field is selected as none then print warning message along with a success message.
function ...
1
vote
2
answers
130
views
Migration entity_lookup not picking up repeating taxonomy terms
Background:
I am creating new articles in Drupal 9.5 from a source database using the Migrate API. The articles optionally have references to one or more taxonomy terms. I have already created the ...
0
votes
0
answers
15
views
Menu from Views page display using contextual filter taxonomy term
Classified ads site here, Drupal 10.0.7
I have a View page display showing fields from nodes using Taxonomy Term Id as Contextual Filter.
So if the URL reads "[domain]/clasificados/8" it ...
0
votes
0
answers
25
views
Show Siblings via Views and taxonomy term in a block (again)
I've got a
D9 site
with an Event content type and a reference to the
place taxonomy term
In the taxonomy term, there is a field zip_code.
The taxonomy terms are setup in a hierachy:
State 1
County ...
2
votes
0
answers
43
views
How to group taxonomy terms by depth in views?
my example taxonomy looks like this:
- fruit
-- apple
-- orange
-- banana
- vegetable
-- carrot
-- cabbage
i want to render a page in views that groups level 1 terms by their parent term, The ...
0
votes
1
answer
26
views
Unable to update node entity fields using custom form
There is a certain content type, in which there is a field to enter a node or taxonomy.
I want to create a new node for that content type using a custom form and register the node or taxonomy in the ...
0
votes
1
answer
87
views
Error when trying to retrieve a term with ajax
We are creating a custom form to edit a certain node.
We do this above because there are some things that cannot be accomplished with the default form.
I want to use AJAX to populate the fields of the ...
0
votes
1
answer
121
views
Creating a Custom Content Listing Page based on specific content type or taxonomy terms selected in the node
I am trying to create a content type that generates a list of content/nodes based on other content type or taxonomy terms selected within that node in the content type. I have a general content type ...
0
votes
0
answers
30
views
Report comments / Workflow
I am trying to implement a functionality that would allow authenticated users to report comments on a forum post. My first thought was to do it using workflows but comments dont have a workflow ...
0
votes
0
answers
54
views
Save multiple taxonomy terms in migration from array of tids
I'm having some issues with storing multiple taxonomy terms in a field as part of a migration.
I've created a custom plugin get_colors that returns an array of existing tids. A custom process plugin ...
0
votes
0
answers
41
views
How to show content / blocks in views for path component 3, 2 OR 1?
The taxonomy contains mostly 3 levels, sometimes two levels only.
Parent
Child 1
Grandchild 1
Child 2
Via path alias, the patterns create URLs like:
/parent/child1/grandchild1
/parent/child2
...
0
votes
1
answer
22
views
Auto assign term to node from term field from user
I have a term field called "Organization" on both Content and User entities.
On the Content entity, the field for Organization is hidden.
For the user, they select a value for Organization.
...
0
votes
1
answer
320
views
Get taxonomy and check if published?
I am trying to display taxonomy programitcally.
The problem is, all taxonomy is displayed whther published all not. How can I filter only published taxonomy.
I use this code to get taxonomy.
$tree = \...
0
votes
0
answers
39
views
Use exposed filter "Has taxonomy term (with depth)" for a specific field and not the all the content
My content type has 2 fields related to the same hierarchical taxonomy.
How can I expose a view filter that allows a search "with depth" on only one of these fields and not on all the ...
0
votes
0
answers
15
views
Show List of Custom Blocks with same referenced term as the term on it's term landing page
I have a term which itself has a reference field for taxonomy terms. On the term's landing page, I would like to include a view (block), that shows custom blocks with the same referenced term (I did ...
0
votes
0
answers
106
views
How to render a Taxonomy Term in twig without the term name?
For some reason, I am writing my own controller that needs to include a taxonomy term.
I want to render everything of a taxonomy term (except the name / title) in the template I wrote.
My controller ...
1
vote
1
answer
183
views
Sort nodes by weight of taxonomy term attached to field
In a query for nodes I'm trying to sort the nodes by the weight of a taxonomy term attached to one of the node fields.
Here is how my query is built
$node_storage = \Drupal::entityTypeManager()
...
1
vote
0
answers
27
views
How can I find all the nodes that use a hierarchical vocabulary taxonomy term and reference a child term but not its parent term
I am using Drupal 7.
I have a content type "Public Resource" that uses a hierarchical vocabulary called "Resource Topics" that has up to 3 levels (parent->child->child of ...
1
vote
1
answer
874
views
How to retrieve all taxonomy term using json api
I want to retrieve all taxonomy term name using json api.
I have tried:
http://local-tes/jsonapi/taxonomy_term/specialties
but its only return 50 values, I want to fetch all taxonomy terms values.
1
vote
1
answer
30
views
Avoid group of revisions history view duplication
My taxonomy View lists all revisions grouping by different columns, by adding revision fields for each value, and get the filter "published" removed.
The only filter is: city name (not null)....
0
votes
0
answers
33
views
Views: How to filter content by taxonomy terms that are not selected?
I have a view of a specific content type that can be filtered by two different taxonomies A and B. Some nodes that have the taxonomy term A1 also have the term B5. Now when I filter only by the term ...
1
vote
1
answer
75
views
How can I add term's vocabulary name as body class?
I already had following codes added, which adds term ID as body class. However, how can I change the ID to term's vocabulary name?
For example:
<body class="term-type-cameras">
/**
*...
2
votes
0
answers
358
views
How do I add a query condition to the QueryPluginBase in hook_views_query_alter()?
Using hook_views_query_alter() for a view configured as a REST feed, I'm attempting to add an additional filter value to the query, based on the presence of multiple filters passed via the URL.
I need ...
0
votes
1
answer
38
views
Sub category wrongly classified to root level and cannot be rectified
I am using SHS (Simple hierarchical select) which allows the user to create the child term under the parent term by themselves. For example:
root
--Canon (parent level)
----5D3 (child level)
When I ...
1
vote
1
answer
80
views
Create vocabularies with the JSON API
I found this identical question but it seems to be dead and none of the answers help me. I also don't have enough reputation to ask in a comment, so, since I'm at the end of my rope with this issue, I'...
0
votes
1
answer
46
views
How can I show child categories in the parent category page?
I have created a new vocabulary with some extra fields and these taxonomy terms.
Parent 1
Child 1.1
Child 1.2
Child 1.3
Parent 2
Child 2.1
Child 2.2
Child 2.3
Parent 3
Parent 4
Parent 5
In the ...
0
votes
1
answer
27
views
How to differentiate the state when a contextual filter is applied?
Hello to all the Drupal community. I've recently faced a challenge to visually modify some parts of my view's template for the state when its contextual filter is applied. Some details are as follows:
...
0
votes
1
answer
63
views
Sort views by number of related tags
I want to create a view block with related content based on shared terms. For this I created a term reference field inside the content type and created a views where I use a contextual filter Taxonomy ...
0
votes
1
answer
42
views
How do I get the value of the Taxonomy Term Description after loading Taxonomy Vocabulary term by Term ID?
What would be the best way to render the Taxonomy Vocabulary Term description value? I can render the term id and label/title, but the description seems to need something else that I'm not quite ...
-1
votes
1
answer
163
views
Why is node save extremely slow with two or more tags after migrating tags and restoring from backup?
The problem
Saving a node with one tag saves normally. With two or more, the save takes upwards of 40 seconds.
The problem only occurs after migrating in a set of tags from csv, then creating a ...
-1
votes
2
answers
185
views
Creating a category page when using the Search API module
I’m trying to build a Drupal Commerce store which is going to be my first timer with Drupal 8+. However, the approach described in the Drupal Commerce documentation regarding the creation of a ...
-1
votes
1
answer
114
views
Create Vocabularies and Terms with the JSON:API module
I am using the JSON:API module.
I need to create vocabularies and terms through the endpoint, but it is only accepting GET requests.
Am I using the wrong route or endpoint?