Questions tagged [categories]

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

39 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
324 views

Searching for Multiple Categories and Tags

I've been pulling my head for the past day on how to filter products with multiple categories. After a long search, I found and implemented on my project, Advanced Search with tags and categories It ...
2
votes
0answers
116 views

Filtering products by categories and showing number of products related to selected category

I currently have about 420 products and over 100 of categories to choose from for each products, showing the list of categories and filtering it, works fine, and performance is not too bad when it's ...
2
votes
0answers
108 views

Timout on Entry Save if using Categories

I can't use "Categories" in Craft CMS, after hitting "Save" for an entry with Categories set, the page will take ~5minutes to load and typically time out. Usually, it does save the page and update the ...
1
vote
0answers
21 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
0answers
20 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
0answers
18 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
0answers
33 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
0answers
93 views

Combining multiple categories based on URL segments

I have two category groups - brands and resources. Under these I have product videos and documentation entries - section ‘resources’. I’m using the brands categories elsewhere for products too so I’ve ...
1
vote
0answers
70 views

Getting the order for categories.lft rgt

While trying to assign a global CSS class based on the order of the categories based on the drag and drop in the admin editor. The categories I'm using is a single 1 level deep category. It seems ...
1
vote
0answers
72 views

Filters using multiple query strings with pagination and Craft Commerce

I want to build the ability for the user to be able to filter by certain categories when browsing an existing category. As well as this I would like the user to be able to control the ordering of ...
1
vote
0answers
116 views

Order Entries by Category Fields (with fallback)

This is almost a duplicate of this question I have a section which I want to sort by category field. But the categories are not mandatory. When I apply |group('refSorter.first().title') it will ...
1
vote
0answers
98 views

Structure parent root - entry type or category urls?

Been rolling around with this for the last 36hrs trying to decide most useful option. The dilemma is how to preserve a structure and use categories - or not. Below is my structure: Food (section ...
1
vote
0answers
272 views

Category counts for query results

I'm trying to display results from a search. I want to display the categories represented by the search results and the entry count for that category. Think of how Amazon's "refine results" sidebar ...
1
vote
0answers
131 views

Advanced search entries relatedTo category and unrelated to any category

I know the long-form method for achieving my goal, but I'm hitting a wall in trying to keep the conditionals down. Is it possible to search for entries related to a specific category field AND search ...
1
vote
0answers
50 views

Showing products from many categories becomes very slow

We have 8000 products imported in the database, with a few 100 categories, sometimes up to 4 levels deep. What we try to do is that when a user clicks a main category, we show 4 random products of ...
1
vote
0answers
119 views

Need help with filtering entries by a custom field using ajax with pagination

I'm fairly new to CraftCMS and am stuck with a little filtering issue. I'm trying to filter a page of entries by a custom field. I'd like to use Ajax so there is no page reload. Here's how I have the ...
1
vote
0answers
44 views

Find category through ajax using ElementCriteriaModel

I'm trying to run a controller action with ajax in a new plugin I'm making. The action needs to return all categories from a group, so nothing impossible here. When I run the actionUrl in the ...
1
vote
0answers
114 views

Query category by price

My client has requested to be able to filter the results page by price via a dropdown, which you can see in the attached screenshot. Basically the results page shows a list of around 15 property ...
1
vote
0answers
92 views

Simpler way to code up a category conditional?

I've coded up conditional for categories. I'm still new to Twig and curious if there is a simpler way of coding the following. {% for feedItems in craft.entries.section('news').limit(null).offset(1)....
1
vote
0answers
117 views

Compose entry URL with hierarchy

I’m moving new project from Wordpress to Craft, which has the hierarchy in URLs. I’m try to compose URL for this new project: New category field have an option "Limit the number of selectable ...
1
vote
0answers
161 views

How to display a nested list from a structure section based on categories assigned to last descendant?

I have a structure section, which allows categories to be assigned to the final descendant. I'm trying to list the entries by category, whilst including the parent structure entries (so the hierarchy ...
1
vote
0answers
51 views

How do I filter / restrict entries field in CP with a category

Is there a way to restrict the entry field type to specific categories? For example when adding a new field with type "Entries" to select the categories from where entries will be available. I found ...
1
vote
0answers
79 views

Exclude output of entries/users/products if category relation has particular field value

So basically what i have is a big set of categories (about 86 total, multi-level). Within my category fields i have a lightswitch with the handle 'private'. I would like to know how i would write a ...
1
vote
0answers
130 views

How to pull out entries related to multiple nested categories?

I have a category set up with nested categories so: Level1 -level2 -level3 In my entries channel each entry can have multiple nested categories so we may have an entry with: cat1 -...
1
vote
0answers
119 views

Display sub-category depended on selected category with related entries

I am not even sure, I can explain it. I have a several sections, but I'll go with "Products" section. Than I have category group called "Filter". I'd like to use only this category group for all ...
0
votes
0answers
17 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 ...
0
votes
0answers
11 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 ...
0
votes
0answers
16 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 ...
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. ...
0
votes
0answers
14 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 ...
0
votes
0answers
16 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
21 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
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
20 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) ...
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 ...
0
votes
0answers
25 views

Setting an Entry field using sum

I'm looking to set a 'score' property on my "category" field, this will be done by calculating how many entries are within that category similar to a 'Trending' feature. Is there any way to set a ...
0
votes
0answers
193 views

Get Entries from Section related to a category

I'm currently trying to get all entries which belong to a section which is related to that category. e.g. Category Brand Offer Offer belongs to a brand. Brand has a category field. {% set ...
0
votes
0answers
176 views

Categories as Breadcrumbs

I have a site setup using a single article detail page for multiple channels. Each channel has a different category group and I need to output the categories as breadcrumbs so it would ideally look ...