-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdefault.htm
More file actions
36 lines (25 loc) · 1.35 KB
/
default.htm
File metadata and controls
36 lines (25 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{##}
{# You only need the previous line if you use the OctoberCMS Template Language extension in VS Code #}
{# The following line isn't actually required, it just shows you how you can assign a property of this component
instance to a page variable: #}
{% set galleryitems = __SELF__.gallery.items %}
{#
Drop your own code here. For example:
{% for galleryitem in customGallery.gallery.items %}
<div>
<a href="{{ galleryitem.url }}" target="_blank">
<img src="{{ galleryitem.url | resize(280, false, { mode: 'portrait', quality: '90', extension: 'png' }) }}" alt="{{ galleryitem.fileName }}" style="margin: 20px;" />
</a>
</div>
{% endfor %}
Hint: To dig into the gallery (or any other) variable/collection, you have two options.
You can simply add
{{ dump(embeddedGallery.gallery.items.toArray) }}
on your page after the component definition and it will print debug information about that
variable straight in your page. Alternatively, you can install the Debugbar plugin and then add
{{ debug(embeddedGallery.gallery.items) }}
to your page to show debug information in the Laravel debugbar. To see all public properties
of a galleryItem, do:
{{ debug(embeddedGallery.gallery.items.first.toArray) }}.
Make sure to replace "embeddedGallery" with the alias of your component as set in the component options!
#}