Skip to main content

Questions tagged [group]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
33 views

Group matrix blocks by date

I'm trying to group events in a matrix field by day. Each date has a title and start and end time. I would like events for today, tomorrow and any dates beyond grouped separately. This is what I have ...
univers0's user avatar
0 votes
1 answer
41 views

Grouping and ordering entries by month

I need to be able to group dates by their month but then order them by month too because the order they're inserted into the database in na super field table isn't always in date order. So far, I have ...
Tyssen's user avatar
  • 665
1 vote
2 answers
58 views

Group entries by custom fields

I have a section for addresses which has fields for address, state, suburb and postcode. On the front end, I want to display them like this: State 1 - Suburb 1 -- Address 1 -- Address 2 - Suburb 2 -- ...
Tyssen's user avatar
  • 665
1 vote
1 answer
57 views

How to group assets by category/sub-category

I have a section called “products” that has an asset field called “product-docs”. The assets are pdf files that have a Category field. Each product can have many different types of documents; to make ...
Roi Agneta's user avatar
  • 1,463
1 vote
1 answer
57 views

Group/sort by multiple criteria

I have some users: {% set people = craft.users({ groupId: '1', order: 'lastname ASC' }) And two lightswitch fields associated: isLeadership and isActive. This code groups users by ...
4midori's user avatar
  • 668
2 votes
2 answers
192 views

Order entries by related "Year" category and paginate?

I have a section called Library, and a category group called libraryYears. The categories in that group are just years (2021, 2020, 2019...) Each entry in the Library is related to a year in the ...
Mike Mella's user avatar
1 vote
1 answer
36 views

Stuck when grouping entries to get any other parameters like url, id etc

So I am trying to group entries by location and then group entries in this group by weekday. I have this aspect working with the following code: {% set allClasses = craft.entries .section('...
Terry Upton's user avatar
  • 1,894
1 vote
1 answer
103 views

Grouping entries by a custom date conditional

I'm looking to group entries based on a condition between two custom date fields and the current date. I'm not even sure this is possible, but this is how it would appear visually: Happening Now ...
John Johnson's user avatar
1 vote
2 answers
651 views

Group by related entries field

I have a channel of Musical Compositions: Now all these Compositions have a Composer. All the composers are stored in a separate channel and then linked with their respective compositions trough a ...
KSPR's user avatar
  • 3,788
1 vote
1 answer
69 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 %} {% ...
levinDan's user avatar
1 vote
1 answer
63 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 ...
Bruce Johnson's user avatar
1 vote
1 answer
169 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 ...
Kevin's user avatar
  • 33
2 votes
1 answer
167 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 Smart Map field. I'm trying to create an initial display page that groups the resorts based on their state (...
Tim Knight's user avatar
  • 1,022
1 vote
1 answer
112 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() ....
Terry Upton's user avatar
  • 1,894
2 votes
1 answer
35 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 ...
user2190590's user avatar
0 votes
1 answer
6k 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 ...
outline4's user avatar
  • 595
1 vote
1 answer
164 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. {% ...
nonprofit_tech's user avatar
0 votes
1 answer
162 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 ...
CreateSean's user avatar
  • 1,983
1 vote
1 answer
180 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 ...
Evangelos's user avatar
1 vote
1 answer
25 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() %} {% ...
mheavers's user avatar
  • 125
1 vote
1 answer
34 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....
Roi Agneta's user avatar
  • 1,463
1 vote
1 answer
44 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....
kmgdev's user avatar
  • 1,209
2 votes
1 answer
91 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 ...
MikeeBee's user avatar
  • 155
2 votes
0 answers
45 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', ...
KSPR's user avatar
  • 3,788
1 vote
1 answer
1k 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 ...
Steven Thate's user avatar
2 votes
1 answer
384 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 ...
Frank Harrison's user avatar
1 vote
1 answer
251 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, ...
biko's user avatar
  • 680
3 votes
1 answer
2k 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 ...
CreateSean's user avatar
  • 1,983
1 vote
1 answer
36 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?
user6376's user avatar
0 votes
1 answer
515 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 ...
triplethreat23's user avatar
3 votes
1 answer
3k 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 ...
4midori's user avatar
  • 668
2 votes
1 answer
551 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 ...
Darren Wood's user avatar
1 vote
1 answer
97 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() %} {...
KSPR's user avatar
  • 3,788
3 votes
2 answers
2k 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 ...
Damon's user avatar
  • 4,716
3 votes
3 answers
13k 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 ...
KSPR's user avatar
  • 3,788
1 vote
1 answer
174 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('...
Ian Young's user avatar
  • 584
3 votes
1 answer
726 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 '...
Pierre Stoffe's user avatar
2 votes
1 answer
779 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 ...
Rob's user avatar
  • 865
1 vote
0 answers
102 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 ...
Niels's user avatar
  • 75
1 vote
1 answer
1k 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 ...
John Macpherson's user avatar
2 votes
1 answer
277 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 ...
Fred Carlsen's user avatar
  • 2,997
3 votes
1 answer
834 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 ...
Steven Grant's user avatar
  • 1,855
3 votes
2 answers
841 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 ...
portnull's user avatar
  • 490
2 votes
1 answer
614 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?
John Johnson's user avatar
2 votes
1 answer
788 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 ...
Kirk Roberts's user avatar
3 votes
1 answer
196 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: {% ...
Christopher Healey's user avatar
1 vote
1 answer
219 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?
Christopher Healey's user avatar
6 votes
1 answer
884 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 ...
Jake Cattrall's user avatar
3 votes
2 answers
4k 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 ...
smartpill's user avatar
  • 107
4 votes
1 answer
972 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 ...
mmc501's user avatar
  • 1,789