Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
315 views

Filter Entries within a page dynamically based on category

I'm creating a portfolio page, and I have a summary list of project entries displayed. At the top of the page, I've got a dropdown displaying a Category field. e.g. craft.categories.group('industry') ...
2
votes
3answers
827 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
281 views

How to get data from Matrix field type?

I have a channel which is basically a list of articles. Each article is associated with one or more companies. When I click on companies I want to show all the articles related to the company. I got ...
1
vote
1answer
411 views

Show all tags related to a category?

Is it possible to show all tags that are related to a category? I can't find anything on it. Thanks. Edit: What I am looking for is this: I know a category slug or name. I want to get all tags ...
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) { ...
1
vote
1answer
410 views

Find matching asset (image) for category

What would be the best approach to have a list of categories (brands in my case.) and if an asset (image) exists that matches that brand name show that asset or instead show a placeholder image. <...
1
vote
1answer
585 views

Sort entries in a category or entries field?

I have a Products Section and a Product Category Structure Section In Products there is an Entries Field where the Category is selected from the Product Category section. Is it possible to sort the ...
3
votes
1answer
242 views

Localization with categories

I am using Lindsey's Language Link plugin for my language switcher. Everything works well, as long as the url is not a category url. Here it is: {% set element = (entry is defined ? entry : null) %}...
5
votes
1answer
164 views

What is the difference between 'nav' and 'for' for looping?

I am new to craftcms and did a look through on the documentation just recently. I am at the part where it explain about the Categories Field and found out that we can loop through the ...
0
votes
1answer
81 views

Category list not returning all related entries

Here's my code: {% for category in craft.categories.group('artistLocation') %} {% set entryCount = craft.entries.relatedTo(category).total() %} {% if entryCount %} <li> ...
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,...
4
votes
1answer
1k views

Product Categories, Structures and Channels

We are currently updating a brochure website, separating a single list of products into a series of sub-categories. Currently, we have a "single" section to display all products, and then a "channel" ...
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 ...
1
vote
1answer
604 views

Entries from all categories in a category group via URL?

I'm familiar with the option in the category settings that allows for categories within a category group to each have their own URLs: I have this setup and it is working fine. However, I'm wondering ...
2
votes
1answer
322 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 ...
1
vote
1answer
102 views

Two sections sharing one category group

Just getting starting with templating so apologies if this is obvious. Couldn't find a solution through search. I have set up two sections. These contain different sets of information. I have one ...
2
votes
1answer
146 views

Setting up Route for Category-based RSS Feeds

I think that I need to set up a few routes to handle my category based RSS feeds. I have a current url structure as follows http://something.com/shows/wmr/marketing pr http://something.com/...
2
votes
1answer
641 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
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
1answer
262 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 ...
0
votes
1answer
136 views

Trying to capture categories field type data in user profile save/update

I am trying to capture the data that is selected when a user selects categories within a categories field type (handle: groups) within the Control Panel profile tab. I was looking thru the Fields, ...
1
vote
1answer
433 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
179 views

How to display a nested list from a structure section based on categories assigned to last descendant?

I have a structure section, which allows categories to be assigned to the final descendant. I'm trying to list the entries by category, whilst including the parent structure entries (so the hierarchy ...
4
votes
3answers
856 views

Get entries by category value from within plugin

I need help. I want to get entries based on multiple field search. It works for basic field types like selectbox or plain text but I can't get it to work with Categories Fields. The field size is a ...
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, ...
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 ...
3
votes
1answer
471 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
1answer
418 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
788 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
188 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 ...
3
votes
1answer
99 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
125 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
522 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
593 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 ...
2
votes
1answer
954 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 ...
0
votes
1answer
141 views

Storage advise for product catalog

I am going to build a boat catalog. Boat products x 40 Types of product x 3 Suppliers of products I was wondering what the best storage setup? For boat and suppliers these could be entries and ...
1
vote
1answer
255 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
150 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 ...
1
vote
1answer
297 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 ...
3
votes
1answer
685 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 ...
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 ...
1
vote
1answer
215 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
218 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....
2
votes
1answer
693 views

Breadcrumbs for category pages

I'm a Craft first-timer building a simple blog site. I want to include breadcrumbs at the top of each page like so: siteurl.com: [Blog] siteurl.com/category/example-category: [Blog > Example ...
0
votes
1answer
500 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 ...

1
4 5
6
7 8
10