Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 0 additions & 77 deletions docs/dev/reference/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ class Example
Not directly related to Contao, but this helper service from Symfony lets you retrieve
the current Contao front end or back end user from the firewall.

{{< tabs groupid="services-contao4-contao5" style="code" >}}
{{% tab title="Contao 4" %}}
```php
use Contao\BackendUser;
use Contao\FrontendUser;
Expand Down Expand Up @@ -304,50 +302,6 @@ class Example
}
}
```
{{% /tab %}}
{{% tab title="Contao 5" %}}
```php
use Contao\BackendUser;
use Contao\FrontendUser;
use Symfony\Bundle\SecurityBundle\Security;

class Example
{
public function __construct(private readonly Security $security)
{
}

public function execute()
{
// Check for admin back end user role
if ($this->security->isGranted('ROLE_ADMIN')) {
// …
}

// Check for regular back end user role
if ($this->security->isGranted('ROLE_USER')) {
// …
}

// Check for front end user role
if ($this->security->isGranted('ROLE_MEMBER')) {
// …
}

// Get current back end user
if (($user = $this->security->getUser()) instanceof BackendUser) {
// …
}

// Get current front end user
if (($user = $this->security->getUser()) instanceof FrontendUser) {
// …
}
}
}
```
{{% /tab %}}
{{< /tabs >}}

If you only need to check the authorization you can inject the `AuthorizationCheckerInterface` instead:

Expand Down Expand Up @@ -426,8 +380,6 @@ class Example

This service allows parsing *simple tokens*. See the [usage examples][SimpleTokenUsage] from the tests for more details.

{{< tabs groupid="services-contao4-contao5-simple-token-parser" style="code" >}}
{{% tab title="Contao 4" %}}
```php
use Contao\CoreBundle\Util\SimpleTokenParser;

Expand All @@ -453,35 +405,6 @@ class Example
}
}
```
{{% /tab %}}
{{% tab title="Contao 5" %}}
```php
use Contao\CoreBundle\String\SimpleTokenParser;

class Example
{
public function __construct(private readonly SimpleTokenParser $parser)
{
}

public function execute()
{
// Token replacement
$output = $this->parser->parse(
'I like ##cms##.',
['cms' => 'Contao']
);

// Conditional expressions
$output = $this->parser->parse(
'This is {if value>=10}big{else}small{endif}',
['value' => 20]
);
}
}
```
{{% /tab %}}
{{< /tabs >}}


### Extending the parser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,6 @@ Im Modus »Mehrere bearbeiten« kommen weitere Kürzel hinzu:
Elemente können durch Anklicken in den Bearbeitungsmodus geschaltet werden, ohne dass dazu das Bearbeiten-Icon
verwendet werden muss. Folgende Aktionen werden unterstützt:

{{< tabs >}}
{{% tab title="Contao 5+" %}}
Windows:
- `[Ctrl] + Klick`: das Element bearbeiten
- `[Ctrl] + [Shift] + Klick`: die Kinder-Elemente bearbeiten

macOS:

- `[Cmd] + Klick`: das Element bearbeiten
- `[Cmd] + [Shift] + Klick`: die Kinder-Elemente bearbeiten
{{% /tab %}}

{{% tab title="Contao 4" %}}
Windows:
- `[Ctrl] + Klick`: das Element bearbeiten
- `[Ctrl] + [Shift] + Klick`: die Elementeinstellungen bearbeiten
Expand All @@ -88,8 +75,6 @@ macOS:

- `[Cmd] + Klick`: das Element bearbeiten
- `[Cmd] + [Shift] + Klick`: die Elementeinstellungen bearbeiten
{{% /tab %}}
{{< /tabs >}}


## Tastaturkürzel unter Windows, Linux und Mac {#tastaturkuerzel-unter-windows-linux-und-mac}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,6 @@ Further abbreviations are added in "Edit multiple" mode:

You can edit elements by clicking them, without having to use the edit icon. The following actions are supported:

{{< tabs >}}
{{% tab title="Contao 5+" %}}
Windows:

- `[Ctrl] + click`: edit the element
- `[Ctrl] + [Shift] + click`: edit the element's children

macOS:

- `[Cmd] + click`: edit the element
- `[Cmd] + [Shift] + click`: edit the element's children
{{% /tab %}}

{{% tab title="Contao 4" %}}
Windows:

- `[Ctrl] + click`: edit the element
Expand All @@ -87,8 +73,7 @@ macOS:

- `[Cmd] + click`: edit the element
- `[Cmd] + [Shift] + click`: edit the element settings
{{% /tab %}}
{{< /tabs >}}


## Keyboard shortcuts under Windows, Linux and Mac

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ Download-Dateitypen« festgelegt hast.

### Template-Einstellungen

{{< tabs groupid="contao-version" style="code" >}}
{{% tab title="Contao 4" %}}
**Inhaltselement-Template:** Hier kannst du das Inhaltselement-Template `ce_download` überschreiben.

**HTML-Ausgabe**
Expand All @@ -86,25 +84,6 @@ Das Element generiert folgenden HTML-Code:
</p>
</div>
```
{{% /tab %}}
{{% tab title="Contao 5" %}}
**Inhaltselement-Template:** Hier kannst du das Inhaltselement-Template `content_element/download` überschreiben.

**HTML-Ausgabe**
Das Element generiert folgenden HTML-Code:

```html
<div class="download-element ext-pdf content-download">
<a href="…" title="Die Datei … herunterladen" type="application/pdf">…</a>
<figure>
<a href="…" data-lightbox="…" class="cboxElement">
<img src="…" alt="" srcset="…" sizes="…" width="…" height="…" loading="lazy" class="…">
</a>
</figure>
</div>
```
{{% /tab %}}
{{</tabs>}}


## Downloads
Expand Down Expand Up @@ -178,8 +157,6 @@ Download-Dateitypen« festgelegt hast.

### Template-Einstellungen

{{< tabs groupid="contao-version" style="code" >}}
{{% tab title="Contao 4" %}}
**Inhaltselement-Template:** Hier kannst du das Inhaltselement-Template `ce_downloads` überschreiben.

**HTML-Ausgabe**
Expand All @@ -199,26 +176,3 @@ Das Element generiert folgenden HTML-Code:
</ul>
</div>
```
{{% /tab %}}
{{% tab title="Contao 5" %}}
**Inhaltselement-Template:** Hier kannst du das Inhaltselement-Template `content_elements/downloads` überschreiben.

**HTML-Ausgabe**
Das Element generiert folgenden HTML-Code:

```html
<div class="content-downloads">
<ul>
<li class="download-element ext-jpg">
<a href="…" title="Die Datei … herunterladen" type="image/jpeg">…</a>
<figure>
<a href="…" data-lightbox="…" class="cboxElement">
<img src="…" alt="" srcset="…" sizes="…" width="…" height="…" loading="lazy" class="…">
</a>
</figure>
</li>
</ul>
</div>
```
{{% /tab %}}
{{</tabs>}}
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ file types".
### Template settings


{{< tabs groupid="contao-version" style="code" >}}
{{% tab title="Contao 4" %}}
**Content element template:** Here you can overwrite the content element `ce_download` template.

**HTML Output**
Expand All @@ -83,25 +81,6 @@ The element generates the following HTML code:
</p>
</div>
```
{{% /tab %}}
{{% tab title="Contao 5" %}}
**Content element template:** Here you can overwrite the content element `content_element/download` template.

**HTML Output**
The element generates the following HTML code:

```html
<div class="download-element ext-pdf content-download">
<a href="…" title="Die Datei … herunterladen" type="application/pdf">…</a>
<figure>
<a href="…" data-lightbox="…" class="cboxElement">
<img src="…" alt="" srcset="…" sizes="…" width="…" height="…" loading="lazy" class="…">
</a>
</figure>
</div>
```
{{% /tab %}}
{{</tabs>}}


## Downloads
Expand Down Expand Up @@ -169,8 +148,6 @@ types".

### Template settings

{{< tabs groupid="contao-version" style="code" >}}
{{% tab title="Contao 4" %}}
**Content element template:** Here you can overwrite the content element `ce_downloads` template.

**HTML Output**
Expand All @@ -190,26 +167,3 @@ The element generates the following HTML code:
</ul>
</div>
```
{{% /tab %}}
{{% tab title="Contao 5" %}}
**Content element template:** Here you can overwrite the content element `content_elements/downloads` template.

**HTML Output**
The element generates the following HTML code:

```html
<div class="content-downloads">
<ul>
<li class="download-element ext-jpg">
<a href="…" title="Die Datei … herunterladen" type="image/jpeg">…</a>
<figure>
<a href="…" data-lightbox="…" class="cboxElement">
<img src="…" alt="" srcset="…" sizes="…" width="…" height="…" loading="lazy" class="…">
</a>
</figure>
</li>
</ul>
</div>
```
{{% /tab %}}
{{</tabs>}}
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ Suchmaschinen ausgewertet und sind daher ein wichtiges Instrument der Onpage-Opt

### Template-Einstellungen

{{< tabs groupid="contao-version" style="code" >}}
{{% tab title="Contao 4" %}}
**Inhaltselement-Template:** Hier kannst du das Inhaltselement-Template `ce_hyperlink` überschreiben.

**HTML-Ausgabe**
Expand All @@ -86,33 +84,6 @@ Wird ein Bildlink verwendet, sieht die HTML-Ausgabe wie folgt aus:
</figure>
</div>
```
{{% /tab %}}
{{% tab title="Contao 5" %}}
**Inhaltselement-Template:** Hier kannst du das Inhaltselement-Template `content_element/hyperlink` überschreiben.

**HTML-Ausgabe**
Das Element generiert folgenden HTML-Code:

```html
<div class="content-hyperlink">
<a class="…" href="…" title="…" data-lightbox="…" target="_blank" rel="noreferrer noopener">…</a> …
</div>
```

Wird ein Bildlink verwendet, sieht die HTML-Ausgabe wie folgt aus:

```html
<div class="content-hyperlink">
<figure>
<a class="…" href="…" title="…" data-lightbox="…" target="_blank" rel="noreferrer noopener">
<img src="…" alt="…" title="…" height="…" width="…">
</a>
<figcaption>…</figcaption>
</figure>
</div>
```
{{% /tab %}}
{{</tabs>}}


## Top-Link
Expand All @@ -129,8 +100,6 @@ Standardbezeichnung »Nach oben« verwendet.

### Template-Einstellungen

{{< tabs groupid="contao-version" style="code" >}}
{{% tab title="Contao 4" %}}
**Inhaltselement-Template:** Hier kannst du das Inhaltselement-Template `ce_toplink` überschreiben.

**HTML-Ausgabe**
Expand All @@ -141,17 +110,3 @@ Das Element generiert folgenden HTML-Code:
<a href="#top" title="Nach oben">Nach oben</a>
</div>
```
{{% /tab %}}
{{% tab title="Contao 5" %}}
**Inhaltselement-Template:** Hier kannst du das Inhaltselement-Template `content_element/toplink` überschreiben.

**HTML-Ausgabe**
Das Element generiert folgenden HTML-Code:

```html
<div class="content-toplink">
<a href="#top" data-toplink="" title="Nach oben">Nach oben</a>
</div>
```
{{% /tab %}}
{{</tabs>}}
Loading