Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
13 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
19 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
28 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
13 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
16 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
9 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
14 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
31 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
33 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 ...
0
votes
0answers
8 views

Is there a way to sync/migrate the entry under category's entry to that entry's category at the entries

The admin had assigned all the entries to a category under the 'Categories' page. But now instead of adding the entry under the 'Categories' page, the admin prefers to add the category under the '...
0
votes
0answers
18 views

Ajax loading for filter based on categories in Craft 3

I have a page with blog listed with pagination using craft paginate. {% paginate craft.entries.section(['blog']).orderBy('postDate desc').limit(15) as pageInfo, entryTemplates %} Now I am need of ...
1
vote
1answer
78 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
32 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
24 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?
0
votes
0answers
17 views

Front End get category group from uid

I have a form on the front end which has a category field. I want to display all the options from the category group, by obtaining the categories from the category group. When i dump the properties ...
1
vote
1answer
31 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
81 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
37 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
30 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
53 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
32 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
28 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
13 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
24 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
24 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
38 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....
0
votes
0answers
23 views

Filtering entries by category and author channel

I'm setting up a blog on a new site - a few hundred entries have been successfully imported. Now I need to set up front end filtering. Each summary on the listing page has a link to the category ...
1
vote
0answers
25 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
59 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
22 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
16 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 ...
0
votes
0answers
9 views

Output category hierarchy in Element API

I am looking to output categories in a level hierarchical format. I have multiple categories, with different levels of categories. Entries can be related to different levels of those categories. ...
1
vote
1answer
36 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 ...
0
votes
0answers
21 views

Supertable - Group rows by category field

I'm using the supertable plugin and my rows consist out of 3 fields. One of them is a categorie field (the categorie field only consist out of a title). I want to group all my rows by category so ...
2
votes
2answers
204 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 ...
1
vote
0answers
22 views

Filtering Entries based on Amenities (Category)

Hello and thank you in advance. I have a page that lists hotels by region. On the initial load of the page I am able to render all the hotels by region in a tabbed format. This part of the page works ...
1
vote
1answer
52 views

Show entries by a certain category AND certain lightswitch

Just thinking of an easy way for the user to manage products on a site. Therefore is it possible to display entries by a category and a lightswitch toggle? IE. Category selected is Photocopiers and ...
1
vote
1answer
23 views

List child categories which have entries based on the current categories

I am looking to output the child categories of a parent category. I only need to show the categories which have entries related to them. I have done this to show all categories using {% set entryIds ...
1
vote
0answers
25 views

How to display entries by descendants of a particular category slug

I'm trying to display entries (with a category heading) by only the descendants of a particular category slug. So it would be similar to this: Display entries by category (multiple categories) but ...
1
vote
1answer
33 views

Get entries related to selected category only and not it's ancestors

The following is using commerce product entries, but I'm reasonably sure it could be any entry. With the following category taxonomy: - Category 1 - Category 1A - Category 2 - Category 3 ... If ...
1
vote
1answer
23 views

relatedTo a category in a matrix field

All, I'm very close, but missing something and any help is appreciated. I have a teamMember matrix block allowing me to add employees with some basic info. One of the fields is a category field called ...
1
vote
3answers
29 views

Show only top level categories assigned to an entry

Having a bit of a brainfart here... If hotspotCategory is my entry's categoryfield and that category group has nested categories, how do I return only the top level categories? {% set entryCats = ...
0
votes
0answers
32 views

How to get category/entry url and a category url in entry breadcrumbs

I have entries for a channel called ‘resources’ that are related to multiple resource categories. When I call the category specific resource entries in a index, how can I get the url of website/...
0
votes
0answers
22 views

How to use category page after setup multi-site

What is the category posting page, see the image. I created multi-site ex) affinity designer and affinity photo, but when I post any items on the category page. When I select affinity design or ...
0
votes
0answers
41 views

Customizing display order of category entries to match admin (order as Structure)

I'm working on a Craft-based site that has a category defined for "Members". I can see in the admin panel one has the ability to drag the entries for this category in any arbitrary order (when ...
0
votes
0answers
31 views

Setup different shipping costs per product category

I have multiple to products in two different categories; shirts and mugs. I want different shippings costs for these categories. Currently I have a shipping method (default) which is (apparently) ...
1
vote
1answer
29 views

Category query returning one fewer items than requested

I'm building a knowledgebase for a client. The client has asked for content to be restricted by category and then by user. This part is easy enough - the users now use the same category field as ...
1
vote
3answers
347 views

With a categories field, how do I query only the *selected* categories?

Suppose we have a category group that allows for any number of levels to its structure. We also have a category field that allows for choosing any number of categories from that group. In our example,...
1
vote
2answers
20 views

Categories not displaying as nested in control panel

Try as I might I just can't seem to get categories to show as nested in the Control Panel as shown on https://docs.craftcms.com/v3/categories.html#creating-and-editing-categories There's no level of ...
2
votes
1answer
43 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 ...

1
2 3 4 5
10