Reputation: 4292
My page is showing regular component presentations very well. I have a flash/video file in my local machine and i want to upload this file on my page. How can I achieve this?
I have this code snippet for rendering components on my page:
<!-- TemplateBeginRepeat name="Components" -->
<!-- TemplateBeginIf cond="ComponentTemplate == 'HomePageCT'" -->
@@RenderComponentPresentation()@@
<!-- TemplateEndIf -->
<!-- TemplateEndRepeat -->
Please provide all details related to flash files and video files.
Upvotes: 1
Views: 475
Reputation: 2887
There are several approaches to rendering Multimedia with a Tridion-managed page.
Multimedia components can be:
You could also just publish binaries with dynamic component templates and handle the markup and links outside of Tridion. Get creative with the above basic scenarios depending on the markup and/or metadata you need.
Chris addresses #1 and Mihai explains schema setup and .AddBinary
. The second option would be similar, except you'd have to get the referenced ID rather than the component on the page. The third option requires you to parse multimedia within RTF which depends on your templating language and multimedia type.
I've seen XSLT (<xsl:template match="">
), grep, and various .replace
options to parse specific markup such as Flash videos.
Upvotes: 1
Reputation: 10163
Placing a Flash file on a page follows exactly the same process as placing any image in the output of your templates. The steps are outlined below:
@@RenderComponentPresentation()@@
Without details of the output you want to produce, it is hard to provide the sample Dreamweaver Template Building Block code for the DisplayFlash CT, but it might look something like this:
<embed src="@@Component.Id@@" allowFullScreen="true" width="540"
height="438" bgcolor="#000000" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
Make sure you use the Default Finish Actions TBB after this in your Component Template so that the src
link is processed and the binary is published.
Upvotes: 9
Reputation: 2407
There is nothing special about Flash files with Tridion. They can be treated just like any other Multimedia Component
. You can upload them into the CME (or by using Webdav) and thus you will have a Multimedia Component
. Make sure of course, that you Multimedia Schema
allows the Flash (and extension) as Multimedia Type.
Regarding how you put the Flash file on the Page - again just like a normal Multimedia Component
. In your CT you have to generate the output that will make use of your Flash file URL somewhere. You will have to publish your Flash MMC in order to get its URL. You can use Engine.AddBinary
or RenderedItem.AddBinary
methods for that, or use the Publish Binaries in Package
Default TBB, if your MMC is in the package. Then you can simply refer to your Flash URL as package item. Have a look at this URLs for some inspiration: http://yatb.mitza.net/2012/03/publishing-images-as-variants.html (your case doesn't have to be that complex) and http://yatb.mitza.net/2012/04/referencing-image-variants-from.html.
Upvotes: 5