Forum for discussing general topics related to Couch.
19 posts Page 2 of 2
Almost.
I can see editable area in every single post in couch cms.
couch view.png
view from cms - editable area in every single post
couch view.png (56.98 KiB) Viewed 1175 times

Still cannot see on frontend.
frontend view.png
main blog page - show empty area only
frontend view.png (22.98 KiB) Viewed 1175 times
@pawelbary, I think I can see what is confusing you. Allow me to explain -
as I have tried to elucidate in the docs, when we define an editable region in a clonable template (like blog.php in your case) that region shows up in *all* the pages of that template. So each page can have its own data in that region.

This also means that the value inputted in that region will show up only when viewing a page (because each page has its own data in the region).

In your case you are trying to show the repeatable region in a 'list-view' - there is no single page specified there so Couch does not know which page to get the data from. Do you see the issue? If you show the region in a 'page-view', the videos will show up fine.

Anyway, I suspect you never intended to give each page its own set of videos.
I think what you wanted is a repeatable-region that is 'global' to the entire blog section - i.e. not page specific.

For that, prior to Couch v2.1, we had to use a separate 'global' template (see 'Global values' in https://docs.couchcms.com/tutorials/por ... -ends.html). Now it is simpler - please see 'Template globals' in viewtopic.php?f=5&t=11105

Please use the later method (Template globals) mentioned above.

Hope this helps.
Exactly, this is what I would like to do. Globals are the solution but I do not really understand repeatable part.

Now I can display single video, it works with following code in blog.php and blog_list.html:
Code: Select all
<cms:template title="Blog" clonable="1">
    <cms:editable name="blog_content" type="richtext"/>
.
..
...
<cms:globals>
      <cms:editable name='video' label='Video embed code' type='textarea' no_xss_check='1' >
            <iframe width = "100%" height = "auto" src="https://www.youtube.com/embed/fMf0mrVMGJk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
      </cms:editable>
</cms:globals>
   
   
</cms:template>


and "blog_list.html"
Code: Select all
  <cms:get_global 'video'/>


the problem is when I try to make it repeatable - it is visible only on couch cms in globals but not on frontend:(
Please refer to the docs on 'Template globals' again - it has an example of global repeatable-regions.
@KK I just do not get it..
I changed "blog.php" snippet to:
Code: Select all
<cms:globals>
    <cms:repeatable name='videos' >   
      <cms:editable name='video' label='Video embed code' type='textarea' no_xss_check='1' >
            <iframe width = "100%" height = "auto" src="https://www.youtube.com/embed/fMf0mrVMGJk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
      </cms:editable>
    </cms:repeatable>   
</cms:globals>

..and 'blog_list.html" to:
Code: Select all
        <cms:show_repeatable 'videos' startcount='0' >         
            <cms:get_global "video" />
        </cms:show_repeatable>
     


and it gives editable areas on cms couch, but is not visible on frontend
This is what the docs page states -
For more complex fields (e.g. repeatable-regions), we can use the cms:get_global tag as a tag-pair e.g. as follows -
<cms:get_global 'images'>
<cms:show_repeatable k_field_name >
..
</cms:show_repeatable>
</cms:get_global>

Following which, your code should become -
Code: Select all
<cms:get_global 'videos'>
    <cms:show_repeatable k_field_name >         
        <cms:show video />
    </cms:show_repeatable>
</cms:get_global>

Hope this helps.
Thank you for your patience - it works.
Now I need to figure out how to show videos as a grid:)
@pawelbary, what HTML/JS solution do you have for the grid?
@trendoman it is html layout based on Bootstrap.
JS vanilla and iQuery - but only for some action not the layout thing.
19 posts Page 2 of 2
cron