Multiple Field List in Content Type

Jan 30, 2014 at 6:58 PM
I am trying to use 2SexyContent to put together a page that contains sections of products.

To connect it to the real world, this is a page that displays new products in a product category. There are a variable number of sections depending on what products have been released this month Each section has a title, and the list of products. Like the number of sections, the number of products in each section can vary.

I plan to have the user enter the product code of each product that they want to display.

When trying to set up a content type, I don't see anything that allows for repeats or dynamically adding fields. Can I represent this type of data in 2SexyContent?
Jan 30, 2014 at 7:14 PM
Hi

Forr repeating data what i do is add them with a sperator

Type1| type2.

Then using razor I just split these an display each of them

Untill there is a repeating content type this is the way to do it

What do you mean by dynamically adding fields?
Jan 30, 2014 at 7:49 PM
Edited Jan 30, 2014 at 10:12 PM
I think there is a little bit missing from the original description that lets the small bit of complexity slip by.
I have a page that lists products, lets call this the "New Products Page". The products are divided into "Sections" that have a section title and a list of products. There are a lot of other data pieces on the New Products Page too. Here is more what I am looking at:
  • Intro Paragraph
  • Concluding Paragraph
  • List of Linked images (Need a image field and a URL to create the link)(Variable number of these.)
  • List of Sections (Each section contains a title field and a list of books. The list of books can be put into a delimited list and processed.)(Variable number of these.)
  • About 20-30 checkboxes indicating what product information should be displayed on this particular product
I don't know how to represent this in a 2SexyContent Content Type.

The number of sections, products, and links are all variable depending on the new content created this month and what the company wants to emphasize.

Here are the problems I am running into:

First, the list of Sections. I want the sections to be saved in the "New Products Page" content type, but I don't see how to do this. My initial thought to overcome this limitation was to create a separate content type for the "Section" that would have 2 fields, a title and a product list (delimited). I figured these could be linked to the "New Products Page" with an entity relationship. Can the entity field be used to hold a delimited list of entities? If not, how do I create links to these sections when I don't know how many sections are going to be created?

Second, the list of "Linked Images". In 2SexyContent it appears I would need 2 fields for each image link, a hyperlink field for the image, and a hyperlink field for the link. I don't know how many images there will be. This also doesn't appear possible in a single content type.

If both of these need to be separate content types, it seems like a data entry nightmare. I can imagine the user creating 10 different "Sections", 5 different "Linked Images", and then going back to the original "New Products Page" to connect all the newly created content pieces to this Page. They need to do this for 10 pages a month...so after 1 month we would have something like 100 different sections and 50 image link objects. The list for selecting the Entity would become unmanageable.

These sections and the linked images are not going to be reused throughout the site so there isn't any advantage to extracting them into their own content type. I really want everything I described here held in a single Content Type.

What should I do?
Jan 31, 2014 at 7:12 PM
I don't know why this wasn't my first reaction... Extending the thought of the delimited list, it seems reasonable to put use an XML document to represent more complicated data structures that involve groups of nested data.

There isn't any technical reason why a field cannot hold XML data is there?
Feb 1, 2014 at 7:34 AM
I have not tried to use xml in that way. If you get it working Id be interested in seeing a sample
Coordinator
Feb 3, 2014 at 7:49 AM
Edited Feb 3, 2014 at 7:51 AM
@RacerNerd

From what I understand, you need something like the Ricardo Magazine, or with a specific example the blog on GoPro.

The limitation you're running into is, that you cannot "create" a bunch of attached entities in one workflow. My recommendation:

The DNN-Page-Model
  1. Create a DNN page for each section (or whatever your Details-page is called)
  2. Add a Section-Entity to it containing all the "header" infos. We often add a Link-Field to this entity (say, Details) which then points to the page where this topic is handled (like Page:74). Then edit the rest of the page as you wish, adding galleries and more.
  3. Thanks to the "section" entity in the header, you can always create lists of these wherever you want, and link to the right page thanks to the Details-Link contained in this entity
Adding unlimited images, galleries, even contact-forms is very easy in this model. The only disadvantage is that it's not a Database-model but a content-editing model. We've used this a few times and we're happy with it. It also gives the editor huge flexibility to re-arrange content, have multiple galleries with text in between and similar. For a programmer it feels like too much work (creating the pages), but for an editor it's great.
Another benefit: it's much easier to have variations in languages.

Also just started documenting the 2SexyContent features in this model - again it allows me to add complex content as I need it, without re-working the template every time I need additional features. See the example here, which even required me to change security features on modules (to allow JSON-data), which I wouldn't want to do on every section.

Sexy wishes,
Daniel