Kentico Widgets

Tom F asked on January 6, 2017 08:30

Hi I have a scenario where I'd like the content editor to be able to add 1-n pieces of content on a page.

That would be in the form of say 3 or 4 text fields and they can add as many of those collections of content.

In umbraco or wordpress generally you'd be able to do this in a visual composer type scenario where you define input fields and then the user gets a plus button and can add as many things of that type as they wish in a defined area.

In Kentico this sounds a bit like widgets to me.. I was wondering if this was correct and that provided input fields etc in edit mode or generally do you build up a larger page style tree where multiple content items are nested under a parent node then transformations are run?

Thanks, Tom

Recent Answers


Jan Hermann answered on January 6, 2017 09:04

Hi, both approaches are possible and would do the job. The advantage of Widgets is that the editor can decide what order would they have so he/she can sort them manually. When creating "subpages" they usually don't have an access to the configuration of a repeater so the ordering is the predefined one.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on January 6, 2017 22:24 (last edited on January 6, 2017 22:28)

Tom, check out my latest tool "Transformable WebPart" it allows you to create a webpart (then a widget) and apply a transformation to it, including "multi row" support.

So if you make one using the fields

"Content_1" "Title_1"

"Content_2" "Title_2"

"Content_3" "Title_3"

"Content_4" "Title_4"

You can write a transfomation that will render 4 times with {% Content %} / <%# Eval("Content") %> and {% Title %} / <%# Eval("Title") %> as the value for each row.

http://devnet.kentico.com/marketplace/web-parts/transformable-web-part

Weigh out though if you should do this with a Widget vs. a Repeater+Pages on the content tree. If it's just small structured content that you want to add here or there, my transformable webpart is the way to go, but you have to give a limited number of 'rows' because the fields have to be defined.

If it's something you want to show the same set of items on multiple pages, or you truly want any number of possible entries, then a repeater would be better since you can't 'share' the Transformable web part's content, it's just it's one instance.

0 votesVote for this answer Mark as a Correct answer

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