Very interesting...

So, if I add a Header block called "header1" and a Text block called 
"text1", are those fields directly addressable using something like 
"blk.name"? 

For instance, I see in "_block_view_page_inline.tpl 
<https://github.com/zotonic/zotonic/blob/master/apps/zotonic_mod_zotonic_site_management/priv/skel/blog/priv/templates/blocks/_block_view_page_inline.tpl>
":

    {% for blk in id.blocks %}
        {% if blk.type == "header" %}

Is there a blk.name variable associated with the name of the block added? 
If so, can you recommend how to address each block via name directly?

What I am hoping to achieve is to have one resource with multiple Header 
and Text blocks, but I need to address each one directly, to display in a 
particular place in the HTML layout. However, I am unsure how to display a 
specific blk by name, rather than listing them all as the above example 
shows.

The flexibility you built into the system is impressive, but I am still 
learning my way around...

On Saturday, January 13, 2024 at 5:14:14 AM UTC-7 Marc Worrell wrote:

> Hi!
>
> There are nested in the “blocks” property. 
>
> You can check the _blocks.tpl here:
>
>
> [image: zotonic.png]
>
> zotonic/apps/zotonic_mod_base/priv/templates/_blocks.tpl at master · 
> zotonic/zotonic 
> <https://github.com/zotonic/zotonic/blob/master/apps/zotonic_mod_base/priv/templates/_blocks.tpl>
> github.com 
> <https://github.com/zotonic/zotonic/blob/master/apps/zotonic_mod_base/priv/templates/_blocks.tpl>
>
> <https://github.com/zotonic/zotonic/blob/master/apps/zotonic_mod_base/priv/templates/_blocks.tpl>
>
>
> Cheers, marc 
>
>
> Sent from my iPhone
>
> On 11 Jan 2024, at 21:51, 'Seann Aswell' via Zotonic developers <
> [email protected]> wrote:
>
> 
>
> Another question...
>
> In the admin there is the option of adding content blocks to resources, 
> which seems really handy. 
>
> How can I address the additional blocks in HTML? I am obviously missing 
> something, as I do not see any properties defined in m_rsc 
> <https://zotonic.com/docs/1278/m_rsc> regarding content blocks.
>
> Currently on a few webpages, I have added multiple resources and called 
> {id.body} multiple times in HTML to achieve the same affect...
>
> -- 
>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Zotonic developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/zotonic-developers/971f861c-3850-4fe1-b1fc-815c4d6ba794n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/zotonic-developers/971f861c-3850-4fe1-b1fc-815c4d6ba794n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Zotonic developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/zotonic-developers/f442e3c8-8ef6-4b9a-b8f9-5425de3acbe7n%40googlegroups.com.

Reply via email to