I'm new to the template based possibilities with Twig and Doctrine and have to say it's a pleasure to work with.
But now i have a question:
How can i filter the results of the content.related() Query?
My actual Twig query looks like this and lists all Entries in the actual Page:
- Code: Select all
{% set multiplecontent = content.related('entries') %}
Now i need to filter the list of entries by a "filter"-string.
I have no idea how to insert such an additional Query in this.
In SQL i would do something like
- Code: Select all
.. AND title LIKE '%searchedword%''
The defined contenttypes:
- Code: Select all
pages:
name: Pages
singular_name: Page
fields:
title:
type: text
class: large
required: true
index: true
slug:
type: slug
uses: [ title ]
...
entries:
name: Entries
singular_name: Entry
fields:
title:
type: text
class: large
slug:
type: slug
uses: title
relations:
pages:
multiple: false
order: title
label: Page
Does anyone has an idea?