Page 1 of 1
In need of some customizations
Posted: Fri Jul 10, 2009 5:13 pm
by JKstang
We would like to do some minor customizations to our (work in progress) website. We have modified the stardard header scriptlet to show direct links to otherwise hidden categories.
As seen below:

Two of the categories (Customer Service & Company Info) have webpages added to them.
Instead of clicking the category link and then having to click the link to the webpage, we would like to have the the selection of the webpages drop-down from the category as seen at:
http://www.eurekaclothing.com/.
Can someone please PM me with a quote for what something like this would cost.
Thank You,
Jeremy
Re: In need of some customizations
Posted: Sat Jul 11, 2009 3:12 am
by Khaliq
Here is a solution for you. If you need more help please contact Plugables.
You can create webpage menu very easily by putting an ASP.NET menu control and some code to populate it with webpages from a specific category.
Create a file
WebpageMenu.ascx in your applicatoin's
ConLib/Custom folder and put following code in it.
Code: Select all
<%@ Control Language="C#" ClassName="WebPageMenu" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
int categoryId = PageHelper.GetCategoryId();
Category category = CategoryDataSource.Load(categoryId);
if (category != null)
{
MenuItem categoryMenuItem = new MenuItem();
categoryMenuItem.Text = category.Name;
categoryMenuItem.NavigateUrl = category.NavigateUrl;
CatalogNodeCollection catalogNodes = CatalogDataSource.LoadForCategory(categoryId, true);
foreach (CatalogNode catalogNode in catalogNodes)
{
if (catalogNode.CatalogNodeType == CatalogNodeType.Webpage)
{
Webpage webpage = (Webpage)catalogNode.ChildObject;
MenuItem menuItem = new MenuItem();
menuItem.Text = webpage.Name;
menuItem.NavigateUrl = webpage.NavigateUrl;
categoryMenuItem.ChildItems.Add(menuItem);
}
}
WebpageMenu.Items.Add(categoryMenuItem);
}
}
</script>
<asp:Menu ID="WebpageMenu" runat="server" Orientation="Horizontal">
<StaticMenuItemStyle BackColor="#CBC2B9" Font-Bold="True" Font-Size="Small"
ForeColor="Black" Width="150px" />
<DynamicMenuItemStyle BackColor="#7B7066" Font-Bold="True" Font-Size="X-Small"
ForeColor="White" Width="150px" />
</asp:Menu>
Use this control on some page where Category Id is available. For example in Category Grid Page scriptlet it will be
To use it for a specific category you can slightly modify the code to use a specific category instead of getting one from the context.
Re: In need of some customizations
Posted: Fri Jul 17, 2009 2:42 pm
by deadlybuda
Hi guys, thanks for the replies. It still doesn't answer my question though. I am trying to only show 1 category with the drop down menu.
Re: In need of some customizations
Posted: Mon Jul 20, 2009 4:06 am
by mazhar
in above code instead of
Code: Select all
int categoryId = PageHelper.GetCategoryId();
you can specify category id you want to be listed like
where 33 represents the category id yours may be different.