Questions tagged [categories]

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

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

Sort entries per category

I have a collection of entries in a structure, and each entry can be in multiple categories. Is it possible to sort the entries seperately for each category? So it would look something like this: ...
4
votes
1answer
91 views

Sort entries by best match to multiple categories

I've got a channel where entries will be tagged with multiple categories. I want to use those categories to show related content for each entry. So if an entry has cat_a, cat_b and cat_c, I want to ...
1
vote
0answers
127 views

Advanced search entries relatedTo category and unrelated to any category

I know the long-form method for achieving my goal, but I'm hitting a wall in trying to keep the conditionals down. Is it possible to search for entries related to a specific category field AND search ...
2
votes
2answers
278 views

Batch assigning a certain category to existing entries

I have a few 1000 existing entries and just introduced a new Category type. And I would need to assign all existing entries, to a certain category. I've been looking in the MySQL databases what ...
1
vote
0answers
50 views

Showing products from many categories becomes very slow

We have 8000 products imported in the database, with a few 100 categories, sometimes up to 4 levels deep. What we try to do is that when a user clicks a main category, we show 4 random products of ...
1
vote
2answers
232 views

Filtering dynamic criteria with AND

I have a form that is set up to include multiple values with checkboxes. I pass all those values into an array {% set specsQuery = craft.request.getParam('specs') %} {% set productSpecsCategory = ...
1
vote
1answer
706 views

Display entries related to Category Field

I'm sorry If this has been answered before, but I couldn't find any answer that would work for me. Maybe I'm just treating category fields the wrong way and I should be trying to do this with tags. ...
1
vote
1answer
33 views

Upload assets to location based on category if entry isn't saved yet?

I'm building a gallery system and on the entry page I have fields for gallery category (category field) as well as gallery photos (assets field). When creating this entry, I would like to upload the ...
1
vote
1answer
276 views

Sorting Entries field results by category

I have an entries field 'physicians'. I want to output the selections from that field and sort them by category (also named 'physicians') - with the category heading above each category group. I can'...
1
vote
1answer
203 views

Enforce search match multiple parameters

I actually found this code on here Search Form with Craft Commerce. I had a problem with this code pulling up products that didn't match, and then after creating a new product it worked for a bit and ...
2
votes
1answer
291 views

Loop through categories and get bottom-most category for each tree

I need to get the last item that don't have a child. So in this case I need Mobiltelefoner Ipad Køleskab Vaskemaskine How to I get the last item that don't have a child without knowing the amount ...
1
vote
0answers
118 views

Need help with filtering entries by a custom field using ajax with pagination

I'm fairly new to CraftCMS and am stuck with a little filtering issue. I'm trying to filter a page of entries by a custom field. I'd like to use Ajax so there is no page reload. Here's how I have the ...
1
vote
1answer
91 views

How do I add the Categories and tags related to each entry?

This is my basic entry layout and I just want to display the linked category and tag names as indicated… <div class="posts sidemeta"> {% for entry in craft.entries.section('news').find() %} <...
1
vote
1answer
45 views

craft.commerce.products.ids() possible bug?

I'm using the following code on a category listing page to list the sub-categories that contain products: {% set entryIds = craft.commerce.products.ids() %} {% if category is defined %} {% set ...
1
vote
2answers
37 views

onBeforeDeleteCategory not working / inconsistent

I need to run checks before allowing a user to delete a category. I have added the following code to my main plugin class: craft()->on('categories.onBeforeDeleteCategory', function(Event $event) { ...
1
vote
1answer
646 views

Sort entries in a category via entry field

I have a section for Businesses. I also have categories that these businesses can belong to. On each category page I want to list all the businesses that belong to that category. So far so good, but ...
2
votes
1answer
715 views

Entries related to BOTH categories

I've got categories setup like this (Parent & Children): Type Tops Dresses Pants Colour Black Red Yellow When I use this in a category filter and choose Dresses and ...
3
votes
1answer
248 views

Category name in page title

All I'm trying to do is put the category title on a category listing page into the title tag. So I've got the variable set up, but if I add the category title tag: {% set title = "{{ category.title }}...
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
1
vote
1answer
498 views

Nested categories in URL slug

I'm new to Craft and exploring whether it's worth my team moving our existing, deeply-structured content site onto Craft CMS. We have a heavily nested sitemap at the moment with 6 top-level ...
2
votes
1answer
86 views

Query for enabled categories

In a template, I want to show only enabled categories. I can't figure out how to filter the returned categories by only enabled ones, without doing it in the for loop. This works: {% for category in ...
1
vote
0answers
44 views

Find category through ajax using ElementCriteriaModel

I'm trying to run a controller action with ajax in a new plugin I'm making. The action needs to return all categories from a group, so nothing impossible here. When I run the actionUrl in the ...
1
vote
1answer
81 views

Finding corresponding category in different subtrees of a category group

I'm building a language switcher for a clients website. The website consists of multiple regions which can have multiple locales. As regions aren't supported yet in Craft 2, I've worked my way around ...
1
vote
1answer
356 views

Only show items related to the lowest category level

I have a category group (CG). I have a channel of entries with a matrix field (MF). Every block in that matrix field has a category field linked to the CG. I want to list all the MF blocks in an ...
4
votes
3answers
822 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
1answer
182 views

Why do I get 'Could not resolve the subpath “{slug}” after trying to add a category select to a Neo field?

I tried to add a Category Select field into a Neoblock but when i first saved the entry I received the following error: Internal Server Error Could not resolve the subpath “{slug}”. I ...
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 ...
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 ...
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
96 views

Magazine possible in Craft?

I have been a wordpress user for the longest time, a friend of mine now uses Craft, I took a look at his backend and really liked the way he creates his content in it. I also like that it uses Twig. ...
1
vote
1answer
58 views

All categories selected by default for an entry

Is it possible to create an entry, and have all the categories added by default ? Let's say I have a category called 'materials', with values like 'gold', 'silver', 'copper'... They should all be ...
1
vote
1answer
206 views

Simple category-entry search filter

I'm trying to figure what would be the simplest way to do such filtering: I would like to make it in that way that selecting one of "Specialities" category would limit results from the selected "...
1
vote
2answers
159 views

linking to staff page, how to setup entry

I am fairly new to Craft and I am hoping someone can help point me in the right direction so I am not having to do double the work or have to learn the hard way that there is an easier way. I am ...
2
votes
2answers
237 views

How to create a user editable dropdown field?

Trying to figure out the best way of handling this scenario: We have a data field for a entry type that should allow an editor in the CP to select one option from many (ie. a dropdown). However, we ...
1
vote
1answer
294 views

How to get the unique categories from a list

I have a set of FAQ entries. Each entry has one or more categories attached. To be able to filter entries related to a category I need a list with unique categories. Using my solution I'm getting ...
1
vote
1answer
148 views

How to use category in auto generated title?

I have an entry which has a category field. I want an auto-generated title for this entry that uses the assigned category title (first category title in case of multiple categories). I am not sure ...
0
votes
1answer
57 views

Craft Ordering breaking nth child?

For some reason, when outputting 'featured' tagged items, It's ordering them I presume by alphabetical values which is breaking the nth-child CSS set on every 3rd element? Is there anyway to stop this?...
0
votes
0answers
172 views

Categories as Breadcrumbs

I have a site setup using a single article detail page for multiple channels. Each channel has a different category group and I need to output the categories as breadcrumbs so it would ideally look ...
1
vote
1answer
84 views

Combine two almost identical sidebar templates, used for blog index and category index pages

I'm struggling to combine two almost identical sidebar templates. I’m working on a site that has: a blog channel section with an index template that ‘includes’ a ‘sidebar-main.html’ template a ...
3
votes
1answer
208 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) %}...
2
votes
1answer
315 views

Structure a site with multiple locations with categories, structure or “multisite”?

I'm proposing to use Craft for a company that runs multiple golf courses. Along with some general pages for the company as a whole, each location (course) is to have it's own microsite, for want of a ...
1
vote
2answers
64 views

Show related entries grouped by category with category title and description

Anyone able to direct me on this? I have a page that allows you to pick related entries (cables) within the page I want to output the related entries (cables) but group them by their category. I have ...
1
vote
0answers
113 views

Query category by price

My client has requested to be able to filter the results page by price via a dropdown, which you can see in the attached screenshot. Basically the results page shows a list of around 15 property ...
6
votes
1answer
616 views

Custom Category order in a Categories Field

I have a load of projects, each of which can have zero or more categories which indicate the particular type(s) of work involved. As well as using these categories to produce a 'category page' of ...
1
vote
0answers
92 views

Simpler way to code up a category conditional?

I've coded up conditional for categories. I'm still new to Twig and curious if there is a simpler way of coding the following. {% for feedItems in craft.entries.section('news').limit(null).offset(1)....
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 ...
1
vote
1answer
193 views

Creating a smart restaurant menu

I'm building a website for a restaurant and I wanted to make the back-end as easy to use as possible. So I thought of a system like this. Allergens - Contains name and icon Ingredients - Contains ...
1
vote
1answer
176 views

How to use the same category group as a filter on multiple channel sections?

I have two channel sections, each with only their own entry types. I've added the same category group field to both. I'd like to filter each channel's list of entries by the same category group. So ...
1
vote
1answer
151 views

Group entries by category than by month based on Date/Time field

I would like group entries first by what category they are in, than group by month based on a Date/Time field like this for example: Category 1 February 2017 Event 1 March 2017 Event 4 (in all ...
1
vote
1answer
160 views

How do I publish entries with a specific category id?

How do I publish a list of three most recent entries within a 'blog' section that feature the category id '42'? I presently have this code: {% for entry in craft.entries.section('blog').limit(3)....