Questions tagged [category]
The category tag has no usage guidance.
118 questions
1
vote
1
answer
21
views
Show post category on an upper level page
I have a single page(index) where I'm showing all my items.
I have the field for setting the category on my item's section so that when I'm on the item page it shows the category of the post.
The ...
1
vote
1
answer
288
views
How to filter a categories query
I have a categories group named "Title" in my backend. In that group I have 15 categories, but I want to display only 3 specific categories on the frontend. How can I filter my query and ...
0
votes
2
answers
148
views
Dynamic vanity redirects using custom module or plugin (Retour)?
I'm needing a set of redirects that are created dynamically using Categories. I currently have a Category Group and inside of that group I have categories that can be nested 3 levels deep, producing ...
1
vote
1
answer
43
views
Category as variant
In Products (Craft Commerce), I've set custom fields. Some are texts, some are related to a Category. Actually, there's 2 different categories per variant...
In order to draw the fields, I need to ...
1
vote
1
answer
20
views
Asset has a child category but only displays the parent on templates
I have an asset volume that has a category field. The category field has no max level so I can have parent/child categories.
If I set a child category to the asset in /admin then all is well, but when ...
1
vote
2
answers
454
views
Sort Entries by Field in Category
I have entries from a section 'title' which all have an associated category 'author'. Category has an associated field 'sortName'. Essentially, I am trying to sort a bunch of books by author last name ...
1
vote
1
answer
149
views
Entries not being related
I am trying to query all entry elements related to a category but I am only able to get some of the entries to show up when I run craft.entry().relatedTo(category)
I have a matrix field in the entries ...
1
vote
1
answer
65
views
Craft Commerce: Filter completed orders based on a product category field
I know how to filter entries or products based on a category field with .relatedTo, but how can I filter completed orders based on a product category field?
In this specific case, I have an overview ...
1
vote
1
answer
68
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
1
answer
390
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
1
answer
43
views
Using a Matrix field to create a homepage that shows entries from sections and categories
I have set up 3 channel types - A, B & C and a Category. Each entry type shares the same pool of categories.
On the home page, I have created a Matrix field (homeSections) with a block type ...
2
votes
1
answer
300
views
How to search based on a Multi select category field in Craft 3?
I have a blog section with multi select categories. I want to filter all the blogs based on that multi select categories in the website. When I tried
.search('category:ui-ux OR category:web-designs')...
1
vote
1
answer
45
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
2
answers
53
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 '...
1
vote
1
answer
50
views
Categories field limit doesn't disable Add a Category button
I set the Branch Limit for a Category Field Type to 1, but after adding one category, the Add a Category button is still active.
Shouldn't it be disabled after reaching the limit?
Thanks!
0
votes
0
answers
239
views
Search for category and title in Element API for Jquery Autocomplete
I'm working on the search Autocomplete based on this article,
http://craftsnippets.com/articles/search-autocomplete-component-for-craft-cms
Besides the title, I want to search within the category too....
1
vote
2
answers
203
views
Show only and merge the entries from multiple categories related to that entry
I want to show the entries which have same category of that entry. The entry might have multiple categories, so I want to merge the result. If there is a result, then only the whole structure will be ...
2
votes
2
answers
133
views
How can I display just the "lowest" categories assigned to an entry and not parent categories?
I have a category tree like this and I have an entry that has four categories A, A1, B, C2:
A
A1
A2
B
B1
B2
C
C1
C2
I want a query that ignores A and returns only A1, B, C2, because I don't ...
1
vote
1
answer
696
views
Impossible to access an attribute on a null variable - on the one() method - all() works!
First question - but I think this is a bug (not my fault).
I have entries/pages (a structure) - one parent (product overview) with children (products)
I have one category group with categories - ...
1
vote
1
answer
34
views
List products related to currently active category (url)
My URL:
http://localhost/product-family/compressors
How can I list the related products?
I don't understand how to get access to the compressors (a category entry of the product-family category type)...
1
vote
1
answer
261
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
1
answer
87
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 ...
1
vote
1
answer
256
views
Set Up Route to Template - then variable Entry is undefined
I've got a blog listing channel set up where I'm trying to filter entries listed by the entries field blogAuthors based on url segment.
/articles-and-excerpts/ loads the blog fine
added a route
but ...
1
vote
1
answer
107
views
Display nested category
I have an entry which has a category field 'productCategory' and the chosen category is a nested one (3 deep), I want to output the category and where it's nested, but by using the field's name: {{ ...
1
vote
3
answers
531
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
0
answers
56
views
Using relatedTo with a string of category ids
I have got a list of product variants being filtered by a string of category ids if there is some data in the category parameter with the following code:
(Note that I'm using the + character between ...
1
vote
0
answers
33
views
Paginate a list of product variants with categories parameters
I have got a category multi-select feature that allows users to filter variants by more than one category. On selection the URL is concatenated as a new category as follows:
?cat=blue
?cat=blue+...
3
votes
1
answer
607
views
Method for creating Category Group landing pages
I have a selection of category groups as follows:
Suitability
Colour
Finish
etc
They all have many categories within them. I have set up some routes for /suitability etc to show the user a /shop/...
1
vote
1
answer
40
views
Displaying gallery when viewing category page or entry with related categories - code review
I have a gallery in my site's <footer> with images that are defined in a matrix field on each of my categories. If I'm viewing a category page or an entry with related categories I want to ...
3
votes
1
answer
51
views
Output values from all entries in a specific section EXCEPT those with a specific category id
Currently, this is NEARLY doing what I want except instead of the output being entries that do NOT have the id, it's output is ONLY the entries with the id. I'm not sure why, since I've included the '...
1
vote
0
answers
40
views
How to handle URLs of entries with no category?
I have a section where most entries have a category assigned to them, but a few ones have no category at all.
I need help how to connect these entries' URLs to my entry template.
So far I used a ...
1
vote
0
answers
69
views
Showing entries in CP only for specific category
I need to sort structure section entries belonging to specific category (entries have category field).
With default structure list displayed in CP, i see all entries for this structure type section ...
1
vote
1
answer
67
views
Craft 2 use different template for the same structure
I have a site with projects which each has a projects structure with an associated category and a number of images.
The URL is set as projects/{projectCat.first.slug}/{slug}
I want to use the ...
1
vote
1
answer
456
views
How to display the parent category on an entry page?
I have a simple Craft 3 website, with products that are organised in categories.
Can someone please tell me how to do the following:
On the the individual product pages (_entry.html) display a '...
1
vote
1
answer
76
views
Including Entry Property in Object
I'm trying to get the category title to render within the following object but it's just returning it as the static string instead of the {{ category.title }} actually rendering.
{% set seo = craft....
1
vote
1
answer
172
views
How to hide {{ entry.title }} on a {structure} page but show it on a {structure}/{category-slug} page
Here's the breakdown:
» structure with two categories. Each category has +10 entries.
» Template is structure / index.html and _entryview.html
I'd like to show two links and a description of both ...
1
vote
1
answer
76
views
Why are my entries disappearing when {% if category | length %} is added?
Editing an index page that displays all entries within a structure.
Everything displays fine.
I add a category to a few entries and add {% if category | length %}and everything disappears as if no ...
1
vote
1
answer
209
views
Macro for entry loop causing 'null' variable template error
I am new to the concept of Twig templates and I can’t get it right from the documentation … What I am trying to achieve is to have a reusable Blogroll snippet that outputs entries in different ...
1
vote
1
answer
862
views
cannot get relatedTo by slug only ID
Can someone tell me why I am going crazy and cannot figure this simple relatedTo issue out?
So I have a categories section called Case Studies and several categories within. I am trying to filter the ...
1
vote
1
answer
95
views
Categories Structure for Landing Pages
I'm using a category group and routes to serve up entries on landing pages with a URL structure like this.
www.domain.com/properties/retail/freestanding
My code works, but I am wondering if there's ...
1
vote
2
answers
274
views
Switch entry type based on the category
I'm trying to use different entry types for certain categories. My category group is called categories, and the slug for Features is features. I have the category group pointed to categories/_entry. ...
4
votes
1
answer
547
views
In Craft 3, (how) can I disable a category on a per site basis?
In the CP, is it possible to disable Category X for site A, and not for Site B? And if so, how?
1
vote
0
answers
839
views
How to get list of category groups?
Is it possible to get a list of category groups without having to loop through all categories to get their parent group name?
UPDATE:
Just making this question clearer, as it's related to using ...
1
vote
1
answer
696
views
Setting the page title for a category page
I am trying to get the page title of the categories page. Currently it shows as: category-name, but I would like to have it set to Category Name to match the category.title.
My categories/index.html ...
2
votes
1
answer
303
views
Displaying entries with pagination on a category page where the entry's last category in the array is the current category
I want to only display entries on the category page which is the last in the array of the entries category, so that it doesn't also show on parent category page.
Let say these are my categories:
...
1
vote
1
answer
440
views
How to load entries with a certain category only?
I am trying to load entries from a section which have a category field with multiple values. Based on that, I want to show specific entries filtered by category.
Example: I have a news section and I ...
1
vote
1
answer
735
views
List entries by category
I have a number of entries that all belong under a Channel that I created. Each entry has a category field where the user can select one or many categories to associate the entry with.
I am ...
3
votes
1
answer
238
views
How to target Sub-Category of Sub-Category
I have 2 Main Groups of Categories, which themselves have Sub-Categories.
The Categories you see have checkboxes to filter entries below.
One Sub-Group has also Children (With Material/ Without ...
1
vote
1
answer
853
views
Element API access param in transformer
Each of my entries has multiple categories (e.g. series, disciplines, and stages). I can get a list of elements related to a single category but I'd also like to get the category information as well (...
1
vote
1
answer
111
views
How can I display category title inside another category
I would like to display a list of category.
I can display the information inside a category like slug or title.
However, I dont know how to display a category field inside a category.
{% for ...