Attributes - Rendering

Last modified:

Inside template files, all attributes can be accessed using the $attributes or $a variables and the respective ID of the field.

index.php

            <h1><?php echo $attributes['message']; ?></h1>
    <h1><?php echo $a['message']; ?></h1>
Copy
index.twig

            <h1>{{ attributes.message }}</h1>
    <h1>{{ a.message }}</h1>
Copy

Attribute values render false if the field is empty or no option has been selected.

index.php

            <?php if ($a['message']) : ?>
      <h1><?php echo $a['message']; ?></h1>
    <?php endif; ?>
Copy

🍪 This website uses cookies to ensure you get the best experience on our website.

Accept Decline