Category Control

×

Definition

The BirdDog Category Control is essentially a Repeater Control, and works similarly. It uses either a Category's PageCode or GUID as its category source identification. It repeats, as-is, the specified block of code for all elements contained in the indicated category.

Special: The Category Control may also display a collection of Featured Categories by using %Featured% as the SourceCategory.

Syntax

<BDW:CategoryControl ID="[ID]" SourceCategory="[PageCode]" runat="server">
    <ItemTemplate>
    </ItemTemplate>
</BDW:CategoryControl>

Associated Tags

Tag Description
HeaderTemplate Code to be inserted at the beginning of the control.
ItemTemplate Code to be repeated for all menu elements.
AlternatingItemTemplate Code to be used for every other menu element. (Note: This is taken "literally," so if this tag exists while "empty," every other menu element will be invisible ; ).)
SelectedItemTemplate Code to be used for the "active" menu element (that is, the category or parent-category of the page the user is currently viewing).
SeparatorTemplate Code to be used in between the other menu elements.
Level1HeaderTemplate Deprecated; Code to be inserted at the beginning of the Level1 sub-block. If present, this code will be rendered even if the sub-block is empty.
Level1ItemTemplate Deprecated; As for ItemTemplate, used for 1st-Level sub-element.
Level1AlternatingItemTemplate Deprecated; As for AlternatingItemTemplate, used for 1st-Level sub-element.
Level1SelectedItemTemplate Deprecated; As for SelectedItemTemplate, used for 1st-Level sub-element.
Level1SeparatorTemplate Deprecated; As for SeparatorTemplate, used for 1st-Level sub-element.
Level1FooterTemplate Deprecated; Code to be inserted at the end of the Level1 sub-block. If present, this code will be rendered even if the sub-block is empty.
FooterTemplate Code to be inserted at the end of the control.
 

Properties

Property Description
LevelsToShow integer; Deprecated; specifies the level of sub-categories displayed.
SourceCategory "Page Code" string; specifies the category that will be the data source for the control.
%Featured%; specifies the Featured Categories collection as the data source.

Example

<BDW:CategoryControl id="tmMainMenu" runat="server" SourceCategory="Products" LevelsToShow="1">
    <ItemTemplate>
        <td id="divMenuItem" runat="server" class="MenuLevel1">
            <asp:HyperLink ID="HyperLink3" runat="server" CssClass="MenuLevel1Link" Text='<%# Container.DataItem.Description %>' NavigateUrl='<%# Page.WebRoot & "/" & Container.DataItem.URL %>' />
            <uc1:uc_CatPanel id="MenuLevel2" runat="server" CategoryID='<%# Container.DataItem.WebCategoryId %>' />
        </td>
    </ItemTemplate>
    <SelectedItemTemplate>
        <td id="divMenuItem" runat="server" class="MenuLevel1-Selected">
            <asp:HyperLink ID="HyperLink3" runat="server" CssClass="MenuLevel1Link" Text='<%# Container.DataItem.Description %>' NavigateUrl='<%# Page.WebRoot & "/" & Container.DataItem.URL %>' />
            <uc1:uc_CatPanel id="MenuLevel2" runat="server" CategoryID='<%# Container.DataItem.WebCategoryId %>' />
        </td>
    </SelectedItemTemplate>
    <Level1ItemTemplate>
        <div id="divMenuItem" runat="server" class="MenuLevel2">
        <div class="test">
            <asp:HyperLink ID="HyperLink3" runat="server" CssClass="MenuLevel2Link" Text='<%# Container.DataItem.Description %>' NavigateUrl='<%# Page.WebRoot & "/" & Container.DataItem.URL %>' />
        </div></div>
    </Level1ItemTemplate>
    <Level1AlternatingItemTemplate>
        <div id="divMenuItem" runat="server" class="MenuLevel2">
        <div class="test">
            <asp:HyperLink ID="HyperLink3" runat="server" CssClass="MenuLevel2Link" Text='<%# "*" & Container.DataItem.Description & "*" %>' NavigateUrl='<%# Page.WebRoot & "/" & Container.DataItem.URL %>' />
        </div></div>
    </Level1AlternatingItemTemplate>
    <Level1SelectedItemTemplate>
        <div id="divMenuItem" runat="server" class="MenuLevel2">
        <div class="test">
            <asp:HyperLink ID="HyperLink3" runat="server" CssClass="MenuLevel2Link" Text='<%# "-" & Container.DataItem.Description & "-" %>' NavigateUrl='<%# Page.WebRoot & "/" & Container.DataItem.URL %>' />
        </div></div>
    </Level1SelectedItemTemplate>
</BDW:CategoryControl>