Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
0 answers
32 views

Get query of autoinjection in case the entry is not found

Is there a way to get the element query which is/was executed by Craft to autoinject the corresponding entry into the template? (even if it fails) I would like to catch it in case of a 404 to return a ...
Matthias Redl-Mann's user avatar
1 vote
2 answers
420 views

Pass parameters to element query as array - in PHP

In Twig, we can do this like this: craft.entries({ id: 11, relatedTo: 22, }) But in PHP code, this does not work: \craft\elements\Entry::find( [ 'id' => 11, ...
Piotr Pogorzelski's user avatar
1 vote
1 answer
873 views

How to build complex Element Criteria?

How to fetch Elements with a complex DB query? E.g. with some nested AND/OR conditions or just apply two conditions to one field? For example my Elements have a field eventDate. I want to fetch all ...
Stalinko's user avatar
  • 113