Questions tagged [categories]

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

Filter by
Sorted by
Tagged with
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
155 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
183 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
505 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
140 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
365 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
704 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
511 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(...
11
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
3answers
953 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
850 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
855 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
984 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
308 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
693 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
2k 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
983 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
466 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 ...
6
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
675 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. ...
8
votes
1answer
2k views

How do I add a subcategory to the URL slug for a channel entry?

I'm trying to mimic the URL structure exactly how I have it in my old CMS. If I select an entry to have both a category and subcategory I would like to have the subcategory in the URL along with the ...
4
votes
1answer
2k views

How to loop through category group and identify those related to entry

Looping through a category group to show links to all the categories. This is an entry page and I want to highlight any categories assigned to the entry. How do I do that? I've tried this so far: {% ...
11
votes
2answers
9k views

Display entries that belong to a category

I have a page that should show entries within a category, and then entries within children of that category. Basically, I need a way to loop through entries that have a level 1 category but not a ...
17
votes
1answer
6k views

How do you list categories in a category group?

I would like to output a list of all the categories in a category group on the front end. How do I do that?

1
6 7 8 9
10