Hello,
You can use query macro or custom macro in the
Active tab index property that would return the index of tab that you want to be active based on the query parameters instead of using javascript. Its worth noting that by default, the
Tabs layout web part does not resolve macros specified in its properties.
To deal with this limitation, you will need to change the implementation of the
ActiveTabIndex property as shown here:
public int ActiveTabIndex
{
get
{
return ValidationHelper.GetInteger(CMS.CMSHelper.CMSContext.CurrentResolver.ResolveMacros(this.GetValue("ActiveTabIndex").ToString()), 0);
}
set
{
this.SetValue("ActiveTabIndex", value);
}
}
The
Tabs layout web part is located here:
~\CMSWebParts\Layouts\Tabs.ascx.csThis way, you can for example specify the following macro in the
Active tab index property:
{%ToInt(param, "1")%} and as result, if the Url contains the Url parameter named param, its value will be used as a selected tab, otherwise, the first tab will be selected.
More information about macros, can be found here:
Types of macrosBest regards,
Michal Legen