Questions tagged [categories]

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

45 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
448 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
131 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
109 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
27 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
24 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
29 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
63 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
140 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
102 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
91 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
146 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
127 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
443 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
149 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
55 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
140 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
125 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
93 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
182 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
54 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
81 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
134 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
120 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
7 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 ...
0
votes
0answers
22 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
11 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 ...
0
votes
0answers
16 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
22 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?
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
28 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....
0
votes
0answers
32 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
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
25 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 ...
0
votes
0answers
19 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 ...
0
votes
0answers
17 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
29 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
10 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
27 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
39 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
28 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
240 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
202 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 ...
0
votes
1answer
42 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 ...