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 different taxonomy terms for different translation. When I change the taxonomy terms in the translation edit page every translation of the content gets updated with the terms variation.

The logic behind would be:

- content A (english) --> taxonomy term 1 (english) - content A (french)  --> taxonomy term 2 (french) - content B (english) --> taxonomy term 2 (english) - content B (french)  --> taxonomy term 3 (french) 

Code to insert TAG taxonomy WordPress

I made a grave error. I delete many TAGs from the database of my blog.

Many TAGs were orphaned. And yet, unfortunately, many posts have anchor words that link to deleted tags.

That is, several links are broken and returning “Error 404 not found”.

This is affecting the indexing of my site.

I would like help!

Do I need an SQL code to insert the orphaned TAGs?

The code states:

  • check which tags exist in the posts and do not exist in the TAG table (database).

  • create (insert) the tags in the database table by filling in the fields: name and slug.

About the table structure:

The version of wordpress installed is: 5.2.1

MySql 5.0.12

Can someone help me ?

I await a return.

Sincerely,

Martin

Code to insert TAG taxonomy WordPress

I made a grave error. I delete many TAGs from the database of my blog.

Many TAGs were orphaned. And yet, unfortunately, many posts have anchor words that link to deleted tags.

That is, several links are broken and returning “Error 404 not found”.

This is affecting the indexing of my site.

I would like help!

Do I need an SQL code to insert the orphaned TAGs?

The code states:

  • check which tags exist in the posts and do not exist in the TAG table (database).

  • create (insert) the tags in the database table by filling in the fields: name and slug.

About the table structure:

The version of wordpress installed is: 5.2.1

MySql 5.0.12

Can someone help me ?

I await a return.

Sincerely,

Martin

How to get taxonomy term values?

In my user entity, I have a term reference. In that vocabulary, I have a regular field. How can I fetch that field’s value? I tried the below in devel/php to no avail.

$  user = Drupal\user\Entity\User::load(17); $  dept = $  user->field_department->entity; \dpm($  dept->field_administrator_e_mail->value); 

My end goal is to send the email when a user is created.

Taxonomy ul parent in view

Greeting, I am new to drupal, I am currently a web developer of a company and I have to address a project in drupal 7, reading tutorials and looking like crazy I found solutions for some things, but I am stuck in this, I will tell the process and the question at the end to contextualize, you have a page within views called home to this page should add a category and some terms create the taxonomy view and I added a block and told him to show on the home luesgo adjust the list to I did not have format and proceeded to create the theme within views, until here I’m fine but at the time of doing the render I do not know how to translate the , since I’m doing a custom fields, but I do not know how to put it as a parent . Thank you.

enter image description here

enter image description here

enter image description here enter image description here enter image description here

Migrate child/parent taxonomy term from csv

In Drupal 8 How to import parent/child taxonomy term from csv file with migrate.

This is my csv file:

id,title,body,country,province 1,first,some body,Italy,Rome 2,second,some body,Germany,Berlin 

I created a taxonomy vocabulary named ‘location’ then I created a node field named ‘field_location’ with the selected checkbox ‘Create referenced entities if they don’t already exist’

I want to import into the node field ‘field_location’ the term ‘country’ as parent and ‘province’ as child of ‘country’

here if my code:

id: my_group_data migration_group: mygroup label: 'my group Data from CSV' source:   plugin: csv   path: sites/default/files/node-import.csv   header_row_count: 1   keys:     - id   column_names:     0:       id: 'Unique Id'     1:       title: 'The title'     2:       body: Body     3:       country: Country     4:       province: Province  process:   title: title   body: body   field_location:     plugin: entity_generate     source: country     entity_type: taxonomy_term     bundle_key: vid     bundle: country     value_key: name   field_location:     plugin: entity_generate     source: province     entity_type: taxonomy_term     bundle_key: vid     bundle: focus     value_key: name destination:   plugin: 'entity:node' 

Dynamic category links that depends on a custom taxonomy

I’m trying to rewrite the category urls, based on a custom taxonomy, so that WordPress knows how to generate them.

My add_rewrite_rule works:

add_rewrite_rule('^(windows|mac|linux|mobile|en-ligne|pro)\/(.+?)\/?$  ', 'index.php?univers=$  matches[1]&category_name=$  matches[2]', 'top'); 

But I can’t seem to find how to tell WordPress to replace the slug category by the current univers, based on the page the user is on (current ‘univers’ taxonomy page). In other words, my category urls remain ‘/category/term’.

Any leads?

How do I add icons to taxonomy terms?

I have a sample site running Drupal 8.1.x, I want to add icons to the taxonomy term.

Example.

I have a term called Animals with the following list in it

Cats Dogs Fish

i want to assign an icon for each terms, a picture of a cat for Cats and so on and will be using it as exposed filter. So i want the pictures/icons instead of the the words Cats – Dogs – Fish.

I have looked into template_preprocess_field(&$ variables, $ hook). I dont know how to go about it, also tried assigning an image filed for each term but the pictures are not showing up on the exposed filter menu.

Please help.

adding image to term

Better expose filter

The Menu