Welcome Guest Search | Active Topics | Sign In | Register

siteMapNode visible false does not work Options
Johan
Posted: Saturday, March 29, 2008 7:47:23 AM
Rank: Newbie
Groups: Member

Joined: 12/1/2007
Posts: 8
Hi,

I use the MS SiteMap to control my menu. I would like to add a page which does not show up in the menu.

Quote:

<siteMapNode url="~/shop/ShopOnline.aspx" title="Shop" description="Shop" visible="false" type="node" text-padding-right="6" text-padding-left="6" lookid="item_no_submenu" /></siteMapNode>


But visible="false" will be ignored and the entry appears in the menu. This is how I bind the datasource.

Quote:

MainNavigationJSMenu.DataSource = SMP_files_MainNavigationJS;
MainNavigationJSMenu.DataBind();


Quote:

<asp:SiteMapDataSource runat="server" ID="SMP_files_MainNavigationJS" />

<eo:Menu ID="MainNavigationJSMenu" runat="server" ControlSkinID="None"
Width="200px" RaisesServerEvent="True" OnItemDataBound="MainNavigationJSMenu_ItemDataBound" >
<DesignOptions ApplicationRoot="D:\Dev\WebSite\Home"></DesignOptions>
</eo:Menu>


Any idea what I have to do?
Thanks, Johan
eo_support
Posted: Saturday, March 29, 2008 7:50:25 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,092
Hi,

That appears to be an issue. We will look into it and see if we can address it as soon as possible.

Thanks
Johan
Posted: Saturday, March 29, 2008 8:53:01 AM
Rank: Newbie
Groups: Member

Joined: 12/1/2007
Posts: 8
Hi,

some more information. I have implemented a "ItemDataBound" handler. But both methods "Visible=false" or "Disabled=true" will not hide the item.

Quote:

protected void MainNavigationJSMenu_ItemDataBound(object sender, EO.Web.NavigationItemEventArgs e)
{
try
{
if ((e != null) && (e.MenuItem != null) && (e.MenuItem is EO.Web.MenuItem))
{
EO.Web.MenuItem item = e.MenuItem as EO.Web.MenuItem;
SiteMapNode dataItem = item.DataItem as SiteMapNode;

if (dataItem["visible"] != null)
{
bool visible = true;
if (bool.TryParse(dataItem["visible"] as string, out visible))
{
if (visible == false)
{
item.Disabled = true;
item.Visible= false;
}
}
}
...


Thanks for any help.
Johan
eo_support
Posted: Saturday, March 29, 2008 8:59:27 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,092
Hi,

That is something interesting. Visible = False should hide the item. Disabled will not. Try comment all other code out and just set every item's Visible = false and see if that hide all items.

Thanks
Johan
Posted: Saturday, March 29, 2008 9:22:04 AM
Rank: Newbie
Groups: Member

Joined: 12/1/2007
Posts: 8
Hi,

I have added a "Visible=false" to ALL items und the two I tried to hide are gone now. It works but I don't know why ;)

Quote:

EO.Web.MenuItem item = e.MenuItem as EO.Web.MenuItem;
SiteMapNode dataItem = item.DataItem as SiteMapNode;
item.Visible = false;


Thanks, Johan
eo_support
Posted: Saturday, March 29, 2008 9:27:10 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,092
Hi,

Try debug through your code. We are not aware of any problem with MenuItem.Visible. So I am guessing item.Visible is not called as you were expecting.

Thanks
eo_support
Posted: Friday, April 4, 2008 7:46:22 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,092
Support for "visible" on site map node is added in build 2007.2.46.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.