Collection of html form fields, field type?

Simon Goldsmith asked on August 29, 2017 13:05

I need to build a scalable carousel tool within Kentico CMS where a user can edit a page in the CMS and setup a carousel. They need to be able to upload/select an image (media library) OR type in a number relating to videos in Vimeo. They need to be able to add multipe slides for a carousel.

The way I would approach this is create a new Carousel PageType, with a child PageType of CarouselSlide and then get the user to create the carousels, which can then b selected whene ditig a page.

This is clunky, and we wantto find a better solution...

So, does Kentico have a 'collection' form field (similar to Drupal) where you have a repeater (1 row initially) made up of several standard html form fields(textboxs, dropdowns, checkboxes etc). You select or enter values, and then you can dynamically add another row of the same fields. This creates a collection of items which can then be saved in another table, but are linked by ID to the parent record ???

OR, Would I have to create a new custom form field with this type of functionality, and if so has anyone done this before?

If I do need a custom form field, how do I save the data back to Kentico in this format?

Many Thanks or any advice and guideance Simon

Recent Answers


Chetan Sharma answered on August 30, 2017 14:20

Hi,

I was just wondering and correct me If I am unable to understand your question correctly.

  1. You can do this without using a Page Type. You can also you a custom table and define your fields for a slide. Adding one more slide will be adding a record in a Custom Table.

  2. What you have asked for is possible in Kentico using Custom modules that allows you to create M:N between records. I am unsure if it is needed here unless you want to create multiple Carousels.

So you can opt for Custom Tables instead of Page Types. We do that when we don't want to pollute content tree and Kentico has repeater for CT also.

Bonus: - Use Ken Wheeler's Slick slider library which is the best library for building any type of Carousel. Supports everything, accessibility, responsive, lazy loading and very easy to use

2 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.