How to add an element to the page, not to its template?

Don Rea asked on October 18, 2021 19:03

I have recently inherited a Kentico 11 site, and I'm still quite a newbie. Right now I'm trying to add an editable text area or webpart or whatever the correct jargon is to a page, but every way I've tried has added it to the template, and thus to other pages as well, which I do not want. I imagine this is simple and well documented but I am also failing at coming up with the search terms that would turn up any such doc. Can someone please point me to it, or explain how to do this?

Correct Answer

Juraj Ondrus answered on October 19, 2021 05:47

If you are using web parts, these are always being inserted to the page template - even if you are working on the Design tab on some page, it is always a page template. (for more please see the documentation). I think you want to use a widget. This is an element based on a web part and can be added or in other words, is associated with one page. Please see the documentation on widgets. But at first, you need to prepare the page template and create a widget zone into which the widgets can be places.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Don Rea answered on October 25, 2021 22:21

That was very helpful, but I'm still failing to understand how to do what I'm trying to do. I need to add some content that is visible only to certain logged-in users who have a particular role. Ideally it would be a part of a page that would be visible or not depending, but it's OK if it's a separate page as long as the link to it is visible or not, depending. But I can not figure out a way to do either one. I can set the permissions on the new page, but there seems to be no way to selectively show navigation to it. This seems like it should be very easy, and I'm wondering if I'm not just completely missing something.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on October 26, 2021 05:21

When using web parts, at least the out of the box ones have the "Display to roles" or "Visible" properties. In the first one you can set the roles to which the web part and its content will be displayed. For the second property you can use e.g. a macro and check the current user role. For the widget - this depends what properties were exposed to be configured.

0 votesVote for this answer Mark as a Correct answer

Don Rea answered on October 28, 2021 16:12

This was extremely helpful in understanding how this works. Thank you

0 votesVote for this answer Mark as a Correct answer

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