Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

1
vote
0answers
21 views

Showing entries in CP only for specific category

I need to sort structure section entries belonging to specific category (entries have category field). With default structure list displayed in CP, i see all entries for this structure type section ...
0
votes
1answer
33 views

Craft 2 use different template for the same structure

I have a site with projects which each has a projects structure with an associated category and a number of images. The URL is set as projects/{projectCat.first.slug}/{slug} I want to use the ...
0
votes
0answers
12 views

Error in categories after added second language - Craft 3

I had site with one language and some categories. Next I added new language and i have a problem because list of categories in new language wasn't duplicated. What more when I'm inside one of category ...
1
vote
1answer
46 views

How to display the parent category on an entry page?

I have a simple Craft 3 website, with products that are organised in categories. Can someone please tell me how to do the following: On the the individual product pages (_entry.html) display a '...
1
vote
1answer
22 views

Including Entry Property in Object

I'm trying to get the category title to render within the following object but it's just returning it as the static string instead of the {{ category.title }} actually rendering. {% set seo = craft....
1
vote
1answer
24 views

How to hide {{ entry.title }} on a {structure} page but show it on a {structure}/{category-slug} page

Here's the breakdown: » structure with two categories. Each category has +10 entries. » Template is structure / index.html and _entryview.html I'd like to show two links and a description of both ...
1
vote
1answer
25 views

Why are my entries disappearing when {% if category | length %} is added?

Editing an index page that displays all entries within a structure. Everything displays fine. I add a category to a few entries and add {% if category | length %}and everything disappears as if no ...
1
vote
1answer
35 views

Macro for entry loop causing 'null' variable template error

I am new to the concept of Twig templates and I can’t get it right from the documentation … What I am trying to achieve is to have a reusable Blogroll snippet that outputs entries in different ...
1
vote
1answer
36 views

cannot get relatedTo by slug only ID

Can someone tell me why I am going crazy and cannot figure this simple relatedTo issue out? So I have a categories section called Case Studies and several categories within. I am trying to filter the ...
1
vote
1answer
35 views

Categories Structure for Landing Pages

I'm using a category group and routes to serve up entries on landing pages with a URL structure like this. www.domain.com/properties/retail/freestanding My code works, but I am wondering if there's ...
1
vote
1answer
53 views

Switch entry type based on the category

I'm trying to use different entry types for certain categories. My category group is called categories, and the slug for Features is features. I have the category group pointed to categories/_entry. ...
2
votes
1answer
106 views

In Craft 3, (how) can I disable a category on a per site basis?

In the CP, is it possible to disable Category X for site A, and not for Site B? And if so, how?
1
vote
0answers
196 views

How to get list of category groups?

Is it possible to get a list of category groups without having to loop through all categories to get their parent group name? UPDATE: Just making this question clearer, as it's related to using ...
1
vote
1answer
126 views

Setting the page title for a category page

I am trying to get the page title of the categories page. Currently it shows as: category-name, but I would like to have it set to Category Name to match the category.title. My categories/index.html ...
2
votes
1answer
65 views

Displaying entries with pagination on a category page where the entry's last category in the array is the current category

I want to only display entries on the category page which is the last in the array of the entries category, so that it doesn't also show on parent category page. Let say these are my categories: ...
1
vote
1answer
147 views

How to load entries with a certain category only?

I am trying to load entries from a section which have a category field with multiple values. Based on that, I want to show specific entries filtered by category. Example: I have a news section and I ...
1
vote
1answer
161 views

List entries by category

I have a number of entries that all belong under a Channel that I created. Each entry has a category field where the user can select one or many categories to associate the entry with. I am ...
3
votes
1answer
46 views

How to target Sub-Category of Sub-Category

I have 2 Main Groups of Categories, which themselves have Sub-Categories. The Categories you see have checkboxes to filter entries below. One Sub-Group has also Children (With Material/ Without ...
1
vote
1answer
180 views

Element API access param in transformer

Each of my entries has multiple categories (e.g. series, disciplines, and stages). I can get a list of elements related to a single category but I'd also like to get the category information as well (...
1
vote
1answer
58 views

How can I display category title inside another category

I would like to display a list of category. I can display the information inside a category like slug or title. However, I dont know how to display a category field inside a category. {% for ...
2
votes
1answer
281 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
2
votes
1answer
430 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 ...
2
votes
1answer
108 views

loop through an entry's “related entries”, grouped by category

Hope somebody can help us with this: Objective: loop through a given Entry's "Related Entries" entry field and output the results - but group the results by the category to which they belong - not ...
1
vote
1answer
131 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
57 views

Cannot get category.title to show up

{% set slug = craft.request.getParam('s') %} {% if slug | length %} {% set category = craft.categories.slug(slug) %} {% set faqs = craft.entries.section('faq').order('title').limit(null) %} ...
2
votes
0answers
56 views

Assigning category permissions to users

Is there a way to assign category permissions to users so that they can only view/edit those categories? I am currently looking at the following getEditableSections(), however, it's displaying all ...
3
votes
2answers
582 views

How do I display the Category Title?

I need to be able to display the Category Title of a single category (as a h1 tag for a page displaying a list of the entries for that category). I can successfully display the relevant entries for ...
1
vote
0answers
74 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)....
1
vote
0answers
231 views

How to add pagination to a filtered category output?

I've been able to successfully filter a set of entries by category, and also include pagination for the complete set of entries (in this case so 6 are displayed per page). But once a category filter ...
1
vote
0answers
59 views

Output Only Entries from Entry Field Related to a Category

I have a section called "lunchMenu" that contains an entries field ("menuItems"). Each entry in "menuItems" is related to a category in the category group ("foodCategory"). I would like to loop ...
1
vote
1answer
96 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 ...
0
votes
1answer
97 views

Display the next and previous category

The examples I have seen to link to previous and next entry all seem to be for sections. I want to get the previous and next category. My category handler is called 'media'. So I might have entries ...
1
vote
1answer
77 views

Listing related entries to a section

I have two sections: 'reviews' and 'games'. Games has an field called 'GamesReviews' which is type entries and points to 'reviews'. An example of a games entry is located at: http://www....
0
votes
2answers
43 views

Previous and next entries nav – within a categeory

I'm not sure what I've done, I had this working at the top of my entry.html template: {% set params = craft.entries.section('ourWork').relatedTo(category) %} {% set prevEntry = entry.getPrev(params) ...
1
vote
1answer
282 views

Display field from one section in another section

I have two sections: Games Publishers Games has a field called "GamesPublisher" that is a relation (field type "Entries"), the Source is "Publishers". In my template to show an entry from games, I ...
1
vote
0answers
56 views

Get Related entries from Category besides the category of the entry itself

I have two types of related entries for the current entry. Category: Interviews -> Photographer Interviews -> Skateboarder Interviews -> Filmer Interviews -> Owner I am now on an entry with the ...
1
vote
0answers
89 views

Combined searches and filters with a Matrix

I am fairly new to Craft but have managed to build a combined search feature that users can filter from dropdowns. I used this as a guide and it works great: https://webstoemp.com/blog/combined-...
2
votes
1answer
214 views

List Only Child Categories Related to Entries

I need to show a list of Child Categories which only have Entries attached. From about 6 different solutions here, I have assembled the following. It works perfectly on a Section that has < 200 ...
1
vote
1answer
56 views

Using the same title

I have an article called Main Article and I am rolling out the chapters each week (8x). So, each chapter will have the MAIN Article Title AND Chapter Title. eg: Stories from the top of the World; The ...
1
vote
1answer
47 views

How do I output all field values from a Category on the current entry?

I'm building my first site with Craft, so this is a bit newbie question. I've build a category with a some fields. How can I output all fields form the selected category on the current entry? Thank ...
1
vote
1answer
46 views

Could different entities have the same handle?

I'm currently setting up a site. One routine operation there is to 1) create a category group and 2) create a 'Categories' field for it to attach to a section later. Now for safety's sake I'm giving ...
1
vote
1answer
93 views

Category listing.

So I have a categories with sub categories. Anakena (Wine Brand Name) -Ona (Wine line) --product one --product two -Tama (Wine Line) --product one --product two Im trying to make links to the ...
1
vote
2answers
37 views

Entry template category loop repeats URI when HTML added

My entry template looks for the category of the entry {% for category in entry.productCategory %} {{ category.uri }} {% endfor %} This will output products/[category slug] as I intended. ...
1
vote
1answer
54 views

Top level entry url not rendering category in url

I have a structure section called products. The entry url format is products{category.productCategory.first().slug}/{slug} However the category never shows in the preview or real world url (real ...
2
votes
1answer
97 views

Category Entries

Another easy question for you all.... I'm trying to display all entries in a specific category. I'm using the below code from the Craft site, but not sure what I'm missing. I'm replacing the "entries"...
2
votes
1answer
118 views

Image entry in a category template

I'm running into an issue here, hopefully someone can shed some light. I'm in a news category template, {% for entry in craft.entries.section('news').relatedTo(category) %} {% for image in news....
2
votes
1answer
65 views

Relating a Category Entry to a Categories Field Type

I've been trying to get this working but can't seem to find a solution. I have two different types of Categories in a commerce project. Level One Level Two Examples Level One would be Mens, Ladies,...
1
vote
1answer
94 views

Two sections sharing one category group

Just getting starting with templating so apologies if this is obvious. Couldn't find a solution through search. I have set up two sections. These contain different sets of information. I have one ...
2
votes
1answer
637 views

Display entries by category (multiple categories)

I would like to know how I can create a page that contains all entries from a section e.g. 'news'. I want to divide the entries by their given category. News (section) Category 1: entry in ...
0
votes
1answer
1k views

Issue with twig loop.first loop.last contained in nested for statement

I'm trying to pull out selected categories in a front-end user profile. The cats have 2 levels and need to be pulled out into a nested list with only the selected options. I've tried different ways of ...