Forum for discussing general topics related to Couch.
2 posts Page 1 of 1
UPDATE: split each day into its own repeatable region and used buffers to do it, as described in this post: viewtopic.php?f=4&t=9302


Hi, I'm trying to use repeatable regions to remake the calendar shown here:

(Note: I wrote some crazy CSS that splits the desktop calendar into as many columns as there are days, and I'm trying to preserve that dynamic design)

I have the repeatable fields working in the admin:

Code: Select all
<cms:show_repeatable 'classes'>
        <div class="column">
          <ul class="day">
             <li class="day-name"><cms:show day /></li>
             <li class="instance">
               <time><cms:show start_time />&ndash;<cms:show end_time /></time>
               <strong><cms:show studio_name /></strong>
               <cms:if "<cms:not_empty class_link />" ><a href='<cms:show class_link />'></cms:if>
                 <cms:show class_title />
              <cms:if "<cms:not_empty class_link />" ></a></cms:if>

But I need to figure out some logic that says "If classes exist on [day], then create a column, add the day name, and then loop through all the classes"

Is this even possible? THANKS
For others coming across this thread later, following is the desired output -
Untitled-1.png (24.32 KiB) Viewed 131 times

@heinze, while what you wish is definitely possible with some convoluted buffering logic, I suggest you take the simpler route of using the 'mosaic' instead for this use-case -

Define a single 'tile' with two child editable-regions -
a. a dropdown showing the weekdays
b. a repeatable-region with fields for classes

So now you can add individual 'days' with their classes as rows.
If a day has no classes, delete that day (e.g. the output shown in the image above will have 5 rows in the mosaic).

This will make it easier on the frontend to just iterate through the 'tiles' (i.e. days) and then iterate through the 'repeatable-regions' (i.e. the classes) within.

How does that sound?
2 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests