Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
268 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 ...
1
vote
1answer
443 views

Assign category through a plugin

I am importing data into Craft. I happen to know that the id for my desired category is 22. The category is not being saved. Here is my code. $entry = new EntryModel(); $entry->sectionId ...
1
vote
0answers
54 views

How do I filter / restrict entries field in CP with a category

Is there a way to restrict the entry field type to specific categories? For example when adding a new field with type "Entries" to select the categories from where entries will be available. I found ...
0
votes
1answer
2k views

Issue with twig loop.first loop.last contained in nested for statement

I'm trying to pull out selected categories in a front-end user profile. The cats have 2 levels and need to be pulled out into a nested list with only the selected options. I've tried different ways of ...
2
votes
1answer
622 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, ...
3
votes
1answer
479 views

Output entries sorted by category title and paginate

I'm stuck on an issue where I have to paginate a list of entries that would be sorted by category title. So basically, I need to: fetch entries in the 'project' section sort those entries by the '...
1
vote
0answers
81 views

Exclude output of entries/users/products if category relation has particular field value

So basically what i have is a big set of categories (about 86 total, multi-level). Within my category fields i have a lightswitch with the handle 'private'. I would like to know how i would write a ...
1
vote
1answer
419 views

Child categories appear as their parent when selected

In an entry, when selecting a child category, the parent is shown as the selected item. This prevents the use of any child categories. Any help would be appreciated. Use Case: Selection Modal: ...
3
votes
1answer
806 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, ...
0
votes
1answer
194 views

Navigation structure and uri problems

I am using structure type entries for navigation with three fields for navigation that uses either: -customlink field (plain text) or -category entry as the source for links. I have product ...
2
votes
1answer
963 views

How to filter entries in multiple category groups by selecting multiple categories

This question is very similar to the question posted here I have asked in the comments but my requirements are slightly different. I am trying to filter search results by categories in more than one ...
3
votes
1answer
104 views

How to merge/combine/transfer-entries-between two categories in the CP?

I’ve got 2 categories each with lots of entries. The client wants to delete one category, and transfer it’s entries into the other one. If I delete the category, it just disappears, but I somehow ...
0
votes
1answer
139 views

How do I prevent a runPendingTask script being included in returned HTML via ajax? [closed]

I have created a route to retrieve some categories via AJAX. When the AJAX call returns the HTML a runPendingTask script is also returned with the HTML. How do I prevent this? /*<![CDATA[*/ (...
1
vote
1answer
525 views

Loop through entries with custom ordering, showing one from each category then start loop again

I have a channel with entries that may or may not have a custom date field populated. I'd like the display a list of entries, looping through each category, showing one entry from each category. Then ...
1
vote
1answer
40 views

Migrating Joomla K2 nested categories

I have a large-ish site built with Joomla and K2, with articles stored in a hierarchy of categories.. What is the proposed way to recreate the Category hierarchy functionality? What I am interested ...
1
vote
1answer
614 views

How can I get all child categories - of a child category based on url segment?

I am missing something very obvious I think. I am trying to get all child categories based on url segment. For example: "mysite.com/foo" I have a category Group called Sections Within Sections I ...
3
votes
1answer
155 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?
1
vote
1answer
259 views

Categories on a Front-end form

I have searched the forum and cannot find the answer to my question. I know how to populate a dropdown with the categories that are already in the system, but what happens if the category that needs ...
0
votes
0answers
83 views

Advanced search form with checkboxes [duplicate]

So it seems that Matrix fields don't work with the object syntax so I've changed my field structure to use standard dropdowns, checkboxes and a number field. I have the dropdown (gender) and number ...
0
votes
1answer
110 views

Category archive page isn't filtering by current category

Ok all - this is bound to be ridiculously simple, as it's one of the most basic things you can do (https://craftcms.com/support/entries-related-to-category) - but I am ill and I can not figure out ...
1
vote
2answers
157 views

How can I hide entries depending on which category they are associated with?

Right now, I have a staff profile page. Each person on the page has a category association (professional, leadership, student). When the students graduate, I want to add an 'alumni' category to their ...
6
votes
1answer
981 views

How can I get to a category via the category slug using the ElementAPI

I am using the ElementAPI to generate a json response of data based on the value (locations) that was chosen from a drop-down. I think I have all of the pieces I need, i'm struggling with how to put ...
0
votes
1answer
223 views

Order merged query by shared field

I’m trying to merge two query sources (some entries and some categories) but have them ordered by a shared field that is a date field. Here’s what I have so far: set classesLocations = craft.entries....
1
vote
1answer
307 views

How to fetch Category of current Entry and build “Next / Prev” urls

My original question here helped me figure out how to build my URL structure but now the site has introduced two categories: design and photo. I want the "Prev" and "Next" buttons to navigate back ...
0
votes
1answer
277 views

User groups in relation to categories

I am building a community website that currently have two user groups but it might increase so I am trying to automate everything. The current groups are: 'teachers' & 'candidates'. I have a ...
3
votes
1answer
687 views

How to display all entries within a given category

I've got a category group called allcategories, inside of this is two categories called design and photo. I'm trying to filter all entries in the section projects by the category `photo' but none of ...
1
vote
1answer
219 views

How to only list translated categories?

I have a site for a company that is established in US markets and expanding into markets overseas. The site has products and those products are grouped into categories. Due to the costs of ...
0
votes
1answer
81 views

Entries from hardcoded category

Should be easy i thought. How can i display all entries from a section from a certain category? This is my code now, but nothing shows up (screenshot bottomleft): {% set category = craft.categories....
0
votes
1answer
508 views

How can I get the parent category group via the category to create multiple relation criteria?

I have two category groups: Cars and Colors My Cars category looks like this: Cars Sports Cars Corvette Lamborghini Porche My Colors category looks like this: Colors ...
3
votes
3answers
108 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
1answer
654 views

How to list an entries selected nested categories?

I have a entry field populated by categories. The number of categories an entry can have is unlimited and the categories are set up as nested categories i.e. first level ---second level ------third ...
1
vote
0answers
134 views

How to pull out entries related to multiple nested categories?

I have a category set up with nested categories so: Level1 -level2 -level3 In my entries channel each entry can have multiple nested categories so we may have an entry with: cat1 -...
2
votes
1answer
217 views

Dealing with listing multiple categories

I'm looking to use multiple category group as a navigation. The categories have 3 levels and will be listed depending on set variable. I can list all categories in the group with the following: {% ...
2
votes
1answer
339 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'...
1
vote
3answers
321 views

Perform inclusive relatedTo query with multiple categories in Craft 2.5+ [closed]

I'm trying to to display entries related to "all" the given categories instead of "any" using the updated relatedTo method provided in Craft 2.5. In a related question, @BrandonKelly explains how to ...
1
vote
1answer
1k views

Entries grouped by Category and then Sub Category

Been trying to get this working for a few hours but no joy, hope someone can help. I'm looking like an post archive of all entries. Something like Category1 Sub Category 1 Entry / Entry Sub ...
2
votes
1answer
1k views

Display Category Group Name in Template

Having a bear of a time doing something which seems like it should be quite simple. I'm trying to display the category group name in my templates, using the handle and can't quite get it. I've ...
2
votes
1answer
89 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') %} &...
1
vote
2answers
130 views

Use only the sub categories from a category input

I have a category input. The category group has two levels. When accessing the category input via Twig I am trying to only grab sub categories the user selected. However when I use {% set ...
1
vote
1answer
737 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
2answers
1k views

How do I only display list of categories at certain level of parent category that have entries

I try to explain you semantically what I want to achieve here. I couldn't make it shorter. Sorry. Navigation will be constructed from .level(1) categories. At "site.com/firstLevelCat" I want to ...
3
votes
1answer
593 views

Fields associated with a category group

I have set up a custom field for a category group. How do I get the value of this field in a loop that goes through entries? Each category in the group could have this field's value set as true or ...
2
votes
2answers
578 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 ...
1
vote
0answers
120 views

Display sub-category depended on selected category with related entries

I am not even sure, I can explain it. I have a several sections, but I'll go with "Products" section. Than I have category group called "Filter". I'd like to use only this category group for all ...
3
votes
1answer
4k views

Craft entries related on a category page

So i'm trying to output blog entries related to a category. I first created a category group ('categories') I added several categories to the group ('innovation', 'teams', etc) I added a category ...
3
votes
1answer
284 views

Dynamic Category template paths

I've got a site with several locales and want to reuse a set of categories across locales but want to target a locale specific template from within each. Is it possible to set a locale-specific path ...
4
votes
1answer
1k views

How to display the title of a category based on its ID?

I’m passing the ID of a category to a template via a catId query string (i.e. http://example.com/some/path?catId=10). How do I display the title of that category?
3
votes
2answers
550 views

Loading related entries by category using a select menu

I have a list of people (entries) who are related to Categories. I would like to create select menu which will change (filter) the people (entries) shown on the page depending on which category (...
3
votes
1answer
474 views

Category slug is getting numbers appended to it

I have a category Australia and have been experimenting with boboldehampsink import plugin. After deleting categories and starting over the category Australia now has a slug called 'australia-6'. I ...
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 (...

1
6
7
8 9 10