cancel
Showing results for 
Search instead for 
Did you mean: 

modeling repeating complex elements

boneill
Star Contributor
Star Contributor
Hi Guys,

A common requirement when modeling web data is to have repeating complex data, an example being a photo gallery which is made up of multiple photos, each with an image and supporting text such as a title and description.  ie

Photo 1
   Image
   Title
   Description
Photo2
   Image
   Title
   Description
Photo3
  Image
  ….. etc


How do you model the capture and composition of this scenario.  I know you could do it using collections but Obviously you dont want a user to have to create a new html page for each photo.  The old avm forms made this possible easily using xsd to model the data in xml and then transform.  What is the correct approach for new wcmqs.

Regards
3 REPLIES 3

bremmington
Champ on-the-rise
Champ on-the-rise
I would suggest asset collections as you mention. The way I would do it is as follows:

  1. Create a new section named "gallery", for example, and under that create another section named "photos", say. Exclude the photos section from navigation

  2. In your gallery section, define a dynamic asset collection ("gallery.photos", for example) that finds all the content in the photos section

  3. Have your content creators upload images into the photos section, and have them set the title and description fields on each one (define a custom type and custom form if necessary)

  4. Create a template for the gallery, and assign it to the ws:indexPage type on your gallery section. In that template, iterate over the assets in the "gallery.photos" asset collection
I think this would be quite simple for your users to use, arguably simpler than having one great big XML asset that lists all the images. Managing the gallery would be as easy as adding and deleting images in the photos section.

On a related topic, however, I have previously sketched out ideas for introducing "composite content" in the core repo. The original idea was to have this is the Swift project, although that is still in the process of being defined, and I'm not sure whether it will make the cut or not. You can read about the idea on the wiki.

boneill
Star Contributor
Star Contributor
Hi Brian,

I just read your posting on the content model enhancements for "composite Content".  It is probably closer to what I was trying to achieve and I suppose closer to the current xsd forms way of modeling relationships between elements on a page.  I like where you are going with it although it would need to include updates to the current forms service to be able to handle nested/grouped fields or else it would not be user friendly.

Assuming that we implemented it as you suggested below how would you ensure that the photo assets created were created with the correct custom type.  Also what wcmqs should it override (ws:image?).

Regards

bremmington
Champ on-the-rise
Champ on-the-rise
If you want to use a custom type (the metadata you mentioned wouldn't require one) then you could either extend Share to provide a "Create Photo" option on the Create Content drop-down, or you could define a rule on the photos folder to specialise the type (or add an aspect). It's entirely up to you what the type hierarchy is. You could extend ws:image, but there's certainly no need to unless you want to be able to associate these photos with articles at some point (ws:article defines two associations (primaryImage and secondaryImage) with ws:image).
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.