Questions tagged [categories]
Categories are taxonomies for your entries, users, and assets.
493
questions
2
votes
2answers
20 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
18 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
16 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
36 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
30 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
21 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
30 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
24 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
31 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
25 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
28 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
81 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
51 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
22 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
50 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
46 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
42 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 ...
0
votes
0answers
34 views
Filter Entry Query by Category
I'm making a staff page. The entries are in the section 'people'.
There are four types of staff - leadership, wardens, staff, safeguarding - so there is a category field for each 'staffCategory'. That ...
0
votes
0answers
14 views
Get entries from a specific level (4) of categories, but go back up the levels if there is not enough content
What would be the best way to achieve this in twig logic?
All entries are related to categories.
These categories could be between 1 -> 4 levels deep.
I would like to start at the deepest level and ...
1
vote
1answer
109 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'...
0
votes
0answers
20 views
Showing Reverse Relationships in CP | Products < > Categories
My clients would like to be able to see what products (Artworks) are added to a category (Collection), and vice versa in the CP.
Relating on the front end is fine, but on the backend there seems like ...
0
votes
0answers
28 views
Is it possible to get a users most popular categories based on Craft products?
So i wanna show the user the product categories that is most popular for that spesific user. Is that possible?
1
vote
1answer
52 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 ...
0
votes
0answers
14 views
Convert a channel to a category group
Is it possible to convert a channel to a category group retaining all the old entries as categories.
My guess is I'll need to write a plugin.
0
votes
0answers
53 views
Apply search filter in Element API
I have managed to build the search filter structure at the twig, but I get stuck when try to convert this structure in element API,
{% if craft.request.getParam('query') %}
{% set keyword = craft....
1
vote
1answer
12 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
22 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
0answers
39 views
How to get most used categories by descending order
{# Create a category query with the 'group' parameter #}
{%
set categoryQuery = craft.categories({
group: 'businessCategories',
limit: 6
})
%}
{{ dd(categoryQuery) }}
I ...
0
votes
1answer
48 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
50 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
70 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
46 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
219 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
72 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
36 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
100 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
38 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
45 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
50 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
29 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
204 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
24 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
vote
1answer
18 views
Show Category Title only where an entry has been included in an Entries field
I have a Category Group with an Entries field assigned so the admin can select which existing Entries should fall within a given category. An Entry can be assigned to multiple categories.
On the ...
1
vote
1answer
44 views
What is the best approach for multi categories filtering
I need a solution for a good filter approach in Craft.
I used 3 Categories related to an entry (Project). The 3 Categories are
(Type / State / Location)
How do I have to set up the routes for the ...