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

Metadaten ce_download(s) name und caption #3212

Closed
delirius opened this issue Jul 23, 2021 · 5 comments · Fixed by #3356
Closed

Metadaten ce_download(s) name und caption #3212

delirius opened this issue Jul 23, 2021 · 5 comments · Fixed by #3356
Labels
Milestone

Comments

@delirius
Copy link

Affected version(s)

Contao 4.11

Description

Im Modul Downloads (mehrere Dateien) sind die Metadaten name und caption im Template verfügbar (ce_downloads). Und können bei Bedarf ausgegeben werden.

Im Modul Download (einzelne Datei) sind diese nicht verfügbar (ce_download).

@fritzmg
Copy link
Contributor

fritzmg commented Jul 26, 2021

You wrote Contao 4.11, but it's the same in Contao 4.9. It would be a simple change to add the already extracted meta information also to the ce_download template. @contao/developers bugfix or feature?

The only problem I see is: in the downloads content element, the meta information is provided for each file in the files array in the template. For the download element there is no such array obviously so the meta key would then overwrite a previously set meta key.

@ausi
Copy link
Member

ausi commented Jul 27, 2021

For the download element there is no such array obviously so the meta key would then overwrite a previously set meta key.

Adding the line

$this->Template->meta = $arrMeta;

to

$this->Template->title = StringUtil::specialchars($this->titleText);

Shouldn’t be a problem.

Not adding new template variables is not one of our backwards compatibility promises I think.

@fritzmg
Copy link
Contributor

fritzmg commented Jul 27, 2021

Well in theory someone could have extended the DCA of tl_content with a field called meta (for whatever reason). This field would then not be available in the ce_download template, because it gets overwritten with the meta data of the selected file. 🤷‍♂️

@m-vo
Copy link
Member

m-vo commented Jul 27, 2021

But that's a problem with a lot of things, isn't it? The core could even add a new dca field that someone used before. 🙃

@leofeyer leofeyer added the bug label Jul 28, 2021
@leofeyer leofeyer added this to the 4.11 milestone Jul 28, 2021
@fritzmg fritzmg modified the milestones: 4.11, 4.9 Aug 20, 2021
@fritzmg
Copy link
Contributor

fritzmg commented Aug 20, 2021

@leofeyer if it's a bug, it should be for 4.9, no? ;)

@leofeyer leofeyer linked a pull request Aug 20, 2021 that will close this issue
leofeyer added a commit that referenced this issue Aug 20, 2021
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | Fixes #3212
| Docs PR or issue | -

Commits
-------

6fcf71d Make the metadata available in the download element, too
bezin pushed a commit to bezin/contao that referenced this issue Nov 26, 2021
Description
-----------

| Q                | A
| -----------------| ---
| Fixed issues     | Fixes contao#3212
| Docs PR or issue | -

Commits
-------

6fcf71d Make the metadata available in the download element, too
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants