More examples in the File Fieldtype page

Offen
#1,102 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
46/100
Issue-Typ
Dokumentation
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
php
Bereich
documentation

Rechercherichtung

Start with the File Fieldtype page at docs/fieldtypes/file.html and compare its modifier tag example with the two syntaxes in the issue. Confirm which syntax gives the file title rather than the entry title, then add clear examples to the page showing the expected output. Done means the examples work for the relevant tags and explain when to use each syntax.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Suggested Change
Please add more examples into the File Fieldtype page (https://docs.expressionengine.com/latest/fieldtypes/file.html) ... and honestly, just everywhere in the User Guide.

Reasoning
The one example (https://docs.expressionengine.com/latest/fieldtypes/file.html#using-as-modifier-tags-pairs) that is provided does not work correctly with all of the template tags (for example, does not work with {title} ), therefore you have to make weird workarounds. For example, based on the example this should work:

{news_image:webp}
    <img src="{url}" alt="{title}">
  {/news_image:webp}

Whilst the {url} tag works correctly (returns the .webp file url) ... the {title} tag does not work ... it returns the 'entry' {title}, not the 'file' {title}.

I raised this on Slack, and was told that I had to use the following syntax (which I believe is weird and wrong, but does work).

<img src=“{news_image:webp}” alt=“{news_image}{title}{/news_image}”>

If this is in fact the correct syntax, then it would be good to have a few examples showing this kind of result.

Additional context
I do wonder if this is actually just a bug with the File Fieldtype tags ... and not actually an issue with the docs ... but I honestly don't know, as there are no good examples in the docs!

Vorherrschende Sprache
CSS
Sterne
22
Forks
79
Ø Merge
2 T. 1 Std.
Gemergte PRs (30 T.)
6

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ExpressionEngine/ExpressionEngine-User-Guide

Alle Issues in ExpressionEngine/ExpressionEngine-User-Guide

Ähnliche Issues

Weitere Issues zu Documentation

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.