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

New answers tagged

0

$termData = \Drupal::entityTypeManager() ->getStorage('taxonomy_term') ->loadByProperties(['vid' => 'vocabulary_name']); Always works :D If you also have the name it is ->loadByProperties(['name' => $term, 'vid' => 'selected_keyword']); If you need the id from what is returned // returns an array with the tid as ...


0

Below are a couple of things you can try to reduce duplicates caused by a multi-value field. Results will vary depending on your particular view. 1. Use aggregation Under "Other" in Advanced options, enable Use aggregation. Locate the offending field under "Sort criteria". Click on Aggregration settings, then select Aggregation type: Maximum. 2. Filter ...


0

In Drupal 7 you can easily go with: global $user; $new_value = "somevalue"; module_load_include('inc', 'profile2', 'profile2.admin'); $profile2 = profile2_by_uid_load($user->uid, "main"); $profile2__wrapper = entity_metadata_wrapper('profile2', $profile2); $profile2__wrapper->field_ultimo_display->set($new_value); $profile2__wrapper->save();


0

You achieve this with a multi-level taxonomy. Your country name would be the term on the top level and then the historic names would exist as children terms. You could write some code to infer the root term based on the historic term selected. Maybe as simple as having a second field on your entity and just populating it with the historic term's parent on ...


2

You can do this in a custom field type based on the core reference field, adding a second property and dynamically filling the options of the select list depending on the first property. For the multi-value part of your question a non-coding solution would be a paragraph containing both fields. Adding the dynamic behavior can then be done in a form alter ...


0

If you wont to show in views taxonomy terms, translated with entity_translate, try to use "Entity translation: Name" field instead "Taxonomy term: Name (translated)"


Top 50 recent answers are included