Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
822 views

Limit category choice in entry to 1 and select child category

I have a section of book entries with a categories field called "Genre". A book can fall into multiple genres. A stripped down version of the categories works something like this: Fiction Crime, ...
3
votes
1answer
52 views

How to plan IA for a directory of content thats good for admins and users

I want to build a directory of fishing ports It will have approx 500 entries, each geocoded for map display. I will have 4 views; 1) Directory with map of entries 2) Country and entries 3) Cities (...
3
votes
1answer
145 views

Showing entries within a category

I have a list of people with skills defined by a category group. I have a category field within the 'people' Section so when a new person (entry) is created, the category field allows the admin to ...
2
votes
2answers
1k views

How do I list category name?

Forgive the simplicity of this question but I am in the early stages of my first Craft implementation. My simple question is: how do I display a category name in a template. This is the code I am ...
2
votes
2answers
746 views

URI for nested categories in Craft 3

I am trying to set up the URIs for some nested categories in Craft 3 but am having some issues. My structure is basically: service-one |-subservice-one-a |-subservice-one-b service-two |-subservice-...
2
votes
2answers
1k views

Conditional Logic to show or hide fields in the admin?

I'm looking for a way to show or hide fields when editing an entry based on items selected. I need to manage a list of businesses and my plan is to have a channel to hold them all. But based on the ...
2
votes
2answers
2k views

Sorting categories by the post date of the entries related to them

I need to sort my categories based on the date of entries returned within the category. I am trying to sort sermons from a church by the series they were contained within. I have the sermons grouped ...
2
votes
2answers
40 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
2answers
763 views

Use blog index template as category template

I have a blog listing page which works correctly. I also have categories that I would like to use the same template rather than creating a whole new template since the design is exactly the same. ...
2
votes
3answers
878 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
1k 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
2k 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
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
950 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
360 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
609 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
98 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
467 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
436 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
327 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
679 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
90 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
597 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
586 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
243 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
1k 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
245 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
312 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
120 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
2answers
2k views

relatedTo 'and' with 'or'

Is the following possible: {% set issue = craft.entries(section: 'issues', slug: 'october-2014').first() %} {% set categoryOne = craft.categories({ group: 'articles', slug: 'category-slug-one'}) %} {...
2
votes
1answer
123 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
926 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
3answers
1k views

How do I conditionally set active state in category navigation?

Here is the code I am trying to use to set an active state for category navigation: {% for category in categories %} <li {% if craft.request.segment(2) == "{{ category.slug }}" %}class=...
2
votes
2answers
310 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
469 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
2answers
17 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 '...
2
votes
1answer
243 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
2answers
345 views

Craft 3 query children of sub categories

Just wondering how to only query the children on subcategories. For example... Food ├── Fruit │ ├── Apples │ ├── Bananas │ └── Oranges └── Vegetables ├── Brussels sprouts ├── Carrots ...
2
votes
1answer
365 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
555 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
666 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
2k 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
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
96 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
271 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
623 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, ...

1 2
3
4 5
10