contao / docs

Contao Documentation
https://docs.contao.org
Other
31 stars 150 forks source link

Document new `InsertTagsSystem` `[Contao ^5.2.x]` #1379

Closed zoglo closed 5 months ago

zoglo commented 5 months ago

Description

The following PRs:

included a new insert-tags-system in Contao 5.2+. It apparently allows registering insert tags via PHP Annotations.

Examples

Normal usage

#[AsInsertTag('link_url')]

Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Resolver/LinkInsertTag.php#L38-#L117

With fragments

#[AsInsertTag('date', asFragment: true)]

Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Resolver/DateInsertTag.php#L22-#L90

Flags

#[AsInsertTagFlag('number_format')]

Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Flag/FormatFlag.php#L23-#L30

Need more information

The PRs do explain how to use it, I wonder if there is more that I missed? /cc @ausi

ausi commented 5 months ago

Block insert tags

#[AsBlockInsertTag('iflng', endTag: 'iflng')]

Code example: https://github.com/contao/contao/blob/c393ddfb13790de62829b40d94a425ac52b5b618/core-bundle/src/InsertTag/Resolver/IfLanguageInsertTag.php#L23-L25

fritzmg commented 5 months ago

Closing in favor of #1381