Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
18 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 ...
1
vote
1answer
14 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 ...
0
votes
0answers
43 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 ...
0
votes
0answers
27 views

get category id & category-group field handle (several), then append it to link (compose url POST parameters)

I have an overview page for entries from an structure. I output the single entries, this works just fine. (simplified code here) {% set singlerugs = craft.entries.section('rugs').all() %} <ul class=...
0
votes
0answers
27 views

How to import Category subfields within a Matrix block using FeedMe?

I'm importing Entries that have a Category field inside a Matrix block. My JSON includes data that I want to import directly to the Category subfields. Here's a simplified example of my JSON: { &...
1
vote
1answer
25 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-...
1
vote
1answer
18 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 ...
0
votes
0answers
59 views

Get categories with the number of entries

I would like to retrieve the categories of a group, the name and their fields, but with each one the number of entries that have this category assigned. It's like this question but I'm not using twig ...
1
vote
2answers
45 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 ...
2
votes
2answers
48 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 ...
1
vote
1answer
27 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 ...
0
votes
0answers
20 views

Using Element API to pull child categories

On Craft, I can assign categories to my different customers: a customer might be "Cloud", "Software" or "Energy". I have set it up so that you can also choose ...
1
vote
1answer
45 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 ...
1
vote
1answer
34 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 ...
0
votes
0answers
26 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. ...
0
votes
1answer
34 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 ...
0
votes
0answers
27 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....
1
vote
1answer
49 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 ...
0
votes
0answers
28 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 ...
1
vote
1answer
39 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 ...
1
vote
1answer
122 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 ...
0
votes
0answers
62 views

Manually sort entries related to a category in the admin

Is anyone familiar with a way (in the admin) to manually sort the order of entries related to a category? For example, a "Software" entry gets assigned to multiple categories during entry. ...
0
votes
0answers
23 views

Load category values based on another category field

I'm really new to Craft CMS, I have a site where I need to do something like this: There are 2 categories, Brand and Model (Models have a relation to Brands via category field). In entries I have 2 ...
0
votes
0answers
8 views

How to pass extra filters to products field type?

We are adding a 'Featured products' field to a category fields config and we're looking to filter the list of products that are selectable by the category this field is appearing in. For example, if ...
0
votes
0answers
9 views

How to filter the entries in redactor link “Link to an entry” based on the category tagged in the content

I have entries that should not be shown to other users that not is not tagged to it's category. Any idea on how to deal with this issue? I've checked this issue How to remove Link To Category from ...
1
vote
1answer
52 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 = ...
1
vote
1answer
64 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 ...
1
vote
1answer
51 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 ...
1
vote
1answer
167 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'...
1
vote
1answer
58 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 ...
1
vote
1answer
14 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 "...
2
votes
2answers
24 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 '...
0
votes
1answer
54 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 ...
1
vote
1answer
86 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 ...
1
vote
2answers
56 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 (...
1
vote
1answer
100 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?
1
vote
1answer
62 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 ...
1
vote
1answer
262 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 ...
2
votes
1answer
81 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 ...
1
vote
1answer
39 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)....
1
vote
1answer
127 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 ...
1
vote
1answer
43 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 ...
0
votes
1answer
57 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 ...
0
votes
0answers
19 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 ...
1
vote
1answer
66 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 ...
1
vote
1answer
42 views

How should we be setting up product categories/sub-categories?

New to Craft CMS and currently don't understand the terminology or how things work together in the platform yet. If I want to set up a category structure like the below in Commerce, how is the best ...
2
votes
1answer
42 views

Link to a nested category

I'm using a matrix field to allow the author to add products they can link to category pages, but my code: {% for block in entry.transformerProductNavigation %} <a href="{{ block.transformer.one....
1
vote
0answers
40 views

Showing entries in same category, excluding the current entry

I'm new to this, so sorry if this is really basic. I want to display a list of entries in the same category as the main entry in my template, excluding the current entry. This is my code: {% for ...
1
vote
2answers
268 views

Craft Query by Category and Tag

I am trying to find the last four Channel entries (Named: Post) with a Category relatedTo "Support" (id: 458) AND Tag relatedTo: "Widget1" (id: 469) I've had success using Category or Tag but not both:...
0
votes
1answer
26 views

Order related entries by number of categories they have in common with current entry

I'm creating a list of similar entries which displays entries that share the same categories as the current entry. My code looks like this: {% set categories = craft.categories.relatedTo(entry) %} {% ...

1
2 3 4 5
10