Skip to main content

Questions tagged [join]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
73 views

How to join sections in craft entry query

I want to join sections foo and bar in a craft entry query. Where foo.id = bar.title. How do I query all records in one go in style like craft.entries.section...?
tenshi's user avatar
  • 101
0 votes
0 answers
45 views

Query multiple users and inner join to assets field

How to query multiple users and join to assets field? I want to query users with IDs [1,3,4] and inner join it to assets field with volumeId 5 and titles [1,3,4]. Tried this but this is probably wrong ...
tenshi's user avatar
  • 101
1 vote
0 answers
97 views

Join multiple tables in element-api

My problem is the following: I have a website with products which contains ratings. I have an element-api endpoint to get the products. I want to sort the products based on the average rating or the ...
Mathies Gielen's user avatar
1 vote
1 answer
59 views

Entries from matrix should not appear in loop

I have a Matrix with an entry field. I have a Loop which is looping entries out of a section. Goal: The entries from the matrix should not appear in the loop of the section. So the Matrix defines ...
Mvrcel Boer's user avatar
2 votes
2 answers
622 views

Element Query matrixfields where

I'm trying to query entries in a section where the (activities) entry has an item in a matrix field timeSlots -> timeSlot -> startDate. The startDate must be >= NOW(). $query = Entry::find()->...
Jeroen's user avatar
  • 308
1 vote
1 answer
646 views

Setting unknown property when trying to join table

I've successfully joined a table to the elements table, however I can't can't seem to add a property so I can use it? Getting the error Setting unknown property when trying to join table Entry::find(...
amof's user avatar
  • 151
1 vote
1 answer
831 views

Joining two plugin tables by reference Id causes duplicates

I'm running a query in which I need to join two tables table_views and table_clicks. Both tables share several column names (mainly refId, month, year and total). However when I try and join these ...
Adam McCombs's user avatar
  • 1,695
2 votes
1 answer
351 views

Sort by MatrixBlock Field / Eager load Matrix Field

Is there currently a way to eager load the matrix values of an element and thus be able to sort by one of its fields? Imagine you have something like the following: $criteria = craft()->elements-&...
Sidney Widmer's user avatar
2 votes
1 answer
295 views

How can I join plugin data with entry data based on uri?

I have a plugin with a record (and model). The record have attributes uri and hits. The uri attribute in my record corresponds to an entry's uri, as stored in the craft_elements_i18n table. What is ...
André Elvan's user avatar
  • 7,288
15 votes
1 answer
1k views

How do you sort elements queried from multiple channels?

This is how I query elements from multiple channels: {% set allEntries = craft.entries.section(['publication','text', 'exhibition']).limit(null) %} I now want to sort all these entries by a custom ...
carlcs's user avatar
  • 36.3k