Video widget in form tab not showing in page by page template

Mani SJ asked on May 14, 2020 08:55

I am placing a custom video web part in a rich text editor form field. The web part has the video tag and corresponding properties. If am using the form field value like <%= CurrentDocument.GetValue("PageTopVideo")%> in page template wrapped in a div. When I inspect page I am getting below

{^widget|(videocontainercssclass)embed-responsive+embed-responsive-16by9|(html5loopvideo)True|(html5playerwidth)1920|(html5playerheight)450|(widget_displayname)Html5VideoPlayer|(html5autoplayvideo)True|(mp4videosource)sourcevideo.mp4|(videocssclass)embed-responsive-item|(html5showcontrols)True|(html5preloadvideo)False|(name)Html5VideoPlayer|(width)|(height)^}

Kindly help me how to render video widget as video tag

Recent Answers


Juraj Ondrus answered on May 14, 2020 13:16

The <%= CurrentDocument.GetValue("PageTopVideo")%> is a displaying expression. Moreover, it is not supported to use them in the ASCX layout and you may get this error. AS you can see, it is ASP.Net displaying expression so it does not have the logic to parse the Kentico's inline control syntax. I would recommend using default Kentico ASCX transformation methods which have the logic to resolve the inline controls or, create a custom code to do so using ResolveDyamicControls. The idea is described in this older article.

0 votesVote for this answer Mark as a Correct answer

Mani SJ answered on May 19, 2020 07:09

I used a repeater selecting current page and my html code in transformation.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 19, 2020 07:59 (last edited on May 19, 2020 08:01)

So, what type of transformation are you using? What HTML code are you using? Have you tried using the transformation methods (ASCX transformation) or macros (text/HTML transformation)? Please, provide more details, samples etc. So I will be able to give you more accurate answer.

0 votesVote for this answer Mark as a Correct answer

Mani SJ answered on May 19, 2020 08:03

Hello Juraj,

That's the answer from my end. Its working. I used <%= CurrentDocument.GetValue("PageTopVideo")%> in repeater transformation so the video widget in form field is displaying properly.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on May 19, 2020 08:43

Why don't you use the available transformation methods? With the displaying expression you can get the mentioned error and in general, it should be enough to use <%#Eval("FieldName")%>
I would recommend following the documentation and best practices to avoid issues in the future. Please see the documentation links from my previous post.

0 votesVote for this answer Mark as a Correct answer

Mani SJ answered on May 19, 2020 08:46

Yep sorry its <%# Eval("PageTopVideo")%>

0 votesVote for this answer Mark as a Correct answer

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