Design and CSS styles
Version 7.x > Design and CSS styles > BasicTabControl View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
dchaffin-hgo - 11/12/2013 2:01:57 PM
   
BasicTabControl
Does anyone have any examples of customizing the layout for the cms:BasicTabControl? I would like to move it away from the default table-based layout. Thanks!

User avatar
Certified Developer v7
Certified  Developer v7
dchaffin-hgo - 11/12/2013 3:28:02 PM
   
RE:BasicTabControl
OK ... Worked around it if anyone is interested ...

<cms:BasicTabControl ID="tabMenu" runat="server" Visible="false" />
<ul class="nav nav-tabs">
<%
string _page = Request.QueryString["page"];
CMS.IO.StringWriter stringWriter = new CMS.IO.StringWriter();
using(HtmlTextWriter writer = new HtmlTextWriter(stringWriter))
{
var _active = false;
for (int i = 0; i < tabMenu.Tabs.GetLength(0); i++)
{
_active = false;
if((_page == null) && (i == 0))
{
_active = true;
}
string _thisPage = tabMenu.Tabs[i,2].Substring(tabMenu.Tabs[i,2].IndexOf("page=")+5);
if(_page == _thisPage)
{
_active = true;
}
if(_active)
{
writer.AddAttribute(HtmlTextWriterAttribute.Class, "active");
}
writer.RenderBeginTag(HtmlTextWriterTag.Li);
writer.AddAttribute(HtmlTextWriterAttribute.Href, tabMenu.Tabs[i,2]);
writer.RenderBeginTag(HtmlTextWriterTag.A);
writer.Write(tabMenu.Tabs[i,0]);
writer.RenderEndTag();
writer.RenderEndTag();
}
}
Response.Write(stringWriter.ToString());
%>
</ul>