Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
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 ...
1
vote
1answer
38 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
30 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
32 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
23 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 ...
1
vote
1answer
34 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
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
23 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
34 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
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....
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
20 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
33 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
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 ...
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 ...
1
vote
1answer
82 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
40 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
29 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
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 ...
1
vote
1answer
37 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
114 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
42 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
32 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
63 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
34 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
36 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
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 ...
1
vote
1answer
28 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
34 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
39 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
30 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
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
2answers
81 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
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
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. ...
1
vote
1answer
38 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
28 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
223 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
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
1answer
57 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
25 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
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
1answer
41 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
26 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
38 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
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) ...

1
2 3 4 5
10