Design and CSS styles
Version 7.x > Design and CSS styles > Animation WITHIN Repeater with Carousel? View modes: 
User avatar
Member
Member
dbraun-pediatricweb - 9/4/2013 2:21:31 PM
   
Animation WITHIN Repeater with Carousel?
Is it possible to put either a flash animation or animated numbers as a slide WITHIN the repeater with Carousel web part?
If so, how would I accomplish this?
My client has an existing Repeater with Carousel webpart that they use and want one of the slides to have this animation of slot machine like numbers on it.
Many thanks in advance for help / advice.

User avatar
Kentico Support
Kentico Support
kentico_filipl - 9/5/2013 9:19:23 AM
   
RE:Animation WITHIN Repeater with Carousel?
Hello Deb,

It should be possible to accomplish that. You can add a new asp:Literal control to the transformation, generate HTML in the script tag and set the rendered HTML code to the literal.
Another way could be based on creating a custom transformation method and generate appropriate HTML code in the code of the macro as it is described in Developer's Guide - Adding custom functions to transformations.

In either case, you can use the CMS.GlobalHelper.MediaHelper.GetFlash() method that accepts an instance of CMS.GlobalHelper.FlashParameters class with all necessary information as an input parameter and returns a complete HTML code that is needed to show a .swf file on a page.

The following code shows you the first option I described above:
<asp:Literal ID="ltlMedia" runat="server" EnableViewState="false" />

<script runat="server">
protected override void OnPreRender(EventArgs e)
{
CMS.GlobalHelper.FlashParameters flParams = new FlashParameters();
flParams.Url = CMS.GlobalHelper.UrlHelper.GetAbsoluteUrl(...);
flParams.Extension = ...;
flParams.Width = ...;
flParams.Height = ...;
flParams.Autoplay = ...;
flParams.Loop = ...;
flParams.Menu = ...;
flParams.Scale = ...;
flParams.Id = ...;
flParams.Title = ...;
flParams.Class = ...;
flParams.Style = ...;
flParams.FlashVars = ...;
ltlMedia.Text = CMS.GlobalHelper.MediaHelper.GetFlash(flParams);
}
</script>

For more information Kentico API, please take a look at Kentico CMS API Reference.

Best regards,
Filip Ligac