All Questions
121 questions
0
votes
1
answer
2k
views
How to add a custom field to a taxonomy term
I am developing a module and I would like to know how to add a field to a taxonomy term?
My section is named special and I want to add terms in this section
I have this code:
function add($form,&...
9
votes
5
answers
6k
views
What are the advantages or disadvantages of using reference based modules instead of taxonomy module?
I wonder how to decide either to use core Taxonomy module or Entity Reference module?
I didn't use Entity Reference module before but I've used the taxonomy module (and some related modules) on 10-15 ...
0
votes
1
answer
1k
views
Taxonomy terms with conditional field
50 terms and each term needs to have radiobuttons or "other".
Food - o in price - o extra price
Drinks - o in price - o extra price
WiFi - o in price - o extra price
So "in price" and "extra price"...
13
votes
4
answers
5k
views
When to use list(text) or taxonomy?
This may be a silly question, but I'm curious what the benefit is of using a list (text) multiple select field over a taxonomy term reference field. They both seem to fill roughly the same function of ...
8
votes
4
answers
951
views
Is it acceptable to change the vid column of a term programmatically in the database?
I need to move some terms from one vocabulary to another by retaining all their data: translations, aliases, and node references.
Is it acceptable to change its vid column value directly in the ...
2
votes
2
answers
775
views
How to change a field type from free-form text to a taxonomy term and keep its existing data?
I need to change one of the fields of a type of a node from a free-form text to be a taxonomy term, but the data already has about 250,000 records.
How can I change this field type without losing ...
3
votes
1
answer
3k
views
Retrieve taxonomy terms with EntityFieldQuery for a given parent term
I am retrieving a tid of a taxonomy term by using EntityFieldQuery. However, I need to cross-link the taxonomy_term_hierarchy table to list those terms which have a particular parent, but I am not ...
5
votes
4
answers
1k
views
Should I change multiple text fields values via MySQL or is there any other preferable way?
The site has a content type and this content type has two fields:
Text Field
Term Reference Field
There are thousands of nodes on this content type and I want to change some values (find/replace).
...
17
votes
4
answers
5k
views
How to hide "Manage Fields" and "Manage Display" tabs
I'm making a website with Drupal 7, and I was looking through the permissions for Taxonomies. I wanted to give the website maintainers a central place to manage the vocabularies and add terms, sort ...
0
votes
1
answer
99
views
Have a child node inherit taxonomy from a parent during /node/add?
In Drupal 7, I have two content types:
Parent Events with tags (like "outdoors" or "popular" or "suitable for kids"). "Tags" are taxonomy terms in a vocabulary,...
6
votes
5
answers
6k
views
Is there a way to provide a Select All / Check All checkbox for a field that displays multiple checkboxes in Drupal 7?
Seems like there is no core config to setup a "Check All" checkbox unless I missed where it is. I'm creating a content type and have a taxonomy reference field and I have alot of terms, which means ...
7
votes
4
answers
5k
views
What is the best tagging widget?
I was using the tagging module as my tagging widget until its status changed to Maintenance status: Unsupported. Now I'm looking for a replacement. After searching drupal.org I figured out there is ...
2
votes
1
answer
16k
views
Get taxonomy term field value?
I have some taxonomy terms that have an image field in them. I am trying to get the value of the image field in my templates. How can I do this? The field's name is field_header_image.
I have this so ...
2
votes
2
answers
220
views
Multilingual Taxonomy Views - Entity Translation
I am trying to create a multilingual taxonomy view using Entity translation. So far, I am stuck displaying an English view even when using a language code.
I'm looking for the steps needed for this....
1
vote
2
answers
12k
views
How to load a taxonomy term (or entity) by field value?
To load a taxonomy term programatically you can use EntityFieldQuery.
<?php
// Get taxonomy term by field value
$section_vocab = taxonomy_vocabulary_machine_name_load('section');
if($...
1
vote
2
answers
2k
views
How do I display a taxonomy term, without a link, in a node template?
In learning, I've created a custom content type called story and a custom taxonomy called story_category. In story I have a term reference for story_category.
I can render a taxonomy term associated ...
8
votes
3
answers
3k
views
'Add More' Taxonomy Term Widget
I'm trying to create a field widget that is similar to the normal term reference widget with one key difference. The user needs to be able to add multiple new taxonomy terms at the same time, this may ...
2
votes
1
answer
772
views
How to change order of taxonomy terms related to specific node field?
As in question. I have multivalued taxonomy field. Is this possible to control terms weight, which are belongs to specific node field?
As a term weight, I mean weight inside single node. It's just a ...
6
votes
1
answer
2k
views
How to reference existing term if it exists or create new one if not exist via Inline Entity Form module?
I have a content type book and it has a taxonomy term reference field: author.
I want to enter name and surname separately for each author on node add/edit page. Name and surname together will be the ...
7
votes
2
answers
2k
views
How can I set the value of a taxonomy term reference to multiple terms using PHP?
This question describes how to set the value of a term reference field using PHP. But what do I do if I want to set the value of a term reference field in the user profile to multiple terms?
I am ...
1
vote
3
answers
3k
views
How to translate custom fields in taxonomy terms?
I would like to have custom fields with translatable content in taxonomy terms. Is this possible with existing modules?
I know that this is possible if I use nodes instead of taxonomy terms: I can ...
2
votes
2
answers
309
views
How to create a rule to combine the terms of 2 fields to create a new term and store it in a 3rd field?
I have a content type that has 3 term reference fields:
Field A (required), which contains a single tag.
Field B (required), which contains a single tag.
Field C (not required), which contains a ...
2
votes
2
answers
879
views
How to fire multiple Rules Actions in a single rule?
I have a real estate website using the drealty module. In the real estate RETS feed, there is a numeric field called "Area". That numeric value refers to a specific area... for example, "22" might be "...
3
votes
1
answer
2k
views
How to modify term reference field in Drupal 7 custom content type?
I am using a term reference field in a content type in Drupal 7 which is a long hierarchical list of categories. In the input form, I want to show them as checkboxes and it gets displayed as a flat ...
1
vote
1
answer
2k
views
Submitting disabled fields on content entry forms?
I need to submit content entry forms that have default values set in disabled elements. However, if I remember correctly, HTTP specifies that fields that are disabled do not have their values sent to ...
4
votes
2
answers
3k
views
Multiple values in creating a new field instance
This is the code I actually have:
$instance = array(
'field_name' => FIELD_PROJECT_TAGS,
'entity_type' => 'node',
'label' => $vocabulary->name,
'bundle' => '...
2
votes
2
answers
989
views
How to display specific nodes in an EVA based on common taxonomy
I am trying to display nodes in an EVA, attached to a node type that shares taxonomy. The EVA passes the node ID to the EVA, so I have a contextual filter, but am having trouble figuring out how to ...
7
votes
1
answer
12k
views
How to programmatically modify fields of taxonomy terms?
In D7, how do I programmatically add/modify fields to taxonomy terms? They are clearly fieldable and in UI I can add and edit fields in them just like I do in nodes but it proved to be no easy task in ...
0
votes
2
answers
246
views
How to create a rule to combine the terms of 2 fields to create a new term stored it in a 3rd field?
I have a content type that has 3 term reference fields:
Field A, required, is a term reference using a vocabulary with machine name vocabulary_a.
Field B, required, is a term reference using a ...
5
votes
1
answer
4k
views
How to get the field settings in drupal 7
Here is the scenario.
I have a taxonomy term reference field, which is referenced to a taxonomy vocabulary, for example it is associated with category vocabulary. Now I need to fetch the vid of the ...
7
votes
3
answers
4k
views
Display taxonomy field in node display
I created a vocabulary where terms have an image as additional field.
I want to show the image instead of the term name in the node page. How can I do this?
In Drupal 6.x, I would load the term and ...
6
votes
2
answers
2k
views
Add field to vocabulary itself
I have a situation where I would like to add a field to a vocabulary itself. In other words, I need an editable field on the form that normally appears at /admin/structure/taxonomy/my_vocabulary/edit ...
1
vote
3
answers
3k
views
How to disable links in taxonomy term node fields [closed]
I have a list of rendered taxonomy terms in a node sidebar, rendered as h2 tags, linked to the taxonomy page for that tid. I don't want that term to link anywhere, so I want to remove the link and ...
0
votes
1
answer
846
views
How to add a field for each taxonomy term or entity reference chosen in Content Type?
I have a content type ‘Product’. When the user add a product it is necessary to choose a Store (a taxonomy term or another content type). After stores are chosen, it is necessary to add the directly ...
3
votes
2
answers
1k
views
form with taxonomy autocomplete widget throws error upon submit: Invalid argument supplied for foreach()
I have a custom form with this field in it:
$form['first']['field_city'] = array(
'#title' => t('Woonplaats'),
'#type' => 'textfield',
'#size' => 25,
'#autocomplete_path' =&...
6
votes
2
answers
3k
views
Selected Checkboxes (taxonomy) populate a new select list with values of selected boxes
* question answered: Help needed with hook_node_submit in custom module to save data *
In Drupal 7, I have a custom content type. In this, there is a multi select term reference to select categories ...
0
votes
1
answer
398
views
Updating a taxonomy term, with extra fields - taxonomy_term_update does not exist
In Drupal 7, I am trying to update and delete some taxonomy terms in the proper way. So, instead of attacking the database directly, I am using taxonomy_term_delete for deleting by tid. However I ...
2
votes
5
answers
825
views
Printing taxonomy terms as an un-ordered list
How to print taxonomy terms as an un-ordered list in page.tpl.php. Where i want to print a taxonomy term called "Article Category" and all its vocabularies one by one as a un-ordered list, so it can ...
2
votes
1
answer
1k
views
How to select an address field city from dropdown list?
I am using Address field module to populate address. A requirement needs to limit cities to a particular set, and also countries to particular set too. so I would like to present a set of cities in ...
1
vote
1
answer
584
views
How to set HTML value for taxonomy description field using entity_metadata_wrapper
I've set my taxonomy description field to taking a filtered text value. Using the UI, I can edit a taxonomy term, write some HTML, save, and when I view it I see the HTML rendered by my browser.
...
2
votes
3
answers
3k
views
Taxonomy widget - select maximum level depth
I want to make a taxonomy field widget that allows me to select the maximum level depth of the taxonomy vocabulary. This widget should be used in node forms and the value (selected term) should be ...
1
vote
2
answers
2k
views
Programmatically create user reference field
I want to add a user reference field in taxonomy term. I create field and it's instance:
$field = ['field_name' => 'mymodule_employee',
'label' => t('Employee'),
'type' => '...
2
votes
1
answer
1k
views
How to display taxonomy term reference field as a rendered entity?
I have taxonomy term reference field which are displayed as checkbox.
Each taxonomy term has two fields 1. description and other 2. price
I want the description and price field to be displayed ...
3
votes
0
answers
901
views
Taxonomy autocomplete widget with term depth settings [closed]
Is there a module (or custom code) to implement a widget for taxonomy autocomplete (>=1k terms) having term depth settings?
Settings could be like to control term level variable depth, rules and ...
1
vote
1
answer
361
views
How to create a name-surname structure for taxonomy terms?
I have a content type book and it has a taxonomy term reference field: author
I want to enter name and surname separately for each author on node add/edit page. Name and surname together will be the ...
1
vote
2
answers
524
views
Warning: Invalid argument supplied for foreach() in taxonomy_field_formatter_view()
My Drupal installation has some warnings, I tried several patches, but none of them works for me. These are the warning messages:
Warning: Invalid argument supplied for foreach() in ...
5
votes
1
answer
2k
views
Sort an entity query by a term reference field's term weight?
I've created an entity query to get an array of nodes based on a specific content type,see below:
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', 'node');
$query-&...
2
votes
2
answers
886
views
An error which appears in Autocomplete taxonomy fields
Did someone ever note this annoying D7 taxonomy error? It jumps out when I seem to "pass" a certain amount of terms or characters. The error is as follows:
An AJAX HTTP request terminated ...
2
votes
2
answers
3k
views
Create a field instance programmatically on a taxonomy vocabulary
I'm trying to create a module which creates a taxonomy vocabulary on installation of the module, and creates one text field on the taxonomy vocabulary/term. But I'm getting the following error when I ...
3
votes
2
answers
2k
views
Entity Reference auto complete term creation on the fly?
There is a reason why I'm using an (autocomplete) Entity Reference field on my Content Type, instead of the Drupal's default term reference. It is linked to a taxonomy vocabulary and it's working just ...