Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [categories]

Categories are taxonomies for your entries, users, and assets.

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

How can an entry type have its own search and categories?

I have an entry type whose content will be separated from the main content. So I was wondering how can we give an entry type its own search and categories? Possible?
2
votes
1answer
153 views

How do I find the category an entry belongs to?

I have a channel with entries which have a category field which is required. When the entries are listed on a page how do I find the category that it belongs to? {% for entry in entries %} <...
2
votes
1answer
173 views

Wrapping my head around Categories

I have a category group set up called 'gists'. I have entries that contain a category field which pulls in the category group 'gists'. Now I need to access entries that are tied to individual ...
2
votes
2answers
327 views

Showing specific category content as well as ALL

I have a photography website with just two categories, 'Lifestyle' and 'Food'. I have two problems: How to display the content I have a category group called 'photoCategories' to which I have ...
2
votes
2answers
856 views

How do I conditionally set active state in category navigation?

Here is the code I am trying to use to set an active state for category navigation: {% for category in categories %} <li {% if craft.request.segment(2) == "{{ category.slug }}" %}class=...
2
votes
1answer
177 views

Craft 3 query children of sub categories

Just wondering how to only query the children on subcategories. For example... Food ├── Fruit │ ├── Apples │ ├── Bananas │ └── Oranges └── Vegetables ├── Brussels sprouts ├── Carrots ...
2
votes
2answers
182 views

How do I hide tags in a category that have no entries?

Entries can have one of two categories and one tag. (People = entries | program = categories | year = tag) On the pages I'd like to display entries related to the category and grouped by tag. ...
2
votes
1answer
76 views

Craft 2 categories locale issue

I have a craft2 site running quite happily with 8 languages. I noticed recently that a dropdown selection of category entries is not working when the locale is changed to chinese (locale = 'zh'). So ...
2
votes
1answer
240 views

In Craft 3, (how) can I disable a category on a per site basis?

In the CP, is it possible to disable Category X for site A, and not for Site B? And if so, how?
2
votes
1answer
65 views

Multiple Tag Groups/Sets for separate channels

I have two separate channel types, let's say "News" and "Reviews" and each of those can have tags. Is it possible to have separate tags for each of those? So News has it's own set of tags, that can't ...
2
votes
1answer
58 views

Associate child categories only to an entry

When adding a Categories field to a section, if you select only child categories, Craft automatically selects the parent categories too. I emailed Craft support about this and they explained it's by ...
2
votes
1answer
86 views

Query for enabled categories

In a template, I want to show only enabled categories. I can't figure out how to filter the returned categories by only enabled ones, without doing it in the for loop. This works: {% for category in ...
2
votes
1answer
715 views

Entries related to BOTH categories

I've got categories setup like this (Parent & Children): Type Tops Dresses Pants Colour Black Red Yellow When I use this in a category filter and choose Dresses and ...
2
votes
2answers
278 views

Batch assigning a certain category to existing entries

I have a few 1000 existing entries and just introduced a new Category type. And I would need to assign all existing entries, to a certain category. I've been looking in the MySQL databases what ...
2
votes
1answer
257 views

Canonical url for product with multiple categories

I'm building a shop using Craft Commerce where a single product can be assigned to multiple categories. The url structure I'm using for the product detail page is: http://domain.com/category/product-...
2
votes
1answer
37 views

Sorting categories into list put single one at end of it

I'm trying to put a single category (as long as it's populated) at the end of an category list. My code is working so far, is there an easy way to pick out the 'Others' category and append it to the ...
2
votes
1answer
210 views

Better way to group by category and include full category entry

The basic idea is that I want to group my entries by category, but I want more than just the category title—I need the entire category entry. My previous post alludes to this, but I've since ...
2
votes
1answer
2k views

filtering entries by category

I've got my news entries paginated and I have a featured entry on the first page so I'm wondering what the best approach would be to filter by category. Here is what my template looks like: {% ...
2
votes
1answer
286 views

Selecting entries using a checkbox field

I had what I thought was a very simple issue: Select some categories on the front-end, filtering by a Checkbox field. The Checkbox has values, which correlate to Locales. The end goal was to create ...
2
votes
1answer
146 views

Show related entries that have the same Category, and some of the same tags?

I have succesfully shown some related entries that are in the same category, using the following: {% set relatedEntries = craft.entries({ section: 'blog', relatedTo: entry.blogCategory.first()...
2
votes
1answer
895 views

How to filter entries in multiple category groups by selecting multiple categories

This question is very similar to the question posted here I have asked in the comments but my requirements are slightly different. I am trying to filter search results by categories in more than one ...
2
votes
1answer
662 views

Breadcrumbs for category pages

I'm a Craft first-timer building a simple blog site. I want to include breadcrumbs at the top of each page like so: siteurl.com: [Blog] siteurl.com/category/example-category: [Blog > Example ...
2
votes
1answer
207 views

Dealing with listing multiple categories

I'm looking to use multiple category group as a navigation. The categories have 3 levels and will be listed depending on set variable. I can list all categories in the group with the following: {% ...
2
votes
1answer
954 views

Display Category Group Name in Template

Having a bear of a time doing something which seems like it should be quite simple. I'm trying to display the category group name in my templates, using the handle and can't quite get it. I've ...
2
votes
2answers
1k views

How do I only display list of categories at certain level of parent category that have entries

I try to explain you semantically what I want to achieve here. I couldn't make it shorter. Sorry. Navigation will be constructed from .level(1) categories. At "site.com/firstLevelCat" I want to ...
2
votes
1answer
124 views

Best practice way to store countries and cities

Is there a recommended way for storing countries and cities in craft? I can see fields and categories as obvious options but its difficult to see the disadvantages/advantages of either at the ...
2
votes
2answers
116 views

Only fetch categories that are related to a minimum of entries

Is there a way to only fetch categories that have been assigned to a minimum of entries, i.e. 4? Currently I fetch categories like this: {% set productIds = craft.entries.section('products').ids() %}...
2
votes
1answer
377 views

Multiple categories filter

I have a channel section called Members. I have 2 category groups (categoriesMembres & cantons). My goal: show entries only related to a specific category in categoriesMembres and loop through ...
2
votes
1answer
656 views

How do I output the value of a field from a Category selected from a Matrix?

I'm new to craft so this is a bit newbie question. I have a category group with a set of categories, each category has a plain text field associated with it. The category group is then used as a ...
2
votes
1answer
750 views

Tie two select fields together based on category and subcategory?

I'm trying to set up a front end form where the user can choose their city and state, which are stored as categories. I have states set up as the parent category and individual cities as sub ...
2
votes
1answer
239 views

Selecting categories by first letter

I'm attempting to pull out a list of categories starting with certain letter(s). What I've come up with so far seems a little excessive and I'm wondering if I've missed something obvious. Can it all ...
2
votes
1answer
176 views

Related category on a single page

Been trying for days to figure this one out. How do I extract entries from a channel and display only entries related to a category? How do I pull in the related photo? I have this code below but it ...
2
votes
2answers
94 views

Craft 3 version - How to get entries related to current category only (not children)

I need some help with syntax on this for Craft 3, please. I want to use this piece of code: {% set fruitEntries = craft.entries.relatedTo({ relatedTo: catP,id: 'and, not '~str }) %} from this ...
2
votes
1answer
24 views

Getting entries from multiple categories

I have two categories, Annual Reviews and Publications. I want to get all entries from these and paginate them. The code I am using is fine for one category - both work individually, but as soon as ...
2
votes
1answer
11 views

Sub categories with extra field

I'm stuck on a problem with categories. I never worked with them before so maybe it's not as difficult a I think. I need the following structure: Type of company 1 (e.g. Bakery) -Bakery 1 + ...
2
votes
1answer
97 views

How to display entries filtered from more than one category

I want to try to learn how I can filter entries by multiple categories. I realise similar questions have been asked in the past, but all the answers are for specific use cases. All I want to do is ...
2
votes
1answer
64 views

How to exclude child elements when looping through categories?

I've got a few categories set up with a few child categories for each. Each one has assets (PDFs) assigned to them, by going into the assets, double clicking, and setting the category field there. So ...
2
votes
1answer
49 views

Can I get entries related to one category from a specific site?

If I can get entries in a category like this: {% set entries = craft.entries.section('sectionSlug').relatedTo('categorySlug').all() %} And a entries from another site like this: {% set entries = ...
2
votes
1answer
97 views

Plugin Development: find source group used by field

I'm writing a plugin that works with Fields in various ways, one thing I need to do is get the category source groups available to a particular category field. I have the field's handle and id and can ...
2
votes
1answer
476 views

Craft Commerce Categories and Product Types

I've just started using craft Commerce. What's the accepted way to categorise products? For example, i’m trying to replicate this structure: Bags and Scarves (shows all products in this category) ...
2
votes
1answer
199 views

Load entries based on category field value while multiple categories are selected

I have an activity calendar (more like a weekly schedule) which filters per day and per category. Because there are so many activities I can't just load them all in at once so I use some sort of Ajax ...
2
votes
1answer
291 views

Loop through categories and get bottom-most category for each tree

I need to get the last item that don't have a child. So in this case I need Mobiltelefoner Ipad Køleskab Vaskemaskine How to I get the last item that don't have a child without knowing the amount ...
2
votes
1answer
141 views

Organizing Entry, Section, and Category hierarchies

I have a site with three broad sections of content: Humanities, Business, and Music. Within each of these are sub-sections. Under "Humanities", for example, is Politics, History, Economics, etc. ...
2
votes
1answer
315 views

Structure a site with multiple locations with categories, structure or “multisite”?

I'm proposing to use Craft for a company that runs multiple golf courses. Along with some general pages for the company as a whole, each location (course) is to have it's own microsite, for want of a ...
2
votes
1answer
219 views

What's the trick to importing an entry with a categories field?

We are using Hampsink's Import plug-in (0.8.33) and we have a very simple CSV for testing. One row, three columns. One of these columns contains a comma-separated list of categories. These are top ...
2
votes
1answer
264 views

How to get data from Matrix field type?

I have a channel which is basically a list of articles. Each article is associated with one or more companies. When I click on companies I want to show all the articles related to the company. I got ...
2
votes
1answer
134 views

Setting up Route for Category-based RSS Feeds

I think that I need to set up a few routes to handle my category based RSS feeds. I have a current url structure as follows http://something.com/shows/wmr/marketing pr http://something.com/...
2
votes
1answer
67 views

Is it possible to assign fields to entries by category?

I want to show some fields depending in the category selected for the entry but within the editing stage. is it possible? If not, then how can i check if the entry is in a category in the template ...
2
votes
1answer
217 views

Save a selected category for a user (using a plugin)

I have some categories, and with the use of a category field a user can select these from within his / her profile. Which is shown in the image: In my Twig template I can get the user selections out ...
2
votes
1answer
942 views

Filter Entries field by category in the CP?

Is it possible to filter relations entries field by a category in a control panel entry? I would like to relate two channels using the entries field but I have 100 source entries so I was hoping to ...