Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
313 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
157 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
58 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
184 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
89 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
223 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
328 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
65 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
119 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
661 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
201 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
183 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
166 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
182 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)....
1
vote
1answer
136 views

Change markup depending on category of an entry

I am trying to output a news section, where I want to display the news categories as classes of the article. That works fine. But I also want to change the markup for a certain category out of the ...
2
votes
1answer
273 views

Canonical url for product with multiple categories

I'm building a shop using Craft Commerce where a single product can be assigned to multiple categories. The url structure I'm using for the product detail page is: http://domain.com/category/product-...
1
vote
1answer
96 views

Bulk upload images, generating a seperate page for each image

Building a photography website for a client, need a way to bulk upload images, much like using the assets field. I want these to be grouped into different sets by entry or category. So that I can ...
3
votes
1answer
380 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 ...
1
vote
1answer
152 views

Display different Categories groups in custom breadcrumbs

I have a custom list of breadcrumbs that two of the levels reference different Category Groups. I'm able to get the correct breadcrumb to display for the page that I'm on using category.title, but I ...
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 ...
1
vote
2answers
186 views

Matrix with an entries field and need to grab category title

Any help would be greatly appreciated! I hope I explained my situation in enough detail to get the help that is needed. Currently I have two channels that need to share information. This is going ...
2
votes
1answer
37 views

Sorting categories into list put single one at end of it

I'm trying to put a single category (as long as it's populated) at the end of an category list. My code is working so far, is there an easy way to pick out the 'Others' category and append it to the ...
13
votes
2answers
1k views

Difference between categories and structures

The recent updates to categories have been great and provide a lot of flexibility. But now I find myself struggling to decide what should be a category group and what should be a structure. For ...
1
vote
1answer
59 views

Navigating through entries within a category when they belong to multiple

I need some advise on the best way to achieve this. I have entries within a section which could belong to category A, B, C, D. Any of these entries could also belong to a Featured category. Each ...
4
votes
2answers
1k views

Best way to programmatically create categories?

We're working on an XML import plugin to migrate content from another CMS. What's the best way to create a new category (with a name, slug etc.) and assign it to the entry when running $entryModel = ...
2
votes
1answer
273 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
504 views

Search entries by matrix field

I have a matrix inside of which I have 2 fields, 1. dropdown list containing download types and another asset field. I would like to search first by a category and then I would like to further filter ...
2
votes
1answer
2k views

filtering entries by category

I've got my news entries paginated and I have a featured entry on the first page so I'm wondering what the best approach would be to filter by category. Here is what my template looks like: {% ...
2
votes
1answer
227 views

Better way to group by category and include full category entry

The basic idea is that I want to group my entries by category, but I want more than just the category title—I need the entire category entry. My previous post alludes to this, but I've since ...
0
votes
1answer
97 views

Category conditionals

I have an entry page that lists out specific info for a product. I am using categories to sort the entries. I'm trying to figure out how to write a conditional that pulls in something specific if the ...
1
vote
1answer
286 views

How to get Category URL from field in Matrix

This is my Matrix set up: I'm stumped to how to get the Categories URL. {% for block in entry.galleriesItem %} {% switch block.type %} {% case "galleriesItem" %} <a href="...
1
vote
1answer
314 views

Category structure with multiple groups

I need only 2 main categories, A and B, and both can have unlimited subcategories. Ideal would be to split these into groups but how can an editor choose between groups AND only select or create a ...
1
vote
2answers
1k views

Displaying products from a category

New to Craft Commerce and doing something pretty template intensive. I am following this https://craftcommerce.com/support/product-taxonomy and https://craftcommerce.com/support/products-related-to-...
1
vote
1answer
106 views

How can I set up a filter URL like example.com/category/foo/type/bar/country/usa

Given a category based set of entries/products, and a filter system based on tags, how would I accept (one of) the following urls and let one template process them all (not interested in the ...
1
vote
1answer
80 views

Limitation of adding a Category from the CP field modal within an entry

Is there a way to either add a parent selector to the category field modal, or remove/hide the "+ New Category" button when editing an entry? We are using a category group to contain Locations, which ...
1
vote
1answer
415 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->...
1
vote
1answer
108 views

Can someone help me with my site structure? Sections/Category setup

Thank you for your time and patience I'm a newbie to the Craft world. I've been all over the Craft Documentation and this site trying to figure out the best approach for a site I am putting together. ...
1
vote
1answer
236 views

How do you get all the categories in a category group in a controller?

I want to get all the categories in a specific category group inside my controller. How do you do that?
1
vote
2answers
707 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. ...
1
vote
1answer
240 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 ...
2
votes
1answer
609 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-...
1
vote
2answers
138 views

Categories, Single and Channels …SEO

Background... I took a look at this post answered by @Damon My objective is similar. I have a channel for news. Each entry in news is assigned various categories (e.g. product category). I do ...
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 ...
0
votes
1answer
18 views

Move Icon Disappears from Categories editor

The move symbol - the one that allows you to move a category in the list up or down, etc. -- is gone from one of my category groups. It's the one that appears just after the checkbox to select a ...
2
votes
1answer
236 views

What's the trick to importing an entry with a categories field?

We are using Hampsink's Import plug-in (0.8.33) and we have a very simple CSV for testing. One row, three columns. One of these columns contains a comma-separated list of categories. These are top ...
2
votes
1answer
679 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 ...
3
votes
1answer
127 views

How/Can does Craft handle ancestor/grandparent relationships?

I spent a fair amount of time yesterday searching for any other questions that may have been answered that are similar to this one, but haven't had much luck. Essentially what I want to do is to ...
1
vote
1answer
148 views

map values from checkbox field into category field using SQL

In a project I have a checkbox field called gradeLevels with 3 options (k-5,6-8, and 9-12). Due to design changes, I need to convert this field into a category field. I've made a new category with ...

1 3 4 5 6 7 10