Questions tagged [taxonomy-terms]

"Taxonomy" refers to Drupal's content classification mechanism, organised into vocabularies and terms.

Filter by
Sorted by
Tagged with
4
votes
1answer
4k views

How to programatically access the value of a taxonomy term reference?

I have a taxonomy term reference field attached to my user account. I tried getting the value programatically in the same way as I get the value for text fields, but it doesn't work. use Drupal\Core\...
-1
votes
1answer
17 views

Show Taxonomy Terms that have been tagged on any piece of content

I have a content type and it allows for one taxonomy term to be tagged to it. I want to show that term on each nodes page. How can I do this with views Please?
1
vote
1answer
289 views

How to get count on how many times a term is used on a node

I'm about to create a Tag cloud module that shall have a block showing a list of all terms. The most used terms shall be in big text; the terms that not used often shall be in small text, as in the ...
0
votes
1answer
40 views

How to save/map uploaded image in term field of type image with storage location equals s3://

I'm having 1 field in a taxonomy = 'features' of type image. Image storage location is set to s3. I have written a hook_form_alter for form_id = article (article is the content type) where I have ...
2
votes
1answer
457 views

How get views advanced dynamic URL contextual filter to work with full taxonomy path?

I've tried all settings, with joint paths etc...but I just can't get the filter working properly, I know it's a settings thing, watched a whole bunch of videos but can't put my finger on it! This is ...
1
vote
1answer
343 views

How do I fill the authors name in a term reference field using Rules?

Content type stock contains the term reference field field_producer. What is the rule for Rules in order to fill this field with the node author name on creation? In detail The form looks like: -- ...
1
vote
1answer
1k views

Inline Entity Form validation

Created a content type and add taxonomy form in it using Inline entity Form module. So, the rendered taxonomy add term looks like : What I want to do is ADD CUSTOM VALIDATION to the "NAME" field. I ...
1
vote
1answer
538 views

How to enable free tagging? [closed]

I'm using Drupal 8 and I would like to allow free tagging my website. There should be a field on the node edit page for tags that the user can add new or existing tag(s) to the page. What field ...
0
votes
1answer
266 views

Customize autocomplete field to show children terms depending on another field

I have a taxonomy with 2 levels City1 -Park1 -Park2 -Park3 City2 -Park4 -Park5 -Park6 In my form, I created a field that links to this taxonomy with an autocomplete widget. I also have a second ...
0
votes
2answers
326 views

How do I validate the term title in hook_taxonomy_term_presave()?

How do I validate the term title in hook_taxonomy_term_presave()? Is there a way to proceed with the validations in hook_taxonomy_term_presave()? @Edit I rendered taxonomy add term form via "Inline ...
4
votes
3answers
2k views

How do I disable the taxonomy term page?

I would like to disable the taxonomy/term/1 page that list the nodes using that taxonomy term. I have found some modules for older Drupal versions, but I haven't found quite what I'm looking for in ...
0
votes
1answer
348 views

Remove items in taxonomy entity relation on node edit form

If a field on the node edit form is a entity relation to a taxonomy term vocabulary, I want the taxonomy terms be restricted on certain conditions. I don't know how to do it safely. I have tried it in ...
1
vote
1answer
53 views

access by term not working

I installed drupal 7, and ABT module. Created taxonomy vocabulary 'Proj' with terms 'proj1' 'proj2' added term ref 'Proj' field under Article cck added term ref 'Proj' field under Users (Account ...
1
vote
3answers
298 views

Allow role to edit node with same taxonomy term

I would like to allow a user to edit some node that have the same taxonomy term. I created a taxonomy for enterprise and I referenced it in a field of user profile. I used this taxonomy in a content ...
0
votes
2answers
1k views

How to get add term form of taxonomy inside node type form?

I'm trying to render taxonomy add term form inside content type ('article') add form. (node/add/article) In hook_form_alter, I called this callback function on abutton. public function ...
0
votes
1answer
85 views

How to use unique taxonomy term for nodes in Drupal 7?

I have unique categories assigned to nodes via taxonomy module. now I want the path to be something like this: root/taxonomy-vocabulary/taxonomy-term/node-titel Any ideas? This question has already ...
2
votes
2answers
794 views

How do I bulk delete taxonomy terms?

I'm looking for a way to delete about 1300 taxonomy terms (of 5250 in total) and their association with nodes. I firstly thought to delete the content of these tables: taxonomy_index ...
2
votes
1answer
961 views

Add Taxonomy ID class to the body tag (D8)

I have a taxonomy vocabulary whose various parents and children need to have different styles. I would need the tid of the every taxonomy page to appear as a class in the body tag in order to make CSS ...
2
votes
0answers
521 views

Tell taxonomy links to use route in custom module

I have a module where I created a route /page/tag/{term} that uses a controller for modifications to how the term page is handled. The problem is that when any page displays these term links, they ...
0
votes
1answer
323 views

How to remove target id from selected term reference field

While selecting taxonomy from autocomplete term reference field, its target id also get displayed. How to remove target id from display? In picture displayed, I want only 23456789 not bracket part i....
0
votes
1answer
279 views

Create taxonomy terms from content type field

I'm looking to add a taxonomy term to a vocabulary upon the creation of content type. For example I have a taxonomy vocabulary called "Widget Type". I have a content type of Product. When I create ...
2
votes
2answers
611 views

Json-Import of nodes with taxonomy terms

I'm running Drupal 8.3.6 and I try to import a json stream originating from typo3. It is essentially a list of blog posts in this format: [{ "id": "1", "title": "Title", "bodytext": "...
3
votes
1answer
347 views

Content, terms and user/author import or migration to D8 without custom module

How can I only import or simply migrate content (nodes), related terms and users/content-authors from a D7 project into a better structured D8 installation, which is similar to the old project, but ...
-1
votes
1answer
232 views

how give user based permissions for menu items?

i have 4 parent menu items for this i'm using superfish menu, how to give user based permissions to add a new page for particular parent menu only, example: menu item1(userrole1) --> for this ...
0
votes
1answer
1k views

how to solve Notice: Undefined offset: 1? [closed]

I used the following function to alter menu (hook_menu_alter) function _term_account(){ global $base_url; global $user; $account_id = custom_get_user_account_id(); $tesr = explode('_', arg(3))...
1
vote
2answers
1k views

How to add term programmatically in Paragraph field?

I have a paragraph with a taxonomy reference (autocomplete) field and I want to populate it when I create programmatically a pararagraph item. I checked the option "Create referenced entities if they ...
-2
votes
1answer
49 views

How do I redirect a controller to a particular vocabulary overview?

I want to redirect my controller to a specific vocabulary page. I redirect my controller using this code. use Drupal\Core\Url; public function importTypes() { $liste_types = $this->getListTypes(...
0
votes
1answer
163 views

How to display only some terms of a specific vocabulary in Views

I have a taxonomy vocabulary (Drupal 7) called "Categories", with 6 terms: a, b, c, d, e, f I can't see a way to create a view that will show just terms b, d, e (i.e. any sub-set of the full term ...
0
votes
1answer
79 views

hook_options_list not getting fired in a custom module

I need to limit taxonomy term reference field options based on another field.This is needed as there are around 1000 terms available for this 'Select' field but I want to limit these options to a ...
-1
votes
1answer
38 views

Taxonomy term name issue

$tree = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree('category'); var_dump(tree); the above snippet gives the following output: array (size=4) 0 => object(...
1
vote
1answer
260 views

Exporting menu along with code

I am new to Drupal 8, been developing only with D7 until now and I have a question regarding menus. I need to create this basic main menu for the page, but I am not sure how to export it and send to ...
-1
votes
2answers
410 views

Count node by taxonomy term

I want to build a statistical of ours projects inside my structure. I have a taxonomy term status with the terms ongoing, achieved, not rated and pending. An my content type have a relationship to ...
0
votes
1answer
975 views

How to add a base field for an entity reference to a specific vocabulary

I have an Entity: EntityX. It installs correctly and works the way that I want it to; with, of course, one exception. I want to attach an entity reference to a specific vocabulary. I have tried: ...
0
votes
0answers
29 views

How can I create search for one vocabulary?

I create taxonomy called Cities. And I create vocabulary for this Paris,Lyon and ... . How can I found for example "best day" search in search module for paris vocabulary When I'm in paris vocabulary ...
0
votes
1answer
21 views

How to tag content by users and filter the content in a view?

I have a content type Meeting Minutes. I'd like to tag users in the minutes. There will be a view to the list of minutes only for the logged in user. For example: Meeting 1, tags Peter, Mary Meeting ...
0
votes
0answers
83 views

How do I make a view of taxonomy terms with no spaces between lines (no Views HTML)?

I want to make a view to list 100 taxonomy terms like this: Term 1, Term 2, Term 3, Term 4, ... Term 100 I made a view of taxonomy terms. Here are the settings: Format: Unformatted list Settings: ...
0
votes
1answer
401 views

How to get content with their taxonomy term name and id?

Hello I have created content type product. I also add Taxonomy with name "category". I add field in with term reference in product content type. Now I want to get all content with taxonomy name and id ...
0
votes
1answer
42 views

How to make custom taxonomy pages per term based on fields?

I have a bunch of taxonomy terms, one for each county in a state. I am going to use the taxonomy pages as landing pages in a Google Adwords campaign that is customized per county. So, I have some ...
1
vote
0answers
50 views

How to restore taxonomy terms and node relationships?

I was using the Delete Orphaned Terms module to delete unused terms. Today, bad things happened: it deleted lots of taxonomy terms although they're are not orphaned. Then I found a serious issue about ...
0
votes
2answers
160 views

hook_menu_alter for taxonomy vocabulary

My vocabularies machine name is vocab_ . $account_id . First Funcs: too see the user $account_id is the same with vocab.. if yes then return TRUE. function _term_account(){ global $base_url; ...
0
votes
1answer
69 views

Filter Taxonomy Widget Options by Entity Reference

I have two content types, Lesson Plan and Course. When creating a Lesson Plan, users select a Course (Entity Reference). Later, they choose course goals (Term Reference) that the Lesson Plan meets. I'...
0
votes
1answer
151 views

Add permission to taxonomy programmatically

I have certain content type .. when node is save it create: user,vocabulary I used hook_user_save and taxonomy_vocabulary_save.. Which the vocabulary name is $node->title .. All I need now.. How i ...
-1
votes
1answer
50 views

adding new vocabulary after saving node

I try to add new vocabulary After adding node for certain type..'account' if ($node->type == 'account') { $nid = $node->nid; $title = $node->title; $voc_title = 'branches_' .$nid; ...
0
votes
1answer
38 views

Is it possible to add or somehow relate a checkfiled to taxonomies?

I am trying to make something with the commerce module and I need to create options for my product and I was thinking making this via a taxonomy, but the options must be clickable (checkboxes) so ... ...
0
votes
1answer
10 views

How do I stop View/Edit tabs appearing on Taxonomy driven Pages when I am not logged in?

I have a View and Edit button appearing on pages that are Taxonomy driven, even when I am not logged in (and in Incognito Mode). These pages use the URL /taxonomy/term/%taxonomy_term and Views, using ...
0
votes
1answer
112 views

Add taxonomy terms list to homepage

Please help me to add taxonomy terms from custom taxonomy into home page. I have no idea how to do this as I'm coming from WordPress. In WordPress it is easy as calling get_terms(). I have following ...
0
votes
1answer
60 views

Taxonomy description for a custom taxonomy view

I have created a custom taxonomy view. When it is disabled, the taxonomy vocabulary term description shows at the top of the taxonomy page for that term, but when my view is enabled, it does not. How ...
-1
votes
1answer
30 views

Show accounts with the taxonomy term used from a node [closed]

A default user can create a project (a content type with custom fields) with skills he is searching for his project (taxonomy). There are users (with the Crew role) who have the asked skills (taxonomy ...
-1
votes
1answer
159 views

How to view multiple taxonomy terms content on same page?

In Drupal 6, it was possible to view links like: taxonomy/term/1,2, taxonomy/term/1+2, taxonomy/term/2/2 or taxonomy/term/2/all which would list multiple taxonomy terms on single page (showing ...
2
votes
3answers
84 views

How can I give paid access to content? [closed]

I am looking to manage user access to website content using Rules and the suggested access control module i.e. ACL, TAC etc. There 3 levels of access to manage: Unregistered - No access to any ...