Kentico 10 : Widget is not working when added inline in form view in rich text editor

sunanda soni asked on October 12, 2018 14:52

When we added widget in form tab,then it's not working. it's returned the widget data without rendering like below

{^widget|(name)TestWidget|(Title)Test|(Description)Test|(ImageURL)%7e%2fLPNSW%2fmedia%2fBudget-2018%2fHealth.jpg|(widget_displayname)Test+Widget^}

Correct Answer

Juraj Ondrus answered on October 15, 2018 09:36

Thanks for the information - so, this basically fits what is described in the article I already sent you - you need to resolve the dynamic controls using the API. This is done by default when using repeater or, the editable text has the property "Resolve dynamic controls" - but this is applied to the content of the web part, not the web part properties (such as the Content before).

1 votesVote for this answer Unmark Correct answer

Recent Answers


Juraj Ondrus answered on October 15, 2018 08:35

Hi,
What web part is used to display this content? Also, what transformation are you using? You may need to call ResolveDynamicControls, similar to this approach.

1 votesVote for this answer Mark as a Correct answer

sunanda soni answered on October 15, 2018 08:53

I have just added a widget in a field (rich text editor) in form tab. Widget is working fine when added in editable text from page tab, but not working when added from form tab of page. Just I am displaying value using macro like {%Content%} then its displaying full output of the widget like as below.

{^widget|(name)TestWidget|(Title)Test|(Description)Test|(ImageURL)%7e%2fLPNSW%2fmedia%2fBudget-2018%2fHealth.jpg|(widget_displayname)Test+Widget^}

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on October 15, 2018 09:16

Does this happen fopr any kind of inline widget? What web part is used to display the items? In the default repeater and when using text transformation macros there is nothing special needed. I just tried it and it is working fine.
What are the output filter settings set, please?

0 votesVote for this answer Mark as a Correct answer

sunanda soni answered on October 15, 2018 09:29

For displaying values, I have put this {%Content%} in 'content before' of editable text web part.

0 votesVote for this answer Mark as a Correct answer

sunanda soni answered on October 15, 2018 10:28 (last edited on October 15, 2018 12:07)

Thank you, you are right, its working when using repeater or editable text. Actually I am displaying content value in label in my custom web part. So now I have used Resolve dynamic controls API, but still its not working.

<asp:PlaceHolder runat="server" ID="plcContent"> <asp:Label ID="lblContent" runat="server" EnableViewState="false"></asp:Label> </asp:PlaceHolder>

API CMS.Base.Web.UI.ControlsHelper.ResolveDynamicControls(this.plcContent);

it's working fine when I used Literal instead Label.

0 votesVote for this answer Mark as a Correct answer

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