Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
66 views

GraphQL - Categories with entries

Is it possible to get categories with related entries with one graphQL query? I have the following query: query MyQuery { categories(relatedToEntries: {section: "entryType"}) { id ...
user avatar
  • 155
1 vote
1 answer
37 views

How do you Eager Load Category Fields with Pagination

I have two category fields, teamCategory and articleCategories, on a news listing page that I'm trying to eager load. Problem is, when I add the eager loading it no longer outputs the categories. I ...
user avatar
2 votes
1 answer
52 views

Eager loading categories and assets inside related entries for gallery

I am looking for some advice on how to best streamline a gallery system on a site, but having trouble wrapping my head around the syntax needed to eager load nested asset fields with categories inside ...
user avatar
1 vote
2 answers
39 views

Feed-me import nested categories from CSV/Google sheets

I'm currently able to import nested categories from a Google Sheets when they already exist. But when a child category does not exist, the category is created at the first level. It's quite logic ...
user avatar
1 vote
1 answer
21 views

Events with Speaker: Categories or Channel

Sorry for this general question, i am building a large archive site with many (>1000) Events. Every Event has one or more Speaker. At the moment I am using two channels: "events" and &...
user avatar
  • 165
1 vote
1 answer
38 views

Hiding categories in real time with Sprig in a faceted search

I've built three buttons with checkbox dropdowns that display categories that filter the content below based on categories. I am currently using the relatedTo function to only display the categories ...
user avatar
1 vote
1 answer
29 views

Bad Gateway when using cached category query

I'm trying to find all tiers that have associated entries for a selection dropdown. This does not work, and throws a 502 error {% set allTeirs = craft.categories.group('catPartnerTeirs') %} {% set ...
user avatar
1 vote
1 answer
37 views

Find First Entry That Matches Current Category

I need help. I am creating a category listing which I have working great. The next step is where I'm struggling a bit as I can't seem to query the related entries on a loop basis. For each "...
user avatar
  • 45
1 vote
2 answers
55 views

What is the best way to create breadcrumbs based on a categories?

I have a question related to breadcrumbs. I have a multiple categories with level 3 hierarchy, now if I assign only one category to any product it works for me to create the breadcrumbs based on the ...
user avatar
1 vote
1 answer
17 views

Assign category to entry using a plugin

Feel like I'm going crazy here... I've got this snippet of code. I find my entry based on title key/value. I find my category ids based on alcohol key/value. I attempt to set the entry category ...
user avatar
1 vote
1 answer
36 views

Are categories first class citizens compared to tags?

I understand the difference between categories and tags. I am trying to choose between them as my taxonomy is not very deep and tags seem just as good as categories. But it occurs to me that ...
user avatar
  • 1,888
1 vote
1 answer
27 views

Error when clicking on a category in admin (related to SEOMatic?)

I get the atatched error when clicking in the admin of my site - it seems to be related to SEO Matic but not sure? Anybody any idea? Many thanks Malcolm
user avatar
1 vote
0 answers
37 views

GraphQL API query to load all related data

How to write a query to load entries with its category or any other related data. For example I have cars that related to the BMW category. How I can access the category data in the query that fetch ...
user avatar
1 vote
1 answer
120 views

Filter entries based multiple category groups

This is related with Split categories by levels / List categories merged by name which I explain more on detail there, after that I take the suggestion of create separate category groups, so: I have ...
user avatar
1 vote
1 answer
53 views

Everything comes null when I try to filter entries by category - Craftcms 3

There's an issue when I filtering by categories but everything comes null, I was debugging code but all the entries has the same problem! But I don't know why does this happens? The entry comes well ...
user avatar
0 votes
0 answers
54 views

Split categories by levels / List categories merged by name

I have a scenario where I need category levels (4 levels) split in different sections of the page, also some categories have the same name, I explain: I need to list entries based on a category group ...
user avatar
1 vote
1 answer
285 views

Element API: Get Entries Related to Category with Query Parameter

I'm using the Element API Plugin to create an API, with which I want to get entries related to one category, but dynamically with the category set in the Url. What I have so far in the config/element-...
user avatar
  • 215
1 vote
1 answer
31 views

Use same handle for different fields on different entry types

I've got two entry types: blog and job. Each has a category field but different category groups: blogCategories and jobCategories. I would like to write a Twig include to accept either a blog or a job ...
user avatar
  • 173
1 vote
2 answers
66 views

Count number of consecutive years in category array

I need to count the number of consecutive years a user has been a member of our organization. For example, if they've been a member from in 2018, 2019, 2020 and 2021, their loyalty will be 4 years. If ...
user avatar
  • 337
2 votes
2 answers
87 views

Order entries by related "Year" category and paginate?

I have a section called Library, and a category group called libraryYears. The categories in that group are just years (2021, 2020, 2019...) Each entry in the Library is related to a year in the ...
user avatar
1 vote
1 answer
33 views

Adding Categories navigation to show certain entries

I'm abit lost as to how to structure my FAQ page. I have a single FAQ page that pulls in every FAQ post, these posts come from the FAQ Entries channel. But On the single FAQ page, how do I add a ...
user avatar
  • 132
1 vote
1 answer
66 views

How to search for Entries that have a particular Category set within a Matrix field in the Control Panel?

I have an arrangement like this: Entry type 'people' └ Matrix field 'offices' └ Block type 'office' └ Category field 'building' On the Entries screen, how can I search for people that have a ...
user avatar
1 vote
1 answer
53 views

Get the Sub-Category Link from Category field in a Structure (output with Nav tag)

I am creating a Structure for the main navigation that has two possible choices for the Link: Entries field or a Categories field. The answer I received here showed me how to setup the basics but if ...
user avatar
0 votes
0 answers
43 views

How do you Paginate if Looping through element queries directly is deprecated?

I want to create a basic product listing page based on categories. I created a template that dynamically shows all items based on the category that is passed to it based on the help I received here. ...
user avatar
0 votes
1 answer
51 views

Paginate based on items in a Category

I'm trying to wrap my head around Pagination in Craft. I have a template that outputs a list of products based on the Category that is passed to it from this thread: {# Fetch the entries related to ...
user avatar
0 votes
0 answers
39 views

How to get a specific category by index

I have 4 level product categories. For the menu I am building I need to pick a second category in all top level categories So I get top level categories like so {% set lv1Categories = craft....
user avatar
  • 11
1 vote
1 answer
132 views

Simple Product Listing Pages by Category Slug

I'm new to Craft and I'm trying to create very basic product listing pages based on Categories and I'm not sure where to start. First, it doesn't look to me like you can create separate templates for ...
user avatar
0 votes
0 answers
35 views

Get categories with number of hits (entries, products)

Is there a way to get a list of categories with the number of entries associated with each particular category? I want to output something like this: It would make sense to fetch the number of hits ...
user avatar
  • 617
1 vote
1 answer
125 views

Match to Existing Category on FeedMe Entry Import JSON

I've successfully exported product entries out of an ancient version of ExpressionEngine (1.7.1) into a JSON file and for the most part I've successfully imported that JSON using FeedMe—except for two ...
user avatar
1 vote
1 answer
356 views

How to use Sprig's "Load More" Recipe After Update

This is a continuation of a previous question I had (Here). I am using Sprig's Load More Recipe. In my category page, I want the load more function to only pull up entries that equals the current ...
user avatar
1 vote
1 answer
61 views

Display related entries on a category page filtered by another category field

I have a Structure called "Stoves". Each Entry has two Category fields 'fuelType' and 'output'. Fuel Type categories = ''Wood Burning','Multi-Fuel','Gas' and 'Electric'. Output categories = ...
user avatar
  • 1,173
1 vote
1 answer
142 views

Determine if entry has a specific category

I am using a supertable (or matrix) to create rows. In each row, I have a Category Field. Multiple categories can be selected for each matrix row. As I loop over each row, I want to determine if the ...
user avatar
  • 357
1 vote
1 answer
91 views

Display parent category with nested child categories and related entries

I'm struggling to loop through level 1 categories and display as a category title and then show nested level 2 categories (via a category title) under which I want to nest related categories to ...
user avatar
  • 447
1 vote
1 answer
264 views

How to use categories with Sprig's "Load More" recipe

I am trying out Sprig's "Load More" Recipe and I am trying to call up entries that are related to the current category page. But when I add .relatedTo(category) to the entry model, it doesn'...
user avatar
1 vote
1 answer
110 views

How to create a category filter for a portfolio site?

I want to create a category filter similar to this website http://www.mypoorbrain.com/ (just a random website i found with the desired effect). Basically I want the categories to be displayed ...
user avatar
1 vote
1 answer
31 views

Matrix-field with a category-field to output category-title on single entry page

Me and categories, always giving trouble :) On blogs, we are using a matrix field and in one of the matrix-types, I have a category field. This is to output the title of the category. {% extends "...
user avatar
2 votes
2 answers
40 views

{{ category.title }} error with category groups

I feel like I'm missing something totally obvious here, but how do I output a category name for a category that is part of a category group on a single entry layout? The name of the category group is '...
user avatar
  • 53
0 votes
1 answer
71 views

if statement in a template not working

I am making a condition to use a certain template for a specific article category, but it's not working and giving me an error. {% extends "_layout" %} {% set title = category.title %} {% block ...
user avatar
1 vote
1 answer
89 views

list entries by category, including uncategorized entries

I have a channel that is essentially a list of companies participating in an event. Within that channel is a category group of sponsorship levels. Companies that are sponsors are assigned a ...
user avatar
  • 960
1 vote
2 answers
71 views

Display entries sharing the same nested category on an entry page

I'm trying to show the other entries assigned to the same nested category (on an entry template) but get an error if I use .last() which I was hoping would show the nested category assigned entries (...
user avatar
  • 447
1 vote
1 answer
176 views

How to query in MySQL all entries with related categories

I have a custom product grid not associated with Craft Commerce. I am wondering, how can I query, in the SQL database, all entries and their related categories?
user avatar
1 vote
1 answer
84 views

How can I retain entry category filtering on entry pages' pagination

I have a list of entries, with an option to filter them by categories. If no filter is applied, clicking an entry should (and does) take you to the permalink URL for that entry, as defined in the ...
user avatar
  • 606
1 vote
1 answer
398 views

Create nested categories with Feed Me plugin

I'm trying to import nested categories. My JSON is like: [{"title":"Title""location":[{"Florida":["Key West"]}]}] I want to be created "Florida" category and nested child "Key West" But plugin ...
user avatar
2 votes
1 answer
107 views

Don't output specific category on entry page

With {% for category in entry.categories.all() %} <a href="{{ category.url }}">{{ category.title }}</a> {{ not loop.last ? '| ' }} {% endfor %} How do I exclude a specific category ...
user avatar
  • 509
1 vote
1 answer
49 views

order and limit the occurrences of related categories

I'm generating a list of all related categories of the entries listed on the page. {% for entry in entries %} {% set categories = craft.categories.group('functieGroep').level(2).relatedTo(entry)....
user avatar
1 vote
1 answer
196 views

Categories or Structures: Most efficient way to organize FAQ sections

Working on a plan for a site that has multiple audiences, with a FAQ section for each audience. FAQ entries are organized by Topic (Finance, Advertising, Publicity) each FAQ entry can be ...
user avatar
1 vote
1 answer
56 views

Get entries with related to selected categories and then group by category

Background: I have a listing overview page that lists teaching staff grouped by their department (A category group holds all departments). E.g. All Staff Members: -- Science -- Mrs Magnesium ...
user avatar
  • 671
0 votes
1 answer
71 views

In entry.getPrev/Next navigation, show entries from a specific category only

I have portfolio section that has a ‘portfolio’ category attached to it, which has categories ‘2D’ and ‘3D’. There are 3 templates: The index template shows a list of all the entries in the ...
user avatar
  • 83
0 votes
0 answers
37 views

Conditionally test for a category level

I want to display different code blocks if a category level is 1 or 2 or 3 – on a category page, but finding this hard to do, if I'm on an entry page I can use: {% if entry.level == 1 %} how can I ...
user avatar
  • 447
1 vote
1 answer
103 views

Allowing duplicate slugs in category paths

Again, I've had a look online but couldn't figure out what I had to do. Say I've got a category structure like the below: Category 1 Saturday Sunday Category 2 Saturday Sunday How can I allow ...
user avatar
  • 135

1
2 3 4 5
10