Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Categories are taxonomies for your entries, users, and assets.
2
votes
How do you only show children of “active” parent using categories?
The outline of what you want to do looks reasonable. Here are some details:
{# get the category from the segment #}
{% set parentCategory = craft.categories.slug(craft.request.segment(2)) %}
{# get …
4
votes
Accepted
How do you only show children of “active” parent using categories?
This should work with your current nav:
{% set categories = craft.categories.group('products') %}
<ul id="sideNav">
{% for category in categories %}
{% set thisIsActiveCategory = (category.slug …
2
votes
Display category entries based on Segment?
How do I list the entries related to a category? article on the Craft site should get you headed in the right direction.
You can fetch the entries related to a given category with a little
help …
2
votes
Related category on a single page
When you set up your category, you check the Categories in this group have their own URLs box, and you give the category a URL (suppose it is category/{slug}), and a template (suppose it is category/_entry …
2
votes
Category field in entry
I am guessing that series is your category field. In that case, you are grouping your entries by the title of their first (and only?) category. In the loop
{% for category, catEntries in entries | gr …
4
votes
Accepted
How to separate a parent and it's children when looping through a category?
If you have a 2-level category, and you select one of the nested categories (Los Angeles), what you get in your entry is Los Angeles and its parent (California). … One way to be more explicit about the cities and the states is to loop over just the cities using level to fetch only the categories at a specific level in the category, and then for each city, fetch its …
1
vote
Batch assigning a certain category to existing entries
I just found myself doing this exact thing. The trick is to use saveRelations to set the category.
In my example, my category id is 18840, my field is market, and my section is events.
I created a t …
2
votes
Accepted
Entries from different category levels brought together
What you want is the categories that do not have descendants. I would loop over all the categories, and skip the ones with descendants. …
9
votes
Accepted
How do I list category name?
An ElementCriteriaModel is "used to fetch elements with a given set of parameters." {{ entry.blogCategory }} hasn't yet fetched your category element.
You need:
<p class="category">{{ entry.blogCate …
3
votes
Wrapping my head around Categories
Craft site has the excellent document How do I list the entries related to a category?
Building on that, you would fetch your category (by slug), and then the entries related to the category.
{# Fet …
2
votes
Accepted
How can I get all child categories - of a child category based on url segment?
The first is to check the Categories in this group have their own URLs box in the Category Group settings. …
1
vote
Accepted
Limit category choice in entry to 1 and select child category
You could use a structure for Genre rather than categories. This would let you select Thrillers as a single entry. …
3
votes
Child categories appear as their parent when selected
Do you have a limit of 1 set for the number of categories? … To work around this, you could model the regions with a structure rather than categories. …
2
votes
Accepted
Target first and last items and append if greater than 2
So your code starts to look like this:
{% for category in categories %}
{{category.title}}
{% if not loop.last %}
{{ loop.revindex == 2 ? … ' and' : ',' }}
{% endif %}
{% endfor %}
That code will leave a space before the ,, which you can fix by sticking everything on one line:
{% for category in categories %}
{{category.title}}{% if …
0
votes
Accepted
How to create a user editable dropdown field?
It sounds to me like a category is what you want - you just need to expand the user's concept of what categories are for. … If you want the choices to appear more like a drop down, you could use LJ Dynamic Fields, but you would still probably want to use categories for the underlying choices. …