Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > built in YouTube player for document not working View modes: 
User avatar
Member
Member
dford-catapultrpm - 7/1/2013 8:00:32 AM
   
built in YouTube player for document not working
I am using the WYSIWYG editor in CMSDesk to create the content of the document. I click on the built in YouTube player to add it to the document. The pop up comes up for me to enter the url, select size and other options. I do this, save the document and when I go to view the document there is no YouTube player. All I see is this:
{^youtubevideo|(width)480|(height)295|(rel)False|(url)http://www.youtube.com/watch?v=jgvx9OfZKJw|(fs)True|(loop)False|(autoplay)True^}


Is there a macro or something that is missing?

BTW, I do see the preview for the video when I enter the url and select the options in the popup box.

User avatar
Kentico Support
Kentico Support
kentico_romank - 7/1/2013 8:18:20 AM
   
RE:built in YouTube player for document not working
Hi,

You have put Editable Text web part on page, and you want to place inside this editable region YouTube player, is that right? I have tried that and it was working as expected, I have even copy your code and it was working right. I dont have placed any macro or do any additional task. Have you applied any hotfixes on your Kentico CMS?

Best Regards,
Roman Konicek

User avatar
Member
Member
dford-catapultrpm - 7/1/2013 8:25:04 AM
   
RE:built in YouTube player for document not working
I have a custom web part that displays the document content. Is it possible to do this from outside a Editable Text web part?

User avatar
Kentico Support
Kentico Support
kentico_romank - 7/1/2013 9:24:37 AM
   
RE:built in YouTube player for document not working
Hi,

So I guess you have created some custom document type with field HTML area, is that right? And yes, it is possible to do this outside Editable Text web part.

Can you try to render the content of the documents using repeater web part? To see if that works, I guess there will be some issue with you custom web part.

Also did you try to render the YouTube video using Editable Text Web part, does it work as expected?

Best Regards,
Roman Konicek

User avatar
Member
Member
dford-catapultrpm - 7/1/2013 10:07:38 AM
   
RE:built in YouTube player for document not working
Yes, when i add the youtube to an EditableText web part, it works as expected.

Is there a way to do this with a custom web part with custom code? The custom web part just outputs the content of a single document and calculates the elapsed time which it outputs in a certain format.

Also, this is only for one document, would a repeater be a good fit for this situation.

User avatar
Member
Member
Swainy - 7/1/2013 4:25:08 PM
   
RE:built in YouTube player for document not working
Yeah if you want multiple of these items to appear in a list then a repeater would be a perfect situation. Also use transformations to display your content out. This works just like an item template would in standard .net but you still have access to kentico macros and custom functions from within these transformations.

User avatar
Kentico Support
Kentico Support
kentico_romank - 7/4/2013 5:13:49 AM
   
RE:built in YouTube player for document not working
Hi,

I will provide you code sample and I believe that this will help you to solve the problem.
I have created custom webpart and in mywebpart.ascx put following code:
<asp:Panel ID="myPanel" runat="server">
<asp:Literal runat="server" ID="ltl" ></asp:Literal>
</asp:Panel>
and into mywebpart.ascx.cs to Page_Load put:
CMS.DocumentEngine.TreeProvider tree = new CMS.DocumentEngine.TreeProvider(CMS.CMSHelper.CMSContext.CurrentUser);

CMS.DocumentEngine.TreeNode tn = tree.SelectSingleNode(CMS.CMSHelper.CMSContext.CurrentDocument.NodeID);

string test = ValidationHelper.GetString(tn.GetValue("Areal"), string.Empty);

ltl.Text = CMS.GlobalHelper.ResHelper.LocalizeString(test);

CMS.ExtendedControls.ControlsHelper.ResolveDynamicControls(myPanel);

And this help me to resolved the text literal which you have post in your first post ("Areal" is the field where I store youtube video).

Best Regards,
Roman Konicek