Important announcements from CouchCMS team
80 posts Page 5 of 8
Previous 1, 2, 3, 4, 5, 6, 7, 8 Next
Hi,
little question - does parameter required='1' work in the cms:globals?
Code: Select all
   <cms:globals>
      <cms:editable
         name='main_slide_animationduration'
         label='label1' desc='desc1'
         type='text'
         validator='non_zero_integer'
         required='1'
         order='200'
         />         
    </cms:globals>


This is not working for me
Thank you
@orbital, I checked and your code is working just fine for me.
Are you sure you visited the template (which has <cms:globals> defined) as super-admin?
KK,
Excuse me, I really did not do that
Thank you
I think I encountered a problem with <cms:globals> - can it be that the placement of the templates within folders (actual ones on the server) are ignored?

Following setup:

/index.php - which handles actual the internal part for registered users
/de/index.php - german version of the site
/en/index.php - english site

Now, I added <cms:globals> to "/de/index.php" first. All seemed to work fine. When accessing them I forgot to place the masterpage correctly and I simply used "masterpage=index.php" - however, this worked and the inserted data is shown.

But when adding <cms:globals> to "/index.php" and "/en/index.php" nothing happens - meaning I don't get the "manage globals" button within couch here. And even calling "<cms:get_global 'whatever' masterpage='en/index.php'/>" gives me what I placed in "/de/index.php".

<cms:globals> with differently named templates work totally fine though.
Hello

I just played with the mosaic tag and I am impressed. But when I include an repeatable with an editable of type image within in a mosaic, the images are shown full with. I was not able to customize the repeatable with config_list_view:

How can I configure the repeatable section within a mosaic?

Regards,
Olliwalli

Attachments

@olliwalli, could you please PM me your template? I'd like to see how you are trying to customize the view.
@KK: Here my template definitions. I do not know how to customize the view for the repeatable section.

Code: Select all
<cms:template title='Seiten' order='10' clonable='1'>

    <cms:mosaic name='blocks' label='Blöcke'>

        <cms:tile name='features' label='Features'>

            <cms:editable name='background' label='Hintergrund-Text' type='text' >EASY AS 123</cms:editable>
            <cms:repeatable name='elements' label='Elemente'>
            <cms:editable name='icon' label='Symbol' desc='SVG-Bild' type='image' />
            <cms:editable name='subtitle' label='Untertitel' type='text' />
            <cms:editable name='title' label='Titel' type='text' />
            <cms:editable name='text' label='Text' type='text' />
         </cms:repeatable>

        </cms:tile>

        <cms:tile name='showcase-gallery' label='Galerie Showcase'>

            <cms:repeatable name='elements' label='Elemente'>
            <cms:editable name='url' label='URL' desc='Link zur Webseite' type='text' />
            <cms:editable name='image' label='Vorschau-Bild' type='image' />
            <cms:editable name='title' label='Bezeichnung' type='text' />
         </cms:repeatable>

        </cms:tile>

    </cms:mosaic>

</cms:template>


Regards,
Olliwalli
With regards to "Template globals" introduced in v2.1

Feature request: please make the template globals available for all types of pages, not just the clonable ones.
It would get eliminate the need of creating a globals.php and make the "Manage Globals" button available on all types of pages.

With regards to "Mosaic" introduced in v2.1

Bug report: depending on your timezone settings, the _checkdate function of class KDateTime in file "/couch/addons/data-bound-form/datetime.php" results in an error message "Publish Date: Invalid Date". This is because the regex doesn't take into account the possible suffix, such as "GMT". As a dirty hack, I added "( \D{3})?" to the end of the regex, making the full line read as follows.
Code: Select all
$pattern = ( $with_time ) ? '/^(\d{4})-(\d{2})-(\d{2}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])( \D{3})?$/' : '/^(\d{4})-(\d{2})-(\d{2})(([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]))?( \D{3})?$/';
Thanks @den0x.

1. I am sorry but I don't think I could understand the point.
For non-clonable templates, we can define any required variables right in the template itself as simple editable regions - cannot do the same with clonable templates as that would result in those regions being available in each cloned page.

We need some variables common to all clonable pages and that is where the 'Template globals' come in. With a non-clonable template, this is a non-issue as there can ever be only one page in such templates.

Please let me know if you have something else in mind.

2. Internally Couch deals with all dates in 'Y-m-d H:i:s' format (e.g. the 'start_on'. 'stop_before' etc. parameters of <cms:pages> accept inputs only in this format). The regex in question caters to this format and, in that capacity, does its job.

What we should perhaps do is add more clearly to the documentation that the date should be in. e.g., 2018-07-12 format.
I was reading up on the approach to use globals.php for a central page to manage all your page captions (https://docs.couchcms.com/tutorials/por ... -ends.html) and I was hoping that the globals approach for clonable templates was going to replace this.

Certainly, I can see the need for clonable templates, to ensure variables are made available throughout, and only defined once. By now having the globals function, I think it would be nice to use it to define globals across all your pages. In this way you would have a single admin page, to manage all global settings (e.g. captions for all your pages, header/sidebar/footer, etc.)

Hope that makes more sense.

As for #2, documenting may clarify, but accounting for the timezone would be an added bonus. My workaround works for me for now, so nothing urgent. UPDATE on #2: In comparing my local changes to the latest commit I realized that I had made the timezone change myself in functions.php for debugging an unrelated issue. Never mind this request/point.
Previous 1, 2, 3, 4, 5, 6, 7, 8 Next
80 posts Page 5 of 8
cron