Questions tagged [group]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers
83 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 ...
user avatar
1 vote
1 answer
34 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('...
user avatar
  • 1,824
1 vote
1 answer
78 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 ...
user avatar
1 vote
1 answer
106 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 ...
user avatar
  • 3,664
1 vote
1 answer
59 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 %} {% ...
user avatar
1 vote
1 answer
58 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 ...
user avatar
1 vote
1 answer
56 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 ...
user avatar
  • 33
2 votes
1 answer
127 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 (...
user avatar
  • 1,022
1 vote
1 answer
89 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() ....
user avatar
  • 1,824
2 votes
1 answer
34 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 ...
user avatar
0 votes
1 answer
4k 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 ...
user avatar
  • 555
1 vote
1 answer
146 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. {% ...
user avatar
0 votes
1 answer
151 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 ...
user avatar
  • 1,897
1 vote
1 answer
165 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 ...
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() %} {% ...
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....
user avatar
  • 1,311
1 vote
1 answer
41 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....
user avatar
  • 1,075
2 votes
1 answer
85 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 ...
user avatar
  • 145
2 votes
0 answers
44 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', ...
user avatar
  • 3,664
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 ...
user avatar
2 votes
1 answer
372 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 ...
user avatar
1 vote
1 answer
209 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, ...
user avatar
  • 621
3 votes
1 answer
1k 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 ...
user avatar
  • 1,897
1 vote
1 answer
34 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?
user avatar
0 votes
1 answer
393 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 ...
user avatar
3 votes
1 answer
2k 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 ...
user avatar
  • 684
2 votes
1 answer
440 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 ...
user avatar
1 vote
1 answer
90 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() %} {...
user avatar
  • 3,664
3 votes
2 answers
1k 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 ...
user avatar
  • 4,696
3 votes
3 answers
10k 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 ...
user avatar
  • 3,664
1 vote
1 answer
161 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('...
user avatar
  • 584
3 votes
1 answer
642 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 '...
user avatar
2 votes
1 answer
678 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 ...
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 ...
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 ...
user avatar
2 votes
1 answer
264 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 ...
user avatar
  • 2,947
3 votes
1 answer
748 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 ...
user avatar
  • 1,713
3 votes
2 answers
720 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 ...
user avatar
  • 490
2 votes
1 answer
549 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?
user avatar
2 votes
1 answer
778 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 ...
user avatar
3 votes
1 answer
185 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: {% ...
user avatar
1 vote
1 answer
181 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?
user avatar
6 votes
1 answer
843 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 ...
user avatar
3 votes
2 answers
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 ...
user avatar
  • 107
4 votes
1 answer
918 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 ...
user avatar
  • 1,769
2 votes
1 answer
391 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 ...
user avatar
0 votes
1 answer
155 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 ...
user avatar
  • 481
4 votes
3 answers
882 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 ...
user avatar
  • 373
4 votes
1 answer
1k 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 ...
user avatar
  • 1,369
2 votes
1 answer
249 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 = ...
user avatar