Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluation setting context #707

Open
ausi opened this issue Apr 12, 2021 · 2 comments
Open

Evaluation setting context #707

ausi opened this issue Apr 12, 2021 · 2 comments

Comments

@ausi
Copy link
Member

ausi commented Apr 12, 2021

The picker input type supports the evaluation context like 'eval' => ['context' => 'dc.tl_content']. This is currently not documented.

Related: #687 #656

@fritzmg
Copy link
Contributor

fritzmg commented May 14, 2022

Is 'eval' => ['context' => 'dc.tl_content'] any different from 'relation' => ['table' => 'tl_content']? /cc @aschempp

@aschempp
Copy link
Member

aschempp commented Jun 22, 2022

The context is not necessarily a table, but it tells the picker what should be picked. The default picker context is link, which is what we use to "pick" insert tags for a text field. Any picker can support any context, and multiple pickers can support the same context. That's how a link can be picked for news, articles, events or pages.

The dc. is a special prefix for the Universal Picker Widget that can pick from any DCA table (if its driver supports pickers). The universal picker widget will use the related table as dc. context if no context is given.

As an example, the FilePickerProvider also supports the file context, where you can pick files that might not belong to tl_files yet. And e.g. https://extensions.contao.org/?p=terminal42%2Fcontao-bynder supports the file context as well, which means with that extension anyone picking files can pick something from a remote system (in this case it will transparently download the file in the background).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants