html
09.07.2026 | Holger Weischenberg
Hide HTML comments in Chrome and Firefox browser inspector
ternary-example.html.twig
{# Checks if a URL exists and passes it to the component. Otherwise, sets it to false. Works with primitive data types. #}
{% set link = url ? { url: url } : false %}
{# Checks if the media object is not empty and passes it to the component. Otherwise, sets it to false. Suitable for complex data types like objects. #}
{% set media = media is not empty ? { media: media } : false %}
13.11.2025 | Lothar Ferreira Neumann
Use ternary statements in Twig
This is not a thing anymore.
Unfortunately, this was removed in macOS 26. Thus, the DevBit goes internal. Unfortunate – it has been public for a few minutes only. =(
html.html.twig
<!DOCTYPE html>
<html{{ html_attributes }}>
<head>
<head-placeholder token="{{ placeholder_token|raw }}">
<meta name="theme-color" content="#ef9222">
<title>{{ head_title|safe_join(' | ') }}</title>
<css-placeholder token="{{ placeholder_token|raw }}">
<js-placeholder token="{{ placeholder_token|raw }}">
</head>
<body{{ attributes }}>
{#...#}
</body>
</html>
10.09.2026 | Holger Weischenberg
Color the Safari Toolbar
You can add headlines to a webform using the code below. To get to the source section, navigate to the form you want to alter, click on build and then on the source tab like in the screenshot.
This is just a short example on how to add a headline.
webform_headline.yml
personal_data:
'#type': html_tag
'#tag': h3
'#value': 'Personal data'It will look something like this:
13.11.2025 | Lothar Ferreira Neumann
How to place HTML elements into webforms via the Source tab
open_details.js
let details = document.getElementsByTagName('details');
for (i = 0; i < details.length; ++i) {
details.item(i).open = true;
}
13.11.2025 | Peter Gerken