Nested Content in Kentico

George Tselios asked on January 24, 2020 13:24

Dear Sirs,

We are developing a new portal using Kentico 12SP MVC. One of our requirements is that each page should display a hero carouser at the top. Each carousel item is consisting of an image, a header, an optional description and an optional “Call to Action” button. Currently we have created a Page Type named “Carousel Item” containing the above fields. Also, in the “Carousel Item” Page Type, we specify all the pages that require a hero carousel as “Allowed parent page types” in the “Allowed types” tab. In this way we create a parent – child structure between a page and the carousel items. Please note, that each carousel item holds specific information related to its “parent” page and in general its content is not reusable.

Is there any way (e.g. a special Data Type accompanied by a suitable Form Control like a content repeater) that would allow us to create carousel items “inside” the actual page that needs to display the hero carousel, instead of creating child nodes for that page? In such a case, the carouse item will not exist as a node by itself, but it would be a nested collection of nodes in the page node.

In general, is there any out of the box way, to create nested content in Kentico and not always model such cases as parent – child relations/structures?

Thanks in advance,

George

Recent Answers


Peter Mogilnitski answered on January 24, 2020 17:42

Are you gonna share your carousel items (slides) between pages? If yes I would create a separate folder and put all carousel items (pages) there. And you can use simple multiple choice(page selector etc) on your page to choose carousel items from there.

Answering your question: Out of the box - NO. Because what you asking is ability to save you "coursel config" at the level of the page. Which is doable, but would require custom development of a form control. You can use a text area and manually create json config of your carousel, but I guess this not the way to do it :).

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on January 26, 2020 19:40

To extend Peter's answer, if you are sharing banners (or just don't want a clutter of page types UNDER a page), then the Relationships Extended module i created (on the marketplace) allows you to create cleaner interfaces to assign Page types to pages, with MVC helpers to get them (with ordering). You would store hero banners in a separate folder (we usually have a "Site Objects" folder at the root, then you can have a "Hero Banners" below), and then create a custom User Interface using the relationship extended module, so on the page you would edit the page type's data on teh "Form" Tab, then there would be another tab (IE "Hero Banners") that would allow them to find and select and order the hero banners for that page.

Otherwise just store them as children under the page type.

NuGet package info, wiki on it are here

0 votesVote for this answer Mark as a Correct answer

George Tselios answered on January 27, 2020 10:34

Dear Peter and Trevor,

Thank you very much for your prompt answers, but unfortunately the content of the hero banners is specific to each page so there is no sharing of hero banners between pages.

I have one more related question, say that instead of hero banners I have an arbitrary list of addresses and each address has one or more phone numbers. Since all of content of this structure is plain text, is there a form control that I can use to represent it, instead of (again) creating a two level hierarchy of nodes under a page?

Thanks in advance,

George

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on January 27, 2020 14:49

The closest thing is meeg's component module that allows serialization of one page type into another, but it only has single instance support. Maybe you can extend it to allow multiple... His thing is on the marketplace, I use it for seo metadata.

0 votesVote for this answer Mark as a Correct answer

George Tselios answered on January 27, 2020 15:42

Dear Trevor,

Thanks for your answer, I will check it out.

Regards,

George

0 votesVote for this answer Mark as a Correct answer

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