Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [group]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6
votes
1answer
683 views

Paginate Grouped Entries

I am trying to paginate grouped entries as follows... {% set searchParam = craft.request.getParam('q') %} {% set groups = craft.entries({ search: searchParam })|group('section') %} {% for ...
5
votes
2answers
596 views

Is it possible to group entries by checkbox?

We're looking to output a list of entries and group them by their check box values. Here's what we've got so far: {% for checkbox, entries in craft.entries.section('my_entries').find() | group('...
4
votes
1answer
833 views

Group by Field in Matrix Field

Is it possible to group by a field within a matrix field. I have a channel of players which holds their details. I have a structure for teams which includes a matrix field for a Player. The Player ...
4
votes
1answer
849 views

Paginate Entries by Day

This is giving me a surprisingly hard time. Has anyone tried to paginate entries by date, in this case, specifically by day; i.e.: First page loads today's posts, next page loads yesterday's, then the ...
3
votes
3answers
764 views

Need to access year/month variable when grouping entries by date

Having issues trying to access the year & month variable when grouping entries by month-year. The code is outputting the desired results (ie. December 2014), however I would like to format the url ...
3
votes
1answer
618 views

group Matrix blocks and also order by Matrix field for a given block

I'm wondering if I might have a little too much inception madness in my thinking with this problem. Enhancing a site we built for a conference last year. As there's an annual conference each year and ...
3
votes
2answers
3k views

How Do I group entries by Category and retain fixed Category Order?

I found a solution to grouping entries by category here which is working perfectly but I need the categories in the order they were arranged in the categories tab in the Admin panel. Currently, the ...
3
votes
1answer
1k views

Group entries by section

How do I group entries by section? I have search results: {% set entries = allowedSearchableEntries.search(query).order('score').limit(100) %} But I want to have SECTION NAME entry 1 entry 4 entry ...
3
votes
2answers
981 views

How can I group entries based on a dateTime field?

I am getting all entries from a section like this: // get the parent entry. {% set author = craft.entries.section('mySection').authorId(currentUser.id).first() %} // get the child entries from the ...
3
votes
1answer
553 views

Order grouped entries

I need to group and order member profiles alphabetically but I can't get it to work. Have a look here: http://ffsd.de.w0129b45.kasserver.com/mitglieder (It's german but you should get the idea :)) In ...
3
votes
1answer
438 views

Output entries sorted by category title and paginate

I'm stuck on an issue where I have to paginate a list of entries that would be sorted by category title. So basically, I need to: fetch entries in the 'project' section sort those entries by the '...
3
votes
1answer
173 views

Pagination / Custom Routes (Based on Entry Existing)

I've created a custom route for my entries based on week like so: 'events/(?P<year>\d{4})/(?P<week>\d{2})' => 'events/_weekindex', I know i can group entries by week like this: {% ...
3
votes
1answer
909 views

Passing a variable to an include

I have a category listing template where I'm having trouble passing in some variables. top of the template I have this snippet where I'll set the channel and category field name based on the segment ...
2
votes
2answers
5k views

Total sum within loop

I have simple loop: {% for total in thing %} {{ total.seatsKids }} {{ total.seatsParents }} {% endfor %} This results in a string of numbers eg. 1 3 4. I want the sum of all numbers. So how do I ...
2
votes
1answer
223 views

How can I group a list of tags into ranges of first letters (A–E, F–J, etc.)?

I'd like to be able to fetch a list of tags from a blog section and then group them into ranges of letters. I've used this code to fetch and group a list of tags by first letter: {% set entries = ...
2
votes
1answer
346 views

List Categories by 0-9 and A-Z

I'm trying to output a list of Brand names grouped by first letter. But some items have a number or symbol in the name. I want to list first the Numbers and symbols under 0-9 and the rest of the ...
2
votes
1answer
231 views

Outputting Matrix blocks with grouped values based on Entries field id

This is the setup: I have a Matrix field called Breads. There is 1 block called Bread. Within, I have two fields: An Entries field called Selected bread (limited to 1 entry) A Number field called ...
2
votes
1answer
513 views

How do I list the tag groups that are actually in use?

I'm developing a masonry photo gallery with some filters (colors, style, manufacturer, etc) and I want to use tags to filter them by. I need some navigation which should look like this: <ul> ...
2
votes
1answer
456 views

Loop through category groups

I've looped through individual category groups to find each parent/child category, but is there a way to loop through and only show Category Group names?
2
votes
1answer
45 views

Set OrderBy on Grouped Query Involving Smart Map Field

I'm working with a Structure of resort locations. Each resort has a field address which is a SmartMap field. I'm trying to create an initial display page that groups the resorts based on their state (...
2
votes
1answer
22 views

Change order within grouped archive

I have an archive of exhibitions with entries grouped by year. The order of the groups should be descending, the order of the entries within the group should be ascending. For example: The order of ...
2
votes
1answer
72 views

Grouping a large number of entries

I have imported data with 18000+ entries. It's a list of product models with brands associated to each. The product model is being used as the title and the brand field is plain text. There are ...
2
votes
1answer
291 views

Group entries by section, then order and combine sections

I'm grouping search results by section, based on Aaron Berkowitz's answer to this question. My code looks like this: {% set entries = craft.entries({search: {query: keywords} }) %} {% set ...
2
votes
1answer
210 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 ...
2
votes
1answer
548 views

currentUser: Impossible to invoke a method (“isInGroup”) on a null variable

I couldn't find this anywhere else, I'm looking up if the currentUser.isInGroup('verified') and if not, display another link. Works fine when logged in but throws a Template and Runtime error when ...
2
votes
1answer
626 views

Is it possible to create a field group that can be modified across entry types?

Sorry if this is asked/answered elsewhere. I tried to search for it with no success. Suppose I have a common group of fields that I want to include in different entry types, and each entry will have ...
2
votes
0answers
31 views

Efficiently Group a date list

I have a list of dates which are grouped by year and date and also checks if there is a entry in that year: {% set allSubmissions = craft.amForms.submissions( { formHandle: 'reservation', ...
1
vote
1answer
57 views

Grouping entries by category - most efficient approach

I have come up with the following code to group entries by categories; {% set hotTubs = craft.entries() .section('newHotTubs') .orderBy('price asc') %} {% set hotTubsCats = craft.categories() ....
1
vote
1answer
82 views

Group by day does strange exeptions

I have a list of forms which I want to sort by day: {% set groupVerbund = 'datum.day' %} {% set allSubmissions = craft.amForms.submissions({ formHandle: 'reservation', limit: null}).find() %} {...
1
vote
1answer
978 views

Entries grouped by Category and then Sub Category

Been trying to get this working for a few hours but no joy, hope someone can help. I'm looking like an post archive of all entries. Something like Category1 Sub Category 1 Entry / Entry Sub ...
1
vote
1answer
62 views

Grouping by Date (Day) Not Working Correctly

For a week-long schedule, I'm trying to group events that occur on the same day, and also fall into one of two classifications— they are free if a pass is purchased or not included in the pass. {% ...
1
vote
1answer
30 views

Archive Not Returning Correct Date Variable

I'm using the technique for creating an archive that's in the Craft docs: https://craftcms.com/support/entry-archive I'm archiving by day, so my code looks like this: {% set agendaEntries = craft....
1
vote
1answer
647 views

Sort entries in a category via entry field

I have a section for Businesses. I also have categories that these businesses can belong to. On each category page I want to list all the businesses that belong to that category. So far so good, but ...
1
vote
1answer
21 views

Order grouped results by dropdown order

Following this topic, I have an additional question. The results are not ordered by the order of the Dropdown Options. How can I get this done? Code: {% set players = entry.myPlayersMatrix %} {% ...
1
vote
1answer
45 views

List elements grouped by multiple dates

The company whose website I'm building host events, and for each of these events, it is only possible to purchase tickets on certain days, but for each event, there can be more than 1 such day. They ...
1
vote
1answer
107 views

Select query question

I am trying to do the following with craft.entries but I think it may not be possible without a plugin. I have 9 categories with related entries on all of them. I would like to get the latest ...
1
vote
1answer
20 views

error when trying to loop through grouped entries according to dropdown field

I was trying to follow this example from stack overflow to loop through a list of entries and output them by a custom dropdown field {% set allEntries = craft.entries.section('resource').find() %} {% ...
1
vote
1answer
27 views

Using the Group filter with Squarebit Charge plugin

Has anyone had success using the Group filter with Squarebit Charge? I tried a few different approaches, in each case getting array errors. Here is code: {% set allCharges = craft.charge.charges....
1
vote
1answer
148 views

Search entries ordered by sections

Is it possible to perform a search and have the results grouped/prioritized by sections? e.g. something like: craft.entries.section(['sec3', 'sec5', 'sec1']).search(...).limit(6) as page_info, ...
1
vote
1answer
22 views

Can I move existing tags, which are currently in a global tag group, to new the new tag groups I've set up?

I've set up new tag groups to help organise the c300b tags we have set up. How do I move the existing tags, which are already in use, to the new tag groups?
1
vote
1answer
110 views

Date Archives: Last 6 months

From the Creating an Archive Page for Entries article in the Craft docs. How could I limit it so that it grouped by month but limited things to 6 months?: {% set allEntries = craft.entries.section('...
1
vote
1answer
147 views

Paginate by Group

I am trying to group entries based on week and then paginate them the same way. I'm not quite sure how to go about setting each page to be a separate week/group though. Thoughts?
1
vote
1answer
27 views

Grouping entries and ordering by section

Im grabbing entries from two sections and displaying them using the group filter. {% set entries = craft.entries().section('extendedEvents, festivalEvents')%} {% set allEvents = entries %} {% set ...
1
vote
0answers
100 views

Grouping entries by days in matrix field

So this is proving a lot harder than I thought. I have a 'tours' section containing tours, which all have several departure dates. Those dates are in a matrix field, entry.data. So there's only one ...
0
votes
1answer
87 views

Grouping by select - keep order of options

I have a channel of entries that are being pulled into a single. I then want to group the entries by a dropdown field called dealStatus. This is working correctly, however the grouping is not ...
0
votes
1answer
282 views

Get Section Handle From Group

I have a landing page on my site where I want to list a group of sections that have entries. I also need to access the section handle of that same group of sections. I am having problems getting the ...
0
votes
1answer
100 views

Save Group Permissions

I'm trying to programmatically set group permissions. I came across the method saveGroupPermissions(). According to the documentation all you have to do is pass in the group ID and then an array of ...
0
votes
0answers
14 views

Supertable - Group rows by category field

I'm using the supertable plugin and my rows consist out of 3 fields. One of them is a categorie field (the categorie field only consist out of a title). I want to group all my rows by category so ...
0
votes
0answers
15 views

Group entries alphebetically

After copying the "group" docs almost verbatim, I'm trying to sort a list of entries by province and then by city, this what I have: {# See Group docs for info: https://docs.craftcms.com/v2/...
0
votes
1answer
1k views

Order twig array by date and time

I have a section called "events" in which I have a table field that contains dates and times of these events. So I want to order my events by date and within each day by time. I thought of mergin ...