Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
237 views

Selecting categories by first letter

I'm attempting to pull out a list of categories starting with certain letter(s). What I've come up with so far seems a little excessive and I'm wondering if I've missed something obvious. Can it all ...
3
votes
1answer
143 views

How to handle 'related' categories within import script

So I'm attempting to hack together a script to import thousands of entries and hundreds of categories from a bespoke system. I have imported all the categories (around 800 of them) successfully. The ...
1
vote
1answer
243 views

What is the best way to have an entry for top-level categories?

I'm currently working on an eCommerce project with categories for products: - Category 1 - Sub-category 1 - Sub-category 2 - Sub-category 3 - Category 2 - Sub-category 1 - Sub-...
1
vote
1answer
632 views

Linking to Search Results

Ok what i'm trying to achieve is a set of links which have "search parameters" attached to them. Which would be a "category" and an "option.field". Then when these links are clicked they display ...
0
votes
2answers
258 views

Category ID not being returned

So, in my template I get what I'm calling parentCategory, and I can output what I need: {% set parentCategory = craft.categories.slug(craft.request.getSegment(2)) %} {# parentCategory.title and ...
0
votes
1answer
768 views

Listing Sub Categories of a Category related to an entry

I've been scratching my head over this for awhile and I can't seem to solve it. What I'm after is the following. I have various categories with numerous sub categories. I'd like to be able to ...
0
votes
0answers
20 views

Is it possible to add a category to an object through twig? [duplicate]

I'm currently working on a registration page for users on a site. There are two attributes that users may have on sign up that I need to reflect in the sign up process. (I will probably use ...
2
votes
1answer
3k views

Get entries which have a certain category assigned to them

So, i have a channel called images and a couple of category groups one of which is called "images" which has categories called family, animals, individuals in it. So, i just want to grab the entries ...
1
vote
1answer
1k views

How can I get blog categories and blog entry urls to play nice together?

I'm building a simple blog that has the ability to publish entries: Within a set of categories. With no category set. The URL format of a blog entry is /blog/YYYY/MM/DD/{slug} Everything so far ...
1
vote
1answer
2k views

Display entries related to a category (only bottom level)

I have a 2 level category system. Some have children, some do not. How can I display entries related to the last level only? If a category has no children, it should show the entries related to the ...
3
votes
1answer
803 views

How do I output entries by their category?

Ok, so basically I want to loop through categories and output the title of each category along with all the associated entries. Like so: Category 1: Entry 1 Title, Entry 3 Title Category 2: Entry 2 ...
0
votes
1answer
461 views

Import Entries with Categories

I posted this on github already but I thought I would ask her as well to see if anyone has any ideas Im trying ot do a simple import of some organizations with categories and parent organization ...
4
votes
1answer
252 views

Getting entries related to all of supplied categories, if they exist

I'm trying to get all entries that related to one .. three categories, as determined whether their id appears in the query string: {% set sector = craft.categories.id(craft.request.getQuery('sector'))...
2
votes
0answers
74 views

Showing entries based on parameters that may or may not be populated [duplicate]

I'm using a Matrix Field to display lists of entries. One extracts entries based on certain categories. They may or may not be set, but I need to use an "and" relatedTo parameter. At the moment it ...
2
votes
2answers
2k views

Sorting categories by the post date of the entries related to them

I need to sort my categories based on the date of entries returned within the category. I am trying to sort sermons from a church by the series they were contained within. I have the sermons grouped ...
4
votes
2answers
668 views

How to query with relatedTo of a Relationship Field in a Matrix Field block

I have structures called Instrument and Person. On the person structure, I have a Matrix field called Roles. Roles has a block called Musician. And That block type has a Relationship Field called ...
3
votes
3answers
717 views

Porting from EE - How to filter by category/segment in one template

Sorry if there is an answer out there for this, I've read quite a few posts but have got myself confused. I hope you can point me in the right direction. I have this code in my EE template: {exp:...
2
votes
1answer
842 views

Category as select dropdown box

Im trying to setup a front end user form with a category as a select box. The box looks right but when i submit the form i get a new entry and other fields are filled out but the catgory fields are ...
9
votes
1answer
3k views

How to list entries related to a category + related to a section?

Sorry if this has been asked before. I've searched for other relatedTo questions but could not find anything similar. I have 2 sections (each having 1 entry type): games reviews Games are linked ...
1
vote
1answer
428 views

entries related To category not working with getNext function

I currently have one entry in a page and would like to display next and previous arrows. The next/previous entries should be in the same section and related to the same category. To do this I have ...
7
votes
1answer
708 views

Filtering/searching for entries by category in the control panel

Is there any way of filtering by category in the control panel entries list? Likewise, is there for an "entries" field (like how Playa lets you filter by channel, category)?
2
votes
1answer
880 views

List all entries in a section filtered by given category groups

I've got a section called 'web development' and there are four categories that apply to it. Three can be grouped together as 'original content' and one is a link list to external third party content. ...
2
votes
1answer
474 views

How can an entry type have its own search and categories?

I have an entry type whose content will be separated from the main content. So I was wondering how can we give an entry type its own search and categories? Possible?
1
vote
1answer
1k views

How do I get entries of a child category, related to a parent category, defined in a URL segment?

My entry url structure looks like this: http://site.com/section/category/subcategory/entry_slug I'm trying to drill down to specific entries by using the url structure and I'm currently having ...
11
votes
2answers
3k views

Advanced Search

Not sure of the best way to progress with this but i'm trying to create an advanced search on a Craft site. What it needs is a select dropdown for Authors, Categories and a normal text input. The ...
2
votes
1answer
153 views

How do I find the category an entry belongs to?

I have a channel with entries which have a category field which is required. When the entries are listed on a page how do I find the category that it belongs to? {% for entry in entries %} <...
2
votes
1answer
175 views

Related category on a single page

Been trying for days to figure this one out. How do I extract entries from a channel and display only entries related to a category? How do I pull in the related photo? I have this code below but it ...
4
votes
1answer
457 views

Assign Category via Guest Entry Form

Is is possible to assign a category via a frontend Guest Entry form. I tried <input type="hidden" name="fieldHandle" value="SomeExistingCategorySlug"> But that did not work.
1
vote
0answers
17 views

How do I omit a page with just a catagory [duplicate]

I have a channel with content and I want to only display content from a certain category. Should I use a slug? Just trying to wrap my head around this. This is what I have now: {% for product ...
3
votes
1answer
139 views

High volume category list causes slow load

My customer has 3500 categories in a 3 level hierarchy. This is causing some significant pain when adding categories to an entry. The server delivers the categories via ajax in 9sec, but the browser ...
2
votes
1answer
173 views

Wrapping my head around Categories

I have a category group set up called 'gists'. I have entries that contain a category field which pulls in the category group 'gists'. Now I need to access entries that are tied to individual ...
2
votes
2answers
320 views

Showing specific category content as well as ALL

I have a photography website with just two categories, 'Lifestyle' and 'Food'. I have two problems: How to display the content I have a category group called 'photoCategories' to which I have ...
3
votes
1answer
677 views

Assign entries to categories in bulk?

I just accidentally dragged a root category onto another. Now, all of the entries that were assigned to that category are assigned to the one I accidentally dragged it onto. Luckily, I have like 7 ...
8
votes
2answers
465 views

Is there any way of specifying a default category for a category field?

I've set up a channel using categories to distinguish between different blog post types. The majority will probably be in one category, so it would be great to be able to specify a default category. ...
13
votes
1answer
6k views

Get category title by slug

I'm setting my categories by matching the third segment to a category slug. How do I get the category title? {% set catSlug = craft.request.getSegment(3) %} {% set category = craft.categories.slug(...
10
votes
1answer
1k views

Check to see if category is populated?

I want to list all categories that have an entry assigned to them, but hide the ones that are empty. In EE I could do this show_empty="no" But I can't see a parameter in the docs for Craft. ...
2
votes
2answers
846 views

How do I conditionally set active state in category navigation?

Here is the code I am trying to use to set an active state for category navigation: {% for category in categories %} <li {% if craft.request.segment(2) == "{{ category.slug }}" %}class=...
4
votes
2answers
770 views

Is it possible to limit users to adding/editing entries in specific categories?

I'm building a site that regroups several properties, and I'd like each manager to edit content in his property only. All properties use the same templates and share content between each other. I ...
5
votes
1answer
849 views

Display category entries based on Segment?

I'm really struggling to display entries of a category, based on the segment. In other words, I have 1 category template, so the category needs to be determined dynamically (*we still do this by ...
2
votes
2answers
964 views

How do I list category name?

Forgive the simplicity of this question but I am in the early stages of my first Craft implementation. My simple question is: how do I display a category name in a template. This is the code I am ...
2
votes
2answers
304 views

Sharing a template with identical category and tag name

I'm trying to stay as DRY as possible here and sharing one template for a news list view; all, category and tag all sharing the same template (and trying to refrain from having a category or tag ...
3
votes
2answers
664 views

Submitting checkbox data from a front-end form for a 'Categories' Field Type

I have read a few docs about front-end forms such as the Checkbox field docs. Although that doc doesn't seem to give an example of what I need. I have a 'categories' field type. I am creating a ...
6
votes
2answers
2k views

How can I create a simple loop through entries in a category?

I have a category set up and have added entries to it. How do I loop through these entries, and output just the title of each entry? Serious noob here but trying to learn, any help would be ...
2
votes
2answers
1k views

How do you only show children of “active” parent using categories?

I'm currently using Categories to organize an inventory of products. The hierarchy is straightforward: category, subcategory, and single product entry. The url structure I'm are hoping to use reflects ...
12
votes
2answers
1k views

How to find entries with no category

I have a field categories in a channel news, and I want to find all the entries in news that don't have a category set. I know I could loop over the entries and find them that way, but I'm hoping to ...
4
votes
1answer
925 views

Sections, Categories, and EntryTypes. Which, when?

bit of a 'best practice' question, as I'm very sure there are many ways to do this sort of thing, but... When/how do you decide whether to use a section, category, or entry type to organise your ...
2
votes
1answer
441 views

How to list the latest 3 entries per category per section?

I'm trying to create a condensed overview of my website content on my homepage. I'd like that page to loop through all sections, in each section looping through the categories that apply to the ...
5
votes
3answers
1k views

How can I display the related posts (by category) at the bottom of each post?

I'm converting a WordPress blog to Craft - first time playing with categories in Craft, so how can I display the related posts (by category) at the bottom of each post?
4
votes
1answer
2k views

Listing categories alphabetically & total post count

How do I list all categories in use alphabetically? And how to get the total post count from each category? Cheers
4
votes
1answer
648 views

How do you import hierarchical data that uses the adjacency list model into Craft Structures or Categories?

Craft makes it nice and easy for us to have hierarchy in Structures or Categories. Many other popular CMS platforms support hierarchical data as well but some support it using a different data model. ...