Hy Leute,
PHP-Code:
{{figure.metadata.caption}}
Funktioniert wunderbar aber wenn ich die link Attribute erweitere, wird es als unkomplizierter Text ausgegeben.
PHP-Code:
{% set link_attributes = attrs(link_attributes|default).set('data-caption', "{{figure.metadata.caption}}") %}
Spielt keine Rolle ob einfache oder doppelte Anführungszeichen
PHP-Code:
a href="/files/01.jpeg" data-lightbox="lb36190" data-caption="{{figure.metadata.caption}}" role="button">
Was ich zusätzlich nicht verstehe wie mit dump hilft - bzw. wie würde ich in der Praxis es schaffen auf Metadata zu kommen? Das ist für mich ein wenig ein generisches Kauderwelsch
PHP-Code:
array:36 [?
"figure" =>
Contao\CoreBundle\Image\Studio
\
Figure {#1186 ?}
"items" => array:3 [?]
"type" => "gallery"
"template" => "content_element/gallery/gallery_grid"
"as_editor_view" => false
"data" => array:115 [?]
"nested_fragments" => []
"section" => "main"
"properties" => []
"element_html_id" => ""
"element_css_classes" => ""
"headline" => array:2 [?]
"sort_mode" => null
"randomize_order" => false
"limit" => 3
"images" => array:3 [?]
"items_per_page" => 3
"items_per_row" => 4
"contao" =>
Contao\CoreBundle\Twig\Global
\
ContaoVariable {#2111 ?}
"request_token" => Stringable@anonymous {#1965 ?}
"app" =>
Symfony\Bridge\Twig
\
AppVariable {#2010 ?}
"attributes" =>
Contao\CoreBundle\String
\
HtmlAttributes {#2702 ?}
"list" => array:21 [?]
"tag_name" => "ul"
"number_of_items" => 3
"limit_elements" => false
"number_of_pages" => 1.0
"add_pagination" => false
"list_attributes" =>
Contao\CoreBundle\String
\
HtmlAttributes {#2725 ?}
"_parent" => array:28 [?]
"_seq" => array:3 [?]
"loop" => array:8 [?]
"item" =>
Contao\CoreBundle\Image\Studio
\
Figure {#1186 ?}
"_key" => 0
"figure_attributes" =>
Contao\CoreBundle\String
\
HtmlAttributes {#2743 ?}
"link_attributes" =>
Contao\CoreBundle\String
\
HtmlAttributes {#2755 ?}
]