by
Musman » Wed Feb 18, 2015 3:35 pm
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.