Leaf Node in SiteMapPath

U

Uriah Piddle

Hi Gang,

I have a SiteMapPath, bound to a Site Map, that traces a hierarchy down to
an 'Article' leaf node. But the Article page shows one of many individual
articles depending on which article the user chooses in the Articles page.
The way it is set up now, if the user selects a particular article in the
'Articles' page, the SiteMap looks like this: '. . . Articles > Article'.
Assuming the user choses a cookie baking article, I would like it to read
like this: '. . . Articles > How to Bake Chocolate Chip Cookies'. In other
words, I am trying to make the leaf node of the SiteMapPath show the name of
the article. I know there's a way because all the sites do this but I can't
find it.

And I have another one which is related: how do you hide the 'Article' node
in a menu which is bound to the same Site Map as the above SiteMapPath? I
can disable it but I just don't want it to appear at all.

Thanks for any ideas.

Steve
 
S

Steve C. Orr [MVP, MCSD]

One solution might be to could vary your site map nodes by querystring
parameters. Another solution might be to use the Context.RewritePath method
to make it appear that your "Chocolate Chip Cookies" page has a unique URL
when in reality (behind the scenes) it shares a URL with many other "pages".
Here's more info:
http://windowssdk.msdn.microsoft.com/en-us/library/sa5wkk6d.aspx

As for your second question, the SiteMapDataSource has some properties that
should be able to help you such as ShowStartingNode, StartFromCurrentNode,
StartingNodeOffset, and StartingNodeUrl. Depending on the specifics of your
needs, I imagine one or more of these properties will help you out.
Here's more info:
http://SteveOrr.net/articles/SiteMaps.aspx
 
C

Cowboy \(Gregory A. Beamer\)

TITLE shows up on the menu. Description shows up on SiteMapPath. Set both
and you should be fine.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 
U

Uriah Piddle

Thanks Steve and Gregory,

On the sitemappath issue, I am passing the title in the query string and
coding based on this article that I found and it works well. The author does
not put the page that shows the data in question in the SiteMap but instead
creates a sitemappath node and appends it to the root node which looses all
the ancestor nodes. I included that page in the SiteMap and just changed the
title of the current node in the event handler he discusses.

The article: http://msdn.microsoft.com/msdnmag/issues/06/06/WickedCode/

Still working on the menu.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top