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
3
votes
1answer
46 views

Have some categories NOT linked to a category entry

So my client has thrown a curve ball! I've set-up a list of categories for the types of work they cover. However, they DON'T want all of the categories to actually link to an entry. In other words, ...
3
votes
1answer
379 views

Cannot select subcategory field in entity

I have a Structure section fruit with a single entry type fruit. I also have a Category fruitType with 2 levels: Citrus Orange Lemon Lime Melons Watermelon Honeydew The entry type fruit has a ...
3
votes
1answer
141 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 ...
6
votes
2answers
2k views

Showing just the child category titles of a parent

I have a category group with parents each with 1 level of children. On my category entry page I want to list JUST the children of the current category being viewed. I'm sure it's simple but I can't ...
1
vote
1answer
238 views

Get entries filtered by author's category

I got a list of entries news (channel type). They are created by users (or author). These users have a category region assigned to them. My point is to list the news entries that have the same ...
1
vote
1answer
676 views

Filtering entries by multiple categories with multiple filters

I'm trying to build a category filter on a page that lists houses that are for sale. The idea of the filter is to make it possible to select houses which, for example, are for sale or rent, have a ...
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" ...
3
votes
1answer
453 views

Get all entries attributed with category

Maybe I'm going mad here, but I can't figure out how to get all entries which are in a certain category. Following the syntax laid out here: http://buildwithcraft.com/help/entries-related-to-category ...
2
votes
2answers
116 views

Only fetch categories that are related to a minimum of entries

Is there a way to only fetch categories that have been assigned to a minimum of entries, i.e. 4? Currently I fetch categories like this: {% set productIds = craft.entries.section('products').ids() %}...
5
votes
2answers
585 views

Categories field is losing its value when programmatically updating other fields’ values

I have a webhook that fetches an entry, modifies one of its custom Text field values and then saves the entry. However there is also a required Categories field on the entry, and when I do this, I get ...
3
votes
1answer
153 views

Garnish - Event when selecting a category

I have a "Categories" field in my section. I want to perform some JavaScript actions when a category is selected. Is there any built-in event which will be triggered at that point?
7
votes
1answer
809 views

How to get entries related to current category only (not children)

I need to get entries which are only in current category, not child categories. So if I have a category structured like this: Food ----Fruit -------Apples -------Bananas I've got a categories ...
4
votes
1answer
68 views

What is the intended use of categories?

Just figuring out the craft interface and finding all sorts of useful features. Just can't figure out what the purpose of "categories" is in the settings. Would be much appreciated if anyone could ...
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 ---...
5
votes
2answers
928 views

Get the Category name into the URL for an entry

I have a gallery which is categorised. The gallery is a Structure section where the user adds an entry and then assigns it to a category - all good. At the moment, when clicking on an entry title the ...
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 ...
1
vote
1answer
120 views

Looping through returns nothing after using dynamic routes to get the entry type and category

I'll explain a bit of the structure of the content and then proceed to the issue. So i have a website with a shop in it with the url mysite.com/shop/, it is an channel section, and its template is ...
3
votes
1answer
323 views

List Categories AND their associated entries

I'm trying to create a category driven gallery. My setup (right or wrong) is this:- Users create a new entry within a Structure, title it, add photos and then assign the entry to a pre-defined ...
3
votes
1answer
824 views

Getting entries related to current entries categories

Trying to get 10 entries related to the current entry categories excluding a category called featured. I don't have the category name(s) in the url. This currently what I tried but this does not work,...
2
votes
1answer
67 views

Is it possible to assign fields to entries by category?

I want to show some fields depending in the category selected for the entry but within the editing stage. is it possible? If not, then how can i check if the entry is in a category in the template ...
3
votes
1answer
100 views

Show the entry category, that´s it

I have a simple and maybe a stupid question, it´s my first Craft Website... I´m listing a news section, the news can be categorized ( max two categories ), and i don´t know how to show the category ...
4
votes
2answers
567 views

Structure(s) vs. Categories for product catalog

So I am working on a project that includes an online product catalog. Is there a recommended way of setting up a catalog regarding the use of structure(s) vs. categories or a combination both? I ...
2
votes
2answers
536 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 ...
3
votes
3answers
106 views

Plugin for creating categories on an entry page in Control Panel

Is there a plugin that allows to add a category via an entry page? I like how you're able to add categories in Wordpress admin right on a post page, not only via Categories section — this seems to ...
1
vote
3answers
483 views

Trouble getting a list of categories that have entries for a specific category group

I have a long list of categories in a specific category group, but only want to show a list of the categories from this group that currently have an entry associated with them. I've been trying to ...
4
votes
1answer
332 views

Simple search using a single category in Craft CMS

I am relatively new to Craft and I am having a little trouble understanding how to build a simple search which will allow me to have dropdown of my categories which will return the selected category ...
3
votes
1answer
569 views

Display a list of categories excluding the current one

In a template for a category page, I'm trying to output a list of links through to all categories within a category group but exclude the category that the user is on. Does that make sense? What I'm ...
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 ...
0
votes
1answer
2k views

How to create a template file for Categories?

below is my categories url. http://example.com/index.php?p=categories/vaporizers i create a template files for categories like templates/categories/index.html templates/categories/_entry.html my ...
1
vote
1answer
143 views

Using categories to filter assets

I am new to Craft and have a decent handle on the basics, but I am struggling a little getting this to work. Here is what I would like to do: I have a banner with bxslider which will be looping ...
1
vote
1answer
408 views

Create nested Category via PHP

In a custom plugin, I'm able to easily add a new Category: $category = new CategoryModel(); $category->groupId = 1; $category->getContent()->title = $categoryName; craft()->categories->...
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
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 ...
0
votes
1answer
100 views

Performance hit from Entry Url Format with multiple {% if %} clauses?

With help from this answer, I've got an Entry Url Format that can include top, 2nd, or 3rd-level categories. It works for any of these situations: top-level-category/entry.slug top-level-category/...
1
vote
1answer
67 views

Entries Related by Category with Filler Entries After

At the bottom of an entry I want to display links for eight other posts. To make this useful, what I'd like to do is: start with entries that are related to the post currently being viewed by ...
1
vote
1answer
434 views

Landing Page with Same URL Structure as Category

I have a category group called "Resource Categories" and categories within it have their own urls. Category Url Formats: top-level categories: resources/{slug} nested categories: {parent.uri}/{slug} ...
2
votes
1answer
217 views

Save a selected category for a user (using a plugin)

I have some categories, and with the use of a category field a user can select these from within his / her profile. Which is shown in the image: In my Twig template I can get the user selections out ...
4
votes
1answer
2k views

Showing categories in Channel Entry URLs

I have a site which has two blog-like sections, which I'll call Blog and News. Each has a few categories. The categories are different in each section. An article always has (only) 1 category assigned ...
2
votes
1answer
376 views

Multiple categories filter

I have a channel section called Members. I have 2 category groups (categoriesMembres & cantons). My goal: show entries only related to a specific category in categoriesMembres and loop through ...
0
votes
2answers
923 views

Display Category Entries Based on Slug

I am trying to display entries based on the last segment in the url and then paginate. Here's what I have so far but it's not displaying any entries: {% set categorySlug = craft.request....
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 ...
1
vote
1answer
1k views

Get entries relatedTo multiple categories

I have searched and tried a few different ways but none have worked so not sure what is wrong. Example say I have a few categories case studies, featured, articles, videos... I have tried this way {...
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?
1
vote
1answer
5k views

Impossible to access an attribute (title) on a string variable

I have a Video section with a field called videoCategory. I'm trying to pull in the first category on the _entry.html template. I'm pretty much following the the last example in the documentation at: ...
1
vote
1answer
257 views

Getting Entry By Category for Landing Pages In A Structure

I have a site governed by a structure, including the homepage. I have several "parental" landing pages with research areas (Atlantic, Pacific, Midwest etc ) intended to be the gateway to the ...
4
votes
1answer
748 views

Saving Entry with Category field

I am stuck on saving entry with a category field. The error message I get is about not being able to create/update the entry in the relations table. $accomodationTypecategory = ['title'=>'Hotel'] ...
4
votes
1answer
901 views

Related to entries in categories in a plugin

Ok I can do this in twig but after searching high and low I can't find a good example of how to do it in a plugin. I have a user profile field called interests which holds an array of what they are ...
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
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 ...