Verwendung: Filter foreignKey

Martin's Avatar


02 Nov, 2020 10:21 PM

Produkt: Custom Elements Contao

I have a custom element the offers a list of all Contao News Headlines:
'foreignKey' => 'tl_news.headline',

Now I wold like to filter and show only news, that have an Podcast. ('tl_news.podcast').

As far as I understand, I should do alike with 'options_filter'.
Is that possible, and what would the code look like?

Thank you,

  1. Support Staff 1 Posted by RockSolid Theme... on 03 Nov, 2020 09:21 AM

    RockSolid Themes's Avatar

    Vielen Dank für Ihre Frage.

    Eine options_filter-Option ist uns nicht bekannt. Für eine gefilterte Liste können Sie den options_callback benutzen und den gewünschten SQL-Query darin selbst ausführen.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac