Forum for discussing general topics related to Couch.
9 posts Page 1 of 1
Is it possible to dynamically create and order elements similar to 'matrix fields' in 'craft' or 'blocks' in 'perch'? http://fast.wistia.net/embed/iframe/qxe ... pover=true

thanks!
We can't make it with CMS features as far as I know. We can't make a clonable template with pages that each of them has different editable regions, manageble by admin or user.
But nothing is impossible, such functionality can be made on pure JS, so we need only one textarea region in pages, containing smth like that:
Code: Select all
[{type: "textRegion", contentText: "Your text"},{type: "imageInline", urlInline: "mysite.com/img.jpg"},{type: "headline", contentTitle: "My title"}]

And then make two-sided approach:
- JS parsing for Preview.
- Using <cms:each> for making Couch understandable arrays, than <db_persist> all the three "textRegion", "imageInline", "headline" as Nested Pages level 1 with that first page Parent. But this approach requires hardcoded defining of all possible fields in the template (like "contentText", "urlInline", "contentTitle"), but some of them will be empty (for example, the page "textRegion" only has "contentText" editable filled).
Why to use Nested Pages? For "Drag'n'drop" feature mostly.

The creation and deletion of Nested Pages is processed only when the template for page is fully done and user presses "Submit to production" button. You should also have "Preview" button that will make layout only using JS, without SQL involvement to make the system more quick and effective.

So, the task can be done using only native Couch tags, but with JS frontend that will form an Array of Objects to save into the Parent's textarea.
Musman wrote: So, the task can be done using only native Couch tags, but with JS frontend that will form an Array of Objects to save into the Parent's textarea.


Thanks Musman, so are you saying the JS will need to be on the frontend of the site, or the js will need to be in the admin area only?

Do you think this functionality would be difficult or easy to achieve? I'm not sure I completely understand your solution and how to go about doing it
@rj751b,

The 'matrix/blocks' type of widget that you mentioned is not available yet with Couch, I'm afraid.

It has been on my todo list for quite sometime though but I had to postpone it pending the release of Couch's new admin-panel that would use JQuery.

Not sure yet when the admin-panel gets released (work is still on) but as soon as it comes out, you can expect a 'matrix' type editable region following quick on its heels.
Wow, can't wait, thanks KK!
I would also love to see this in couch!
it will be nice, I am waiting this feature too !
I did something similar with a repeatable region. A bit difficult to explain. There was a post around here, how to create contact forms out of repeatable regions. My idea was then to register content blocks instead of forms. After registering you can shift them up and down or turn them off. I created 8 kinds of different blocks.

The downside is, you can do the registering of the blocks only as superadmin :(

Image

http://www.lightcrafted.at/project/web/kvs-ingenieurburo.html
Hi Guys,

The long-promised region is finally here - please see the 'Mosaic' in
viewtopic.php?f=5&t=11105
9 posts Page 1 of 1

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 1 guest