Tuesday, March 13, 2012

SiteMapPath Control and dynamic items

Hi,
I've got web.sitemap file with few nodes and subnodes and SiteMapPath
control. It works fine.
But imagine, I'm worrking on an calender implemented this way:
calendar.aspx -> showing upcomming events
calendar.apsx?year=2005 showing calendar for year 2005
calendar.apsx?year=2005&month=1 showing january in 2005
calendar.aspx?year=2005&month=1&day=1 showing 1/1/2005
and in my web.sitemap I've defined only
<siteMapNode url="~/Calendar.aspx" title="Calendar" description=""/>
By this implementation SiteMapPath control shows i.e "Home > Calendar" all
the time. I would like to ask you, if I can get following results easilly.
"Home>Calendar>2005"
"Home>Calendar>2005>January"
"Home>Calendar>2005>January>1"
BTW: of course I dont wan't to add manually every SiteMapNode for every item
into web.sitemap file ;)
Do you have any link to example I need? Or your own solution? I'll be
pleased with any response.
Thanks before for your answer.
Regards
RobertYou'll want to override the SiteMapProvider's SiteMapResolve event.
You can inject dynamic site nodes into the SiteMapPath by retuning
them from this event. You can google for SiteMapResolve and come up
with a samples, but feel free to post questions, because it is a
tricky event to manage, IMHO.
Scott
http://www.OdeToCode.com/blogs/scott/
On Sat, 15 Oct 2005 10:44:51 +0200, "Robert Camsky"
<robertcamsky@.atlas.cz> wrote:

>Hi,
>I've got web.sitemap file with few nodes and subnodes and SiteMapPath
>control. It works fine.
>But imagine, I'm worrking on an calender implemented this way:
>calendar.aspx -> showing upcomming events
>calendar.apsx?year=2005 showing calendar for year 2005
>calendar.apsx?year=2005&month=1 showing january in 2005
>calendar.aspx?year=2005&month=1&day=1 showing 1/1/2005
>and in my web.sitemap I've defined only
><siteMapNode url="~/Calendar.aspx" title="Calendar" description=""/>
>By this implementation SiteMapPath control shows i.e "Home > Calendar" all
>the time. I would like to ask you, if I can get following results easilly.
>"Home>Calendar>2005"
>"Home>Calendar>2005>January"
>"Home>Calendar>2005>January>1"
>BTW: of course I dont wan't to add manually every SiteMapNode for every ite
m
>into web.sitemap file ;)
>Do you have any link to example I need? Or your own solution? I'll be
>pleased with any response.
>Thanks before for your answer.
>Regards
>Robert
>
Scott, glad to see you in this topic as I've learned a lot from your early
work in this context. Have you blogged the methodology to support multiple
SiteMapPaths yet?
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Scott Allen" <scott@.nospam.odetocode.com> wrote in message
news:94i2l1lhlacqd335dpdg9h2bhuf9apdkdo@.
4ax.com...
> You'll want to override the SiteMapProvider's SiteMapResolve event.
> You can inject dynamic site nodes into the SiteMapPath by retuning
> them from this event. You can google for SiteMapResolve and come up
> with a samples, but feel free to post questions, because it is a
> tricky event to manage, IMHO.
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
> On Sat, 15 Oct 2005 10:44:51 +0200, "Robert Camsky"
> <robertcamsky@.atlas.cz> wrote:
>
>
On Sat, 15 Oct 2005 13:51:08 -0500, "clintonG"
< csgallagher@.REMOVETHISTEXTmetromilwaukee
.com> wrote:

>Scott, glad to see you in this topic as I've learned a lot from your early
>work in this context. Have you blogged the methodology to support multiple
>SiteMapPaths yet?
>
No Clinton, I haven't gotten around to it as yet. :)
Scott
http://www.OdeToCode.com/blogs/scott/
"Scott Allen" <scott@.nospam.odetocode.com> wrote in message
news:uj33l1l92jokt1ft7nlb8vm6svbu15diqt@.
4ax.com...
> On Sat, 15 Oct 2005 13:51:08 -0500, "clintonG"
> < csgallagher@.REMOVETHISTEXTmetromilwaukee
.com> wrote:
>
> No Clinton, I haven't gotten around to it as yet. :)
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
We can do so but there's some requirements to be aware of. I don't recall
the specifics and thought I saved the page where I learned this but can't
find it anymore. Damn.
<%= Clinton Gallagher

0 comments:

Post a Comment