All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
1answer
34 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 ...
1
vote
2answers
84 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
0answers
11 views

How to target specific alias or tid with views-view-responsive-grid template?

I have a template named views-view-responsive-grid--taxonomy-term--page.tpl.php in which I have added a custom block to the left of the responsive view grid with the help of my foundation grid, like ...
0
votes
1answer
187 views

How to display custom fields of taxonomy in field twig

In my content type for Event, I have an entity reference called Speakers which refers to a taxonomy called Team Members. It's set to multiple so I can say which speakers belong to my event. On ...
0
votes
1answer
235 views

Output the term title on page--custom.html.twig

I'm pulling my hair out trying to create a custom page--custom.html.twig for a content type and getting taxonomy terms to display. I'm currently using the following piece of code: {% if node....
3
votes
1answer
94 views

How do I use 2 different taxonomy view modes on one node page?

On a node page I have a term reference field. This term contains 3 fields For the term I've created a few view modes: view_mode_first contains: field_1 view_mode_second contains: field_2, field_3 ...
0
votes
1answer
19 views

How to make one view with different taxonomy terms in different rows?

I want to make a view with 3 rows of lets say fruits, with 6 fruits max for each row. Spring, Summer and Autumn fruits. And I don't want them to be mixed in one array so I could style them in view-...
0
votes
2answers
38 views

How can I make a node like template for a vocabulary?

I have a taxonomy where I want to theme the term pages. I only want to theme the terms pages in this taxonomy. No matter what I do I can't see to get it to show a template file that I can then ...
0
votes
1answer
18 views

Print taxonomy term for theming nodes

I'm not a PHP developer, so I have a problem with customizing a theme. I create a vocabulary "City" and a term "Shiraz", then a field "field_city" as a taxonomy term in my content type. Now I want ...
0
votes
1answer
32 views

How to change calendar entry background based on taxonomy?

Folks, I'm trying to figure out how to style my calendar. I was able to add color stripes based on my taxonomy, but the background of calendar entries is still that ugly yellow #ffc. What I'd like to ...
0
votes
0answers
32 views

Taxonomy page variables giving empty values

I have a taxonomy page set up using taxonomy views. I added the page--taxonomy.html.twig template, but the output of {{name}} and {{content}} is an empty string. I also tried using the page--taxonomy--...
0
votes
0answers
28 views

How to get all vocabularies in a taxonomy retrieved from a referenced field?

I have a taxonomy that I am getting in the page twig file after referencing a field from the node object. The twig file is a page for a content type, i.e. page--content-type.html.twig. So node....
0
votes
0answers
36 views

Display taxonomy terms in node_content-type.tpl and node_content-type--teaser.tpl

i'm on drupal 7.x, i have simple terms without subterms to display on my custom content type (node and teaser templates). It should be easy to do, but i don't understand how to display them, i tried ...
0
votes
0answers
118 views

How can I load a taxonomy term into a views preprocessing hook?

I have a strange situation where I need to insert a non-product entity into a view result of products. The view appears on a taxonomy term page, and I want to add some field content from the term into ...
0
votes
2answers
81 views

How do I get the vocabulary of a term inside an “article” type content type?

I have a content type tagged with various vocabularies. Each vocabulary has terms which I want to style with particular colours based on the vocabulary. For example, say I have a "Fruits" vocab which ...
0
votes
1answer
17 views

Echo taxonomy description based on specific value of a field in a custom template

I'm trying to check the value of a field on my content type that is a list of taxonomy terms to see if it matches a specific taxonomy term, then if it does match, echo the description field of the ...
0
votes
1answer
455 views

How to print a taxonomy term's field value alongside a Views grouping header?

In Drupal 8.4.4 I have a "Living Things" taxonomy vocabulary. One field on the terms in the vocabulary is "Most Common Name", with machine name field_most_common_name. On my "Animalia" term its value ...
1
vote
1answer
735 views

How do I the add vocabulary name or the ID to the <body> CSS classes?

For theming purpose, I would like to add in body class the vocabulary name (or ID) of the current taxonomy. I know how to add a class based on the taxonomy term ID. For example, I have the following ...
1
vote
2answers
486 views

How to add a taxonomy term value as a class?

I am trying to target a specific div with CSS. But for that, I need a unique class in order to target a specific taxonomy term. I look at this question, but that doesn't work as it will target all ...
-1
votes
1answer
138 views

How to fetch taxonomy details from uuid or from taxonomy alias

How canI fetch the taxonomy details from the uuid or from taxonomy alias. My url looks like http://test.com/jobs/finance-accounting?job_category=a4c24884-d2g7-41c6-99f5-eb9783d6b992 which is a ...
0
votes
0answers
12 views

Can I create a Selection Rule that uses a string against a Taxonomy Term?

I've got a Taxonomy Term template I wish to create a Selection rule with. This uses a Taxonomy list as part of the content. For example, the Taxonomy list is about car makes so I have "Honda, Toyota, ...
2
votes
1answer
892 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 ...
0
votes
1answer
392 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
109 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
82 views

Views block visibility

I want to show the block only on this page /category and not show on every next like /category?page=1 As I see it's a big problem for Drupal 8?
1
vote
1answer
269 views

Node listings on taxonomy term page

How to disable/remove node listings on taxonomy term page in Drupal 8?
0
votes
3answers
755 views

How to render taxonomy in page template?

I'm trying to show all taxonomy terms in a custom template (page--project.tpl.php) that overrides page.tpl.php, but I can't pull it off. I'd like to use the default rendering that I get when I see ...
0
votes
1answer
150 views

Get taxonomy fields on node.tpl.php

I have a taxonomy attached to my nodes. The taxonomy has an extra image field attached to it. I can find the taxonomy title field at: $content['field_news_outlet'][0]['#title'] but I can't seem to ...
1
vote
1answer
2k views

How to get term alias in twig templates

I have created a block to show the sibling terms of the term being viewed. In the twig template I am looping through the terms to display the names linked to their respective pages. Now I unable to ...
1
vote
1answer
27 views

Drupal View rewriting output of the field

I created a taxonomy vocabulary with several terms and it is assigned to a content type. So a node can have multiple terms from that vocabulary. After assigning it I have created a view to format the ...
0
votes
1answer
79 views

How to filter articles that are in front page with taxonomy

i have made quick moqup of the site to explain it better : At this moment i made site in drupal 8 that has some articles in it and thous articles are shown in front page (landing Page). I have made ...
1
vote
1answer
890 views

print custom image field for taxonomy page (page--taxonomy.html.twig) template

How do I load an image from a taxonomy custom field into a custom location on my taxonomy page template? Its super easy to accomplish the image is in a node by calling the twig tag for that field. I ...
3
votes
2answers
55 views

Unnecessary showing admin content in main theme

In one of my sites I have the bug: when I submit some admin forms, for example after editing a view, or create a taxonomy vocabulary the result page appears in the main site theme instead of admin ...
2
votes
1answer
113 views

How to render a field from loadtree

Here is my code: $terms = array( \Drupal::service('entity_type.manager') ->getStorage("taxonomy_term") ->loadTree('faq', $parent = 0, $max_depth = 1, $load_entities = TRUE) );...
4
votes
1answer
387 views

Breadcrumb with taxonomy path

I use the theme "Bootstrap". When I display a node, there is no breadcrumb. My nodes are related to taxonomy terms. On the screenshots : Boutique / Les chocolats BIO The second screenshot should ...
1
vote
1answer
72 views

How to pull the value of a taxonomy term into the html.tpl.php files

How does one pull the value of a taxonomy term into the html.tpl.php file? I know this needs to be done in the template.php file, no?
4
votes
2answers
4k views

How to theme the teaser in Drupal 8?

As shown in the picture, I have the teaser views of a taxonomy term Virtual Tour . The teaser shows me the node title, node summary, date submitted and an image uploaded from the image field. What I ...
1
vote
1answer
373 views

In a twig, how do I access different fields of a specific content type in a taxonomy term page

I have some taxonomy terms like Computer and Accessories, Games, Furniture etc. which I am able to access as /camera-and-accessories, /furniture and so on. These taxonomy terms are associated with my ...
1
vote
0answers
38 views

Output based on taxonomy term value, also if a field has value [duplicate]

I have a View which I need to alter the output depending on whether the field (taxonomy term) has a certain value. If the value of the taxonomy field is "Yes", I want to add a surrounding to the view ...
1
vote
1answer
561 views

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 ...
1
vote
2answers
777 views

Listing all terms of a taxonomy in twig template

How can I list all terms of a particular taxonomy in a twig template?
1
vote
0answers
25 views

How to filter options in a select element based on taxonomy?

I have a taxonomy (Bioregions) of regions in our country. It has a few extensions which are used in different contexts (A user may come from "outside NZ", an event may be "nationwide" or "online"). We ...
0
votes
1answer
515 views

How to theme the taxonomy add/edit term form?

I would like to change the design of the taxonomy add/edit term form, how do you create a template for the taxonomy "Add Term" / "Edit Term" just like creating a node form template? Not creating a ...
0
votes
1answer
324 views

Taxonomy vocabulary templates

I have three taxonomy vocabularies in my site and one of them using custom template files.. Parent and child term pages and that's ok.. But I don't want to use these template files for two other ...
0
votes
1answer
24 views

How do I override the vocabulary template but only on a specific content type

I have a vocabulary called "Sectors" and a content type called "News". Basically the vocab displays which sector the blog article is related to and links to the corresponding CMS page about that ...
1
vote
1answer
87 views

Display field's label only when any value added to it

For example Taxonomy Terms field Label is always displayed even if no tags added to it. How can I show Taxonomy Terms field's Label and its values (tag's links), only when there have been a value ...
0
votes
1answer
44 views

Change logo based on taxonomy term

I'm trying to change the logo in my header based on the taxonomy term of a page. I have managed to get it working on the taxonomy landing page itself. However, I have content pages that have term ...
1
vote
2answers
116 views

Remove link to terms page when printing taxonomy term on node--content_type.tpl.php?

I have a node--content_type.tpl.php template where I want to print the taxonomy term associated with the current content as plain text so that I can surround it with a div class to print a special ...
1
vote
2answers
752 views

How to get tid on behalf of node id (nid) in Drupal 8?

I am new in Drupal 8. I have created a node with category (taxonomy). Now I don't understand how to get tid by using nid. I am using $node->body->value to get the body field value and use {{ ...
-1
votes
1answer
146 views

How to add prefix and suffix to certain vocabulary term names

I have vocabulary Height, with terms 50, 100, 150, etc. On the Taxonomy page, I want the title "Height 50 mm", "Height 100 mm", "Height 150 mm" etc. I know it must be something like this, but the code ...