We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
12 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
18 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 ...
0
votes
1answer
19 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
2answers
24 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:...
11
votes
2answers
3k views

How to filter entries by clicking multiple categories on front end

I would like to be able to filter my entries list by multiple categories on the front end. For example, if I first click a category button "lunge" then the results would show entries which are ...
1
vote
1answer
21 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 ...
1
vote
1answer
13 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
8 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. ...
2
votes
2answers
94 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 ...
0
votes
0answers
13 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 ...
1
vote
2answers
85 views

Filter entries with AJAX

How would I sort blog entries displayed using AJAX? What I want to achieve is initially show all posts from a channel (All) but then let my users sort through these posts with a sub navigation using ...
1
vote
0answers
19 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
26 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
18 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
14 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
23 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
14 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
21 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
14 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/...
1
vote
2answers
99 views

Get Related Entries and then filter those by specific category in url segment

Channels: Photographers Photos - entries field handle "photographers" - categories field handle "category" url structure where segment 2 is the photographer slug and segment 3 is the ...
1
vote
1answer
123 views

Is it possible to create category for only one site in a multisite setup?

If not, how would you best approach this issue? For us, different sites have different categories, and also, not always the same number of categories. At the moment, when we create a category, it ...
0
votes
0answers
19 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 ...
1
vote
3answers
125 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,...
0
votes
0answers
26 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
19 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
28 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
2answers
18 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 ...
1
vote
1answer
23 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 ...
0
votes
0answers
7 views

Unable to create new category groups in plugin

So, I'm writing a plugin to assist with a content migration which will be creating new category groups. I'm able to successfully run the plugin, and what's strange is that the category group does get ...
0
votes
0answers
30 views

Element API - Get all category group titles without passing in a handle

I want to achieve something like the following: $categoriesData = []; if ($type === "helpIndex") { $index = -1; $catGroups = Category::find()->group()->all(); foreach ($catGroups as ...
5
votes
2answers
585 views

Categories field is losing its value when programmatically updating other fields’ values

I have a webhook that fetches an entry, modifies one of its custom Text field values and then saves the entry. However there is also a required Categories field on the entry, and when I do this, I get ...
2
votes
3answers
825 views

Getting the first category of the deepest level for an entry

I want to get the first category of the deepest level for an entry. For example if the category structure looks like this Ocean Life > Fish > Gold Fish I want "Gold Fish" Here is what I've come up ...
2
votes
1answer
11 views

Sub categories with extra field

I'm stuck on a problem with categories. I never worked with them before so maybe it's not as difficult a I think. I need the following structure: Type of company 1 (e.g. Bakery) -Bakery 1 + ...
0
votes
1answer
83 views

Trying to show selected categories in a multi select form input

I have a users form, which they can select their occupations. They can choose multiple values from a multi-select input. Occupations are categories that are related to users profile. Here in this ...
1
vote
1answer
48 views

Sortable Categories on per Entry basis

I've been searching all over for this and have been coming up short unfortunately. Does anyone know if it's possible with in Craft CMS 3 to allow custom sorting of categories on a per entry basis? ...
1
vote
0answers
30 views

How to get entries that have a category selected from a category field within a matrix block?

I've got a Section that uses a Matrix field, that has a block, that has a categories field in it. I want to find all entries using this Matrix field, who has a categories field and has a certain ...
1
vote
1answer
377 views

Find entries that have a category selected from a category field within a matrix block

I've got a Section that uses a Matrix field, that has a block, that has a categories field in it. I want to find all entries using this Matrix field, who has a categories field and has a certain ...
1
vote
1answer
66 views

How to manage multiple categories and entry url formats

I have a setup in Craft 2 like below: Section: products Url format: flowers/{productCategory.last.uri}/{slug} Categories: cat1 = Bouquets cat2 = Valentines days Url format: flowers/{slug} The ...
1
vote
1answer
21 views

Two entries same category

I have two different sections that share the same category group that I want to display both on browser at the same time only if the category is the same. Doing that in Craft CMS is possible? Thank ...
1
vote
1answer
197 views

Order entries by a category field alphabetically then paginate

I've tried so many different things and can't get this to work... {% set makeCat = craft.categories() .group('make') .orderBy('title') .limit(21) %} {% paginate makeCat as pageInfo, ...
1
vote
1answer
34 views

Relations and Categories

What's given: Channel: Nutrition Entries Fieldtype: restaurant Category Fieldtype : menu Category: Menu Channel: Menus that also use relations using restaurant field. Each item in the nutrition ...
2
votes
1answer
204 views

Need .last() functionality for categories – .last() will be deprecated going forward

I have a matrix block that calls a category channel. The categories are nested three levels "deep" at times. I want to select first, second or third level links as needed. When I use .last(), I can ...
1
vote
1answer
195 views

Filter Entries by Category fields & refresh URL and list with AJAX

I'm finding myself stuck with filtering entries that are related to categories using a category field. I'm looking to build a sub-navigation on a page, where I can select from a select field or from a ...
2
votes
1answer
139 views

Organizing Entry, Section, and Category hierarchies

I have a site with three broad sections of content: Humanities, Business, and Music. Within each of these are sub-sections. Under "Humanities", for example, is Politics, History, Economics, etc. ...
1
vote
1answer
75 views

Multiple and or relatedTo in plugin element criteria

I am trying to return entries that relate to a series of categories. For example, I am trying to return clothing, in this example, I want to return all entries related to (flannel or denim) and (blue ...
0
votes
1answer
58 views

How to add tags in craft CMS 3

This is my first template that im working on in craft cms3, i've managed to make the most of the homepage and other tabs of website dynamic using the CMS, but I can't figure out how do I make tags and ...
1
vote
1answer
80 views

Excluding Array of Entry Ids Not Busting Cache

-- UPDATED -- My understanding of how the cache busting works is to make sure the query is within the {% cache %} tag. When looking into how it works I may not really be understanding the ins and ...
1
vote
1answer
134 views

Issue Excluding Entries with Multiple Categories in Query

I've reference this related thread but haven't found a working solution that supports pagination and will exclude entries that have multiple categories. The code example will not include Category One,...
2
votes
2answers
579 views

Sorting Entries by category, from multiple category groups

I'm struggling to figure out how to do this: We have a bunch of entries in single a channel. There are two category groups an entry can be assigned to, with multiple categories in each group. We ...
1
vote
1answer
60 views

How to create ordered list of categories from multiple category groups

I have got multiple category groups and I need to concatenate them into one list for a filter UI element. At the moment I have the following: {% set categories = craft.categories.group('colour').all(...