A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [taxonomy-terms]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
51 views

How to get fields from taxonomy terms?

I am able to retrieve taxonomy terms programmatically, (as long as I only want to reference the default fields, 'tid' and 'name'). But how do I access custom taxonomy fields? $vid = 'MACHINE_NAME'; $...
0
votes
1answer
46 views

There are no entities matching. BaseFieldDefinition entity reference error for taxonomy

My Code looks like this: $fields['color'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Color')) ->setDescription(t('The color of the fruit.')) ->setSetting('...
0
votes
1answer
33 views

How do I use hook_update_N() to create a vocabulary?

I want to create a standard vocabulary (no extra fields) in Drupal 8.7.5 programatically, using hook_update_N. I've never used this function before. So I'm a complete newbie. I've modified a simple ...
0
votes
2answers
72 views

How to remove a taxonomy vocabulary via database query

To manually remove a taxonomy vocabulary in the database, what tables/columns etcetera do I need to delete or modify? I have a "ghost" taxonomy - it shows up in the list, but doesn't exist anywhere ...
-2
votes
1answer
59 views

How can I change the taxonomy term title?

Simple as that. I want to change the H1 tag from taxonomy views to something like "Articles from %term" to make it more user friendly and not redundant (breadcrumbs shows the term alone). I couldn't ...
0
votes
1answer
92 views

Views view unformatted and outputting taxonomy custom field

Original problem I had was I setup a taxonomy called Category. I added some vocabulary to my Category taxonomy. Some of the terms I added have contain spaces. The labels should have spaces so I want ...
1
vote
1answer
27 views

How to use term edit page instead of view page?

On the terms list page, each term is linked to the view page (i.e. term/[tid]). As I don't have any details in the view page, I would like to link it to edit page. (.i.e term/[tid]/edit). How to ...
1
vote
1answer
48 views

Drupal::entityQuery

This is the official Drupal::entityQuery function definition I found public static function entityQuery($entity_type, $conjunction = 'AND') { return static::getContainer() ->get('entity....
0
votes
0answers
43 views

Is it possible to output all taxonomy terms in page--products.html.twig template?

I am using Drupal 8.7.5. I setup three different taxonomy types. They are Category, Types, and Tags. I have a custom post type called Products. I created a View called Products and added that as a ...
-1
votes
1answer
35 views

List files in a directory as a table

I created a folder inside of my Drupal directory where my client can directly FTP into and upload or remove PDFs. What I'm trying to do is create a page called "Documents" which then displays all ...
0
votes
1answer
76 views

How do I use a term page display?

In Drupal 7, the module taxonomy_display allowed me to insert a content view via views display options under the taxonomy manage display. I am working on rebuilding my Drupal 7 views for Drupal 8, and ...
0
votes
1answer
104 views

Have can I have a view grouped by nested hierarchy?

I have a nested taxonomy as follows: Some forms will only have the taxonomy of "Basic Forms", some will have taxonomy of "overtime forms", etc. So I want my Forms view to look like this example: How ...
0
votes
0answers
17 views

Implementing a contextual filter in a view with nested taxonomies?

We have a menu with submenus, for example: MenuItem1 Sub1A Sub1B Sub1C MenuItem2 Sub2A Sub3B Sub2C MenuItem3 Sub3A Sub3B When you click on MenuItem1, we want the view to display the ...
0
votes
1answer
98 views

Exposed filter or facet for a vocabulary listing select list

I have to create a form with a fulltext search field and a dropdown listing every terms of a certain vocabulary. On submission the form is redirecting the user with the value of both the fields as ...
0
votes
1answer
30 views

Configure a view to display nodes that match a term value of the container node

I have two content types: Programs Events I have a vocabulary: Programs I have a view that displays Events, and I place the view in my Programs nodes. Both Programs and Events have a ...
0
votes
1answer
114 views

Checking for string in variable fails in twig

I'm working on a twig template for use with a commerce product. Each product has a term applied to it like "Green Ball", "Yellow Ball", "Red Block", and "Purple Block". I'm trying to take the ...
0
votes
0answers
17 views

How to reference current user when creating taxonomy term

Using drupal 8.7.x I'm trying to create a vocabulary that references the user that creates the term The settings of the user reference field are the following. The taxonomy term is created using a ...
0
votes
0answers
27 views

How to override confirmation messages when saving or updating/deleting content in Drupal 8?

I wanted to override status message after taxonomy term updated/deleted. I m trying to do with hook form alter as function atlas_common_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $...
0
votes
1answer
20 views

Assign different taxonomy terms to translations of content

I've got some custom content translated with entity translation with custom taxonomy also translated. Actually taxonomy terms are correctly shown inside the content page. The problem is I need ...
1
vote
2answers
276 views

How can I print the vocabulary name instead of the referenced term in a node template?

Let's say I have a content type article with a field "taxonomy". The vocabulary is "fruits". The terms are "apple", "orange", "bananas" The article belongs to "orange". I can easily print in my ...
0
votes
3answers
64 views

Menu tree from taxonomy terms and nodes which belong to them

i need to create a collapsible menu tree from taxonomy terms and nodes which belong to them (not nested terms, but content pages) i'm totally stuck about it i've found solutions for nested taxonomy ...
0
votes
1answer
12 views

Creating 'index' content views for L1-LX within a taxonomy

Note: This is a follow-on question from Creating a displayable 'index' of content nodes within a path Ok, starting to find my feet again within Drupal, and still getting up to speed with views. What ...
0
votes
0answers
19 views

How to fill a multi-value term reference field in a ajax callback in a node add/edit form?

The machine name of the term reference field is "field_persons", using the autocomplete_deluex widget. function zwznertags_form_alter(&$form, &$form_state, $form_id) { if($form_id == '...
0
votes
0answers
30 views

Drupal facet search exclude filters

i have a situation with Search Facet and some excluded taxonomies from the filters on Drupal 7. Here is my scenario content is tagged with tags - taxonomies on the user profile, there is "Denied tags"...
0
votes
0answers
41 views

Issue with Views Contextual Filter using Taxonomy Term Name

I've run into an issue with views using contextual filters that feels like a bug but usually when I encounter what appears to be a bug it's because I'm doing something wrong so I wanted to see what ...
0
votes
1answer
64 views

Won't update taxonomy term

I'm not really a Drupal guru, so any help it'd be awesome. There's a taxonomy for every state (State Owner), which then allows me select the state when adding a new article. However, I'm trying to ...
0
votes
0answers
6 views

multiple view block by term that list node title tagged with child term

I want to display a view where multiple block are specific to first level term of a vocabulary and that it list all the node tagged with all the child term of that term with deep. I could create each ...
1
vote
3answers
41 views

How can I tell if I'm on a taxonomy page in preprocess_page?

If I'm on a node, inside preprocess_page(&$variables), I can check if (isset($variables['node']) && $variables['node']->bundle() == 'my-type') to see if I'm on a node, and a node of a ...
0
votes
1answer
22 views

D7 block view to only show child nodes based on taxonomy

Using Drupal 7 I have a hierarchical taxonomy each node in the site is assigned a taxonomy to identify where it sits in the site structure. On certain pages (landing pages) I would like to show the ...
0
votes
0answers
22 views

simpler hierarchy method than using taxonomy? JSON or XML file?

In Drupal 8... I have a couple instances where I need taxonomies with hierarchy, to be able to search by. But the taxonomy sizes are Large. Generally, the standard Drupal Taxonomy is wonderful. But I, ...
0
votes
0answers
10 views

efficient organziation of geographic state/region/content for entries

This is kind of a general question, but maybe someone has an idea. I have a database that will have 300,000+ entries. Each one of these entries will have multiple entries for 'location' - not ...
0
votes
1answer
97 views

JSON:API to Migrating Taxonomy References isn't mapping

OK, for a number of reasons I'm doing a Drupal 8 - Drupal 8 migration using the JSON:API module on the source site. I've run into an issue attaching taxonomy terms to nodes. Here's as far as I've ...
0
votes
1answer
46 views

Unpublished taxonomy term keep showing in main menu and contextual filter

I'am creating a Drupal 8 multilingual side, i have a main menu and a contextual filter that uses taxonomy term. in english version i wont translate all those taxonomy, so i dont want theim to be ...
1
vote
1answer
62 views

How to reference taxonomy used by other content type?

I have two content types: Content A and Content B Fields in Content A: Title, Location, Body Fields in Content B: Title, Type, Location, Body Location is a vocabulary (Au, Uk, Us, Ca, etc) Type is ...
4
votes
4answers
897 views

Error when viewing list of taxonomy terms

I'm getting an "unexpected error" when I try to view a list of taxonomy terms. I recently updated to 8.7, though I have a feeling the problem has been around since before the update. Here's the error ...
-1
votes
1answer
120 views

Taxonomy Term Field of a Reference Field in a Product not available in Data Selector for CheckOut Rules

I installed Drupal Commerce Kickstart 2 with drupal version 7.54 and drupal commerce Version: 7.x-1.14. My problem is I want to send email to the store owner every time an order is completed. So in ...
0
votes
1answer
42 views

Creating a “tag blacklist” for users on a view

I'm looking to allow users to create a "blacklist" of certain tags on a site. My plan was to do this through adding a "Blacklisted Tags" field on the user entity, but I'm open to other solutions. If ...
0
votes
1answer
70 views

Multiple path aliases based on taxonomy term

I have taxonomy terms from A-Z and each article can belong to multiple terms. for an example, when I create a new article, I have a multi select list for terms. Therefore a particular node should ...
0
votes
1answer
34 views

Show terms in view filtered from another view

I have two views, first one is block, second one is page. I have vocabulary, let's call it "food". In the food vocabulary we have that hierarchy: Fruit Apple Banana Meat Chicken Pork Both views ...
1
vote
0answers
35 views

How do I configure the migrate API to assign all parent and child taxonomy terms to an entity during import?

I'm importing media files which have a taxonomy in the media content type definition. Here is the section of my Yaml file that deals with the taxonomy. field_nih_asset_taxonomy_auto: - ...
0
votes
1answer
127 views

Get taxonomy term ID from standard URL and then pass it to a View as a contextual filter

is a simple question, I whant get the term ID (tid) from standard drupal taxonomy url taxonomy/term/167 ou 167 is my tid and use as argument on views. I found this code to get the tid: $term_path=...
0
votes
0answers
18 views

Is it possible to store a query calculation result in a search index?

I am counting nodes of a specific type associated with terms with this query: $connection = \Drupal::database(); $query = $connection->select('taxonomy_index', 'ti'); $query->join('...
0
votes
1answer
40 views

How Can I do a content type with a 1:n field inside?

I'm a bit lost about how Drupal manage content. For example, I want to create a new content type called Game. When I create a "Game" I want to introduce "Platform" and "Release date". For example: ...
0
votes
0answers
48 views

How can I bulk manage taxonomy parent child relationships?

Using the Migrate API and the explode and entity generate plugins from Migrate Plus, I was able to bring in a couple thousand taxonomy terms. They were listed in the source as: term1/term2/term3/etc ...
1
vote
0answers
38 views

How can I use Migrate API to migrate taxonomy with an unknown level of parent child relationships in tact?

I have a JSON file with an entry that looks like this: "taxonomy": "abc/historical_controls/abc2000_2013" In my YML file I have it mapped like this: field_abc_asset_taxonomy_auto: - ...
0
votes
1answer
42 views

Control access to taxonomy terms

In my project I have companies, which are taxonomy terms, which can create invoices. Users and companies are a many-to-many relationship. I'm able to control access to the invoices using tac_lite, but ...
1
vote
0answers
76 views

Can't update migrated taxonomy terms because of langcode

We have a site that we migrated from Drupal 6 to Drupal 8. If we try to update (Just edit and save) one of the terms that were migrated over, we get an error "The value you selected is not a valid ...
1
vote
2answers
36 views

How to use a contextual filter value in a menu displayed on the same page

I use a view to display a list of books sorted by title. The view has a contextual filter to limit the list by topic. So, a link to the view might be /books-by-title/34 where 34 is the taxonomy term ...
0
votes
0answers
59 views

How can I bulk add multiple taxonomy terms to existing media files, or reimport with terms?

At an earlier stage of a project approximately 30,000 files were uploaded to a Drupal 8 site through the Bulk Media Uploader. Now the project requires that taxonomy terms in an existing vocabulary be ...
0
votes
1answer
81 views

Render taxonomy type custom fields individually

I'm kind of a twig newbie so I'm hoping that someone can point me in the right direction. I've added a custom field field_url to a taxonomy type called field_type_poi. How would you render that ...