Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
35 views

Element API: Group Categories by Groups

I want to use the Element API to output a hierarchical JSON list of categories grouped by category group. For example: { "groups": [ { "id": 2, &...
kmgdev's user avatar
  • 1,169
1 vote
1 answer
62 views

Entry URI Format from an Entries Field (Categories)

i am trying to set the url format for some entries to include the category slugs set for it within a category entry field - i can get the first one like this {eventCategory.one().slug}/{slug} but ...
Malcolm Maclean's user avatar
1 vote
1 answer
52 views

Only show entries related to child category if it exists

I have a categories field for outputting products to a map. The categories linked to that field have a parent/child relationship. With {% set products = craft.entries.section('products').relatedTo(...
Tyssen's user avatar
  • 653
1 vote
1 answer
156 views

Twig Runtime Error on Craft 4 Getting Started Tutorial

I'm working through the 'getting started' tutorial and I've run into an error I can't get passed. I've created the Category Group: 'Topics' and then created the Field 'PostCategories' and connected it ...
GeordieJS's user avatar
1 vote
1 answer
66 views

Check if eager-loaded category exists on product

On my craft commerce project i eager-load categories which belong to a prodcut. in my product template i do for eager -loading: {% do craft.app.elements.eagerLoadElements( className(product), [...
Henrik's user avatar
  • 425
0 votes
0 answers
39 views

How to list categories only related to enabled entries or disabled child entries

Edit: solved in comments My entries are set up as a parent > child structure. A single entry can either have children or not have any. If parent has children, the children entries are put in a ...
Jake's user avatar
  • 43
0 votes
0 answers
33 views

Matching entries against category custom field

I have two channels, pages and products and category groups for categories and regions. The pages entry type has a field where you can select entries from products based on their category and region. ...
Tyssen's user avatar
  • 653
1 vote
1 answer
44 views

How to group assets by category/sub-category

I have a section called “products” that has an asset field called “product-docs”. The assets are pdf files that have a Category field. Each product can have many different types of documents; to make ...
Roi Agneta's user avatar
  • 1,463
1 vote
1 answer
76 views

Batch retrieve the entry count per category item in facet filter

I'm building a facet filter using Craft Commerce products and Craft categories. I have a "Brand" category and each product entry has a brand defined. Same for the other facet filters that ...
Jesse's user avatar
  • 113
2 votes
1 answer
31 views

How to display a category on the site?

Please help me to display the categories. I have a category group with a huge category tree. Can I somehow output not the whole group of categories, but only a certain category with its child ...
Dimi's user avatar
  • 293
1 vote
1 answer
23 views

How to display the final/child category of an entry, not parent category as default

I have the following categories Tech (1 entry: case A) 1.1 Apps 1.2 Software (2 entries: case B) Fashion 2.1 Clothing (1 entry: case C) 2.2 Shoes ... When using {{ entry.categories.one().url }}, it ...
user2707393's user avatar
1 vote
1 answer
214 views

How to filter a categories query

I have a categories group named "Title" in my backend. In that group I have 15 categories, but I want to display only 3 specific categories on the frontend. How can I filter my query and ...
Ronny Peaky Scofield's user avatar
0 votes
0 answers
28 views

How to append the category field data nested inside a section to an input tag?

while clicking the input tag it should display its related entries Based on the category field the data selected in the backend value should get appended to the input tag. When looping through the ...
Reeves Bale Ronny's user avatar
1 vote
1 answer
24 views

Is there a way to mutate categories through GraphQL for a specific siteId?

The graphQL does not support siteId parameter in category mutation. How could I mutate the content for a specific siteId?
user13530's user avatar
1 vote
1 answer
165 views

How to programmatically create category groups and categories in Craft 3/4

I am struggling to create a new category group and category programmatically. I've found a few examples for creating an entry, and one for creating categories in Craft 2, but I can't get it working in ...
Garrett's user avatar
  • 417
1 vote
1 answer
207 views

GraphQL - Optional relatedTo value

I have a component which lists events and can be configured to filter by category. Query: query Events($filter: [String]) { entries( section: "event" relatedToCategories: {group: &...
Thomas's user avatar
  • 133
1 vote
0 answers
56 views

Updated to Craft CMS 4.2.5 and now the "New Category" button is missing in Control Panel [closed]

Like the title says. I've just updated to the latest version while building out a new site in Craft CMS and the New Category button is missing from the Categories screen in the CP. Both when you go to ...
vibe9's user avatar
  • 11
2 votes
2 answers
196 views

Convert Categories into Structure entries

We chose to create a set of content on our site as a category group. We're starting to port over content from our old site (Drupal) and have realized a few bummers — the main one being no revision ...
Bill Columbia's user avatar
0 votes
2 answers
354 views

Nested categories URI format on entries

I have a Category Group that can be 3 levels deep. Each category has its own page and its URI structure appends each category as you go deeper, like so: {parent ? parent.uri : 'root-uri' }/{slug} ...
comtyler's user avatar
1 vote
1 answer
65 views

Entries field within structure

Not sure whether it's a bug or the correct behavior. How do I see the parent category just like the categories do? Entries field related to the category group (another project)
Mark H.'s user avatar
  • 391
0 votes
1 answer
483 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 ...
Jørgen's user avatar
  • 165
1 vote
1 answer
135 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 ...
doctorgloom's user avatar
3 votes
1 answer
555 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 ...
sonoflee's user avatar
1 vote
2 answers
184 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 ...
Elodie Grondin's user avatar
1 vote
1 answer
43 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 &...
buckdanny's user avatar
  • 185
2 votes
2 answers
171 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 ...
Elektra Murphy's user avatar
1 vote
1 answer
52 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 ...
andrewheins's user avatar
1 vote
1 answer
64 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 "...
Ben's user avatar
  • 45
1 vote
2 answers
220 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 ...
Azim Belim's user avatar
1 vote
1 answer
36 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 ...
Sean Delaney's user avatar
1 vote
1 answer
97 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 ...
joomkit's user avatar
  • 2,014
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
Malcolm Maclean's user avatar
1 vote
0 answers
46 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 ...
Nasser Ali Karimi's user avatar
1 vote
1 answer
421 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 ...
user15280052's user avatar
1 vote
1 answer
100 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 ...
EdisonJS's user avatar
0 votes
0 answers
102 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 ...
user15280052's user avatar
1 vote
1 answer
850 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-...
Malte's user avatar
  • 215
1 vote
1 answer
69 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 ...
Tamlyn's user avatar
  • 183
1 vote
2 answers
93 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 ...
supazu's user avatar
  • 526
2 votes
2 answers
145 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 ...
Mike Mella's user avatar
1 vote
1 answer
54 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 ...
Spheriri's user avatar
  • 132
1 vote
1 answer
77 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 ...
Karl Bishop's user avatar
1 vote
1 answer
68 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 ...
doctorgloom's user avatar
0 votes
0 answers
53 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. ...
doctorgloom's user avatar
0 votes
1 answer
119 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 ...
doctorgloom's user avatar
0 votes
0 answers
62 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....
Lumiere's user avatar
  • 11
1 vote
1 answer
304 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 ...
doctorgloom's user avatar
0 votes
0 answers
37 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 ...
nitech's user avatar
  • 679
1 vote
1 answer
253 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 ...
doctorgloom's user avatar
1 vote
1 answer
784 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 ...
Justin Kendall's user avatar

1
2 3 4 5
11