Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Using Ajax Accordion in Transformation View modes: 
User avatar
Member
Member
salah.thabet2009-yahoo - 7/13/2011 8:09:12 AM
   
Using Ajax Accordion in Transformation
How can i Use Ajax Accordion in Transformation

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 7/17/2011 10:07:52 AM
   
RE:Using Ajax Accordion in Transformation
Hello,

I would recommend you to create a custom web part for this purpose. This way you'll be able to place your Ajax Accordion code to the transformation easily with all advantages of a web part.

As for the particular Ajax Accordion implementation, please take a look at the following article and use its code in your custom implementation as a starting point: Ajax toolkit accordion extender.

Basically the web part code can look like this:


<style type="text/css">

body {
font-family: verdana;
font-size: 11px;
}

.header,.selected {
width: 300px;
background-color: #c0c0c0;
margin-bottom:2px;
padding:2px;
color:#444444;
font-weight:bold;
cursor:pointer;
}

.content {
width:300px;
margin-bottom:2px;
padding:2px;
}

.selected,.content {
border:solid 1px #666666;
}

</style>

<ajaxToolkit:Accordion ID="Accordion1" runat="server" TransitionDuration="250" FramesPerSecond="40"
FadeTransitions="true" HeaderCssClass="header" ContentCssClass="content" HeaderSelectedCssClass="selected">
<Panes>
<ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server">
<Header>
Pane 1</Header>
<Content>
Content 1</Content>
</ajaxToolkit:AccordionPane>
<ajaxToolkit:AccordionPane ID="AccordionPane2" runat="server">
<Header>
Pane 2</Header>
<Content>
Content 2</Content>
</ajaxToolkit:AccordionPane>
<ajaxToolkit:AccordionPane ID="AccordionPane3" runat="server">
<Header>
Pane 3</Header>
<Content>
Content 3</Content>
</ajaxToolkit:AccordionPane>
</Panes>
</ajaxToolkit:Accordion>


Then, you are able to call it in the transformation the following way:


<%@ Register src="~/CMSWebparts/custom/ajaxAccordion.ascx" tagname="ajaxAccordion" tagprefix="uc1" %>

<uc1:ajaxAccordion ID="ajaxAccordion1" runat="server" />


You may need to adjust that code and look and feel to suit your needs. However, I believe that it pretty much explains the way of implementing such control to Kentico CMS in general.

Best regards
Ondrej Vasil