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
2
votes
2answers
38 views

Need a little help with basic understanding of how categories work

I am trying to figure out how I can put categories to use, and I need some help. I have created a category group called "group1", and 2 catogories inside called "cat1" and "cat2". and I have added ...
2
votes
3answers
729 views

Is it possible to bulk-edit a field across multiple entries at once?

I would like to know if it's possible to select multiple entries and update a field for them all at once – for example, give all the selected entries the same category.
2
votes
1answer
940 views

Display entries by category (multiple categories)

I would like to know how I can create a page that contains all entries from a section e.g. 'news'. I want to divide the entries by their given category. News (section) Category 1: entry in ...
2
votes
2answers
1k views

How do you only show children of “active” parent using categories?

I'm currently using Categories to organize an inventory of products. The hierarchy is straightforward: category, subcategory, and single product entry. The url structure I'm are hoping to use reflects ...
2
votes
2answers
462 views

Multiple category relationship criteria (or)and(or)

Is there a way to do relatedTo categories where the category is (a or b) and (c or d or e)? I can get (a or b) working using: {% paginate craft.commerce.products.relatedTo(categories).limit(20) as ...
2
votes
2answers
1k views

How can I filter selected/related entries by their categories?

I have a section called "Events" and an Entries field, we'll call myEntriesField to select related entries from another channel called "Exhibitors" On the Events page, I need to display the related ...
2
votes
3answers
2k views

Filter entries by multiple categories

I am trying to set up a form with checkboxes that allows users to filter entries by selecting multiple categories, but I am not quite getting it right. Currently this is my form: {% set ...
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
2answers
51 views

Can a Category Entry have an Author

This may be basic but not finding the right way to do it so here is a question. I have a category page where each has its own url and have custom fields on it. But for some reason the author is not ...
2
votes
1answer
345 views

List Categories by 0-9 and A-Z

I'm trying to output a list of Brand names grouped by first letter. But some items have a number or symbol in the name. I want to list first the Numbers and symbols under 0-9 and the rest of the ...
2
votes
1answer
527 views

List the categories an entry is part of?

I'm new to all of this and so far Categories from a templating point of view are confusing me a bit. I'm loving Craft so far but some concepts are causing me some headaches to adjust to! What i'm ...
2
votes
1answer
82 views

Categories not adding trailing slash

In my general config I have enabled URLS to have trailing slashes. 'addTrailingSlashesToUrls' => true, This is working for products and entries. But it is not working on Categories. Category ...
2
votes
1answer
326 views

Query all categories once and get individual categories from array

I am working on a site that needs to both list all categories and also pull out individual categories by their id. I would like to query the DB once for all the categories (to improve performance), ...
2
votes
1answer
317 views

Loop through entries that share current entry category and restrict to Cat Group Id

I've been racking my brains trying to get my head around categories and entries, hopefully someone can help and show me the best way. I have an entry page with product information and this product is ...
2
votes
1answer
571 views

Including two category slugs in entries’ URLs

I have a section with two Categories fields, and I would like the entries’ URLs to include the slugs of the categories selected in each of those fields. The Category Groups are: mySection Employees ...
2
votes
1answer
88 views

getSegment matching category title

I'm trying to match the 2nd part of the slug with the category title to then place a 'current' class on the link. Something like: {% nav category in craft.categories.group('blogCategories') %} &...
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 ...
2
votes
2answers
537 views

Display entries by Category (Category in Super Table)

I'm been kicking myself for hours and going round in circles trying to get list of entries displayed by category when the category is selected from within a SuperTable (static table) row. I would ...
2
votes
1answer
949 views

How to populate Category field form frontend form?

I have a frontend form that has a select list for language. This field will allow for one language to be selected. In the backend I have a field set up for my entries as a category field populated by ...
2
votes
2answers
1k views

Category field in entry

I am trying to show an image that is defined on a category - named photos. I have an entry page with a list of all category entries listed at the bottom. I'd like to show this image but I'm still ...
2
votes
2answers
229 views

Performance of a categories list with post count

Let's say I'm outputting a list/nav of categories, with the count of entries in each category, as described in other questions: {% nav category in craft.categories.group('...') %} {% set ...
2
votes
1answer
294 views

Segment to filter through categories slug

I've seen plenty examples of using the uri segment like below, but it ain't working for me, anyone had same sort of issue? {% set segment = craft.request.segment(2) %} {% set pageCats = craft....
2
votes
1answer
114 views

How can I only get the entries that are related to an active category

In the product overviews and search results on my website are also products listed which are related to passive categories. Is there a way to get only entries which are related to active categories? ...
2
votes
1answer
118 views

How do I show entries that do not have a certain category?

I’m aware of the relatedTo() parameter for entries that belong to a category but how can I show entries that are NOT relatedTo() a certain category?
2
votes
1answer
844 views

Category as select dropdown box

Im trying to setup a front end user form with a category as a select box. The box looks right but when i submit the form i get a new entry and other fields are filled out but the catgory fields are ...
2
votes
1answer
886 views

List all entries in a section filtered by given category groups

I've got a section called 'web development' and there are four categories that apply to it. Three can be grouped together as 'original content' and one is a link list to external third party content. ...
2
votes
2answers
305 views

Sharing a template with identical category and tag name

I'm trying to stay as DRY as possible here and sharing one template for a news list view; all, category and tag all sharing the same template (and trying to refrain from having a category or tag ...
2
votes
1answer
447 views

How to list the latest 3 entries per category per section?

I'm trying to create a condensed overview of my website content on my homepage. I'd like that page to loop through all sections, in each section looping through the categories that apply to the ...
2
votes
1answer
76 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/...
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 ...
2
votes
1answer
291 views

Why isn't relatedTo not working (anymore)?

I’m using a structure for creating new pages and navigation. In this structure there are multiple entry types where one is used for creating category pages. Here a user can add some content and select ...
2
votes
1answer
478 views

Only show entries related to category

I am trying to create a category template that shows all entries to show relating to the categories. At the minute the cats are Industry Chemical Medical
2
votes
1answer
99 views

How to setup the structure in Craft for a Property Development site I'm building

I've been designing and building a property developers website for the last 9 months (client delayed building it due to economic reasons), but now we are at the point where it's ready to be built into ...
2
votes
1answer
587 views

How can I get an entry's child category, and not the parent category?

I have a category page that lists all of the entries related to that category. And then I want to display the selected child category for the entry... in brief like so: Entry Title 1 Entry 1's Child-...
2
votes
1answer
1k views

How to get parent categories from an entry?

I have a pretty standard type entry page (_entry.html) which displays the details of an entry having navigated to it through 2 levels of categories. On this page I'd like to be able to query the two ...
2
votes
1answer
403 views

Show Other Entries in Same Category

So, I am new. I want to display the 1-n most recent posts in the same category as the current entry (preferably excluding the current entry) -- i.e., I want to have a section with Other Similar Posts ...
2
votes
1answer
1k views

ElementAPI handling CategoryModel and returning a heirachical object

Currently involved with handling the CategoryModel and using this code return [ 'endpoints' => [ // Category 'category/<slug:{slug}>.json' => function($slug) { ...
2
votes
1answer
84 views

Relating a Category Entry to a Categories Field Type

I've been trying to get this working but can't seem to find a solution. I have two different types of Categories in a commerce project. Level One Level Two Examples Level One would be Mens, Ladies,...
2
votes
1answer
2k views

Using the Search Filter with Entry Fields

I've got an entry page and at the bottom I would like to show related products and then underneath that, related offers. As the main page entry isn't assigned to any categories I've tried to use a ...
2
votes
1answer
240 views

Display categories which only contain entries

I'm grabbing a list of categories and displaying their entry count. How can I only display categories which have entires? So I'm not getting any with 0 in them, which is occurring as I have a few ...
2
votes
1answer
608 views

Working with multiple categories

Does anyone know if you can work with releatedTo between categories? I’d like to get all the categories in a categories.groups that are related to a single category I have some entries in a channel, ...
2
votes
1answer
315 views

Output Matrix in relation to category

I'm setting up an FAQ page using a matrix. Each Matrix block contains a question and an answer field. Each Q+A needs to be outputted within a section on the same page such as General, Payments... I'...
2
votes
3answers
349 views

Multiple sources on category field type - possible?

We're trying to setup a category field type to allow the selection of 1 category but from multiple category sources. Is there a simple way to achieve this without writing a custom plugin / fieldtype? ...
2
votes
1answer
302 views

Category filter returning all entries

I've been trying to build a category filter. I managed to make my buttons respond with categories but the returned entries on the page stay the same. So when I click one of the links "/?category=koop" ...
2
votes
2answers
968 views

Get current entry category

I haven't used categories before so maybe I'm looking at this the wrong way. I currently have a category group named products with the following structure: Featured Fruit ----Apple ----Banana Veg ---...
2
votes
1answer
558 views

Check if Category is in Query

I'm trying to check to see if a particular category (In a loop) exists in a query submitted from a search form. At the moment I'm doing this inside a 'childCategory' loop... {% for childCategory in ...
2
votes
1answer
229 views

Category Nav tag with control over the depth that {% children %} goes

Looking at the docs, i can see that the category {% nav %} loop uses the categoryGroup as the starting point. But, i want the first top level category within the category group as the starting point. ...
2
votes
1answer
455 views

Loop through category groups

I've looped through individual category groups to find each parent/child category, but is there a way to loop through and only show Category Group names?
2
votes
1answer
51 views

When accessing a Category url is there direct access to the Category's fields?

I have setup a category group to use Url's. When navigating to that url does the template have direct access to that category's inputs like you would with and entry? Or do you have to use the segment ...
2
votes
2answers
569 views

Display an entry's level 1 categories only if the entry is not related to any of that category's children

I'm struggling with how to do this in Twig... I feel like it would be easier in a full programming language. If an entry's categories look like this: A - A1 - A2 B C - C1 I need to ...