Re: [Hypercontent-users] BreadCrumbs
Brought to you by:
alexvigdor
From: Alex V. <av...@co...> - 2005-05-04 13:20:38
|
Hi Carl, I suspect the problem is that your sitemap file is not included in your navigation, so when the XSL attempts to build the breadcrumb, $item is going to be null. You should try adding the sitemap to your navigation <nav-template pattern="/sitemap.xml"/> You would need to adjust your xsl logic, as this will cause a link to be added to your sitemap in the navigation, where you are already linking to the sitemap with a custom graphic. You could test for "/sitemap.xml" in your navigation rendering and place the sitemap graphical link there in place of the text link. -Alex On May 4, 2005, at 5:19 AM, Carl Barrow wrote: > Thanks very much for this Alex, > > It's working now. However, there seems to be a problem building my > sitemap if I include a breadcrumb trail. I get the error message : > > There was an error attempting to preview or publish /sitemap.xml -> > /sitemap.html > > I assume this is because I'm transforming sitemap.xml as well us using > it to make the breadcrumb. Would I need to use another xml file to > look after the breadcrumbs? > > Carl > > Alex Vigdor wrote: > >> Hi Carl, >> I was able to duplicate the problem, and I was able to resolve it >> by replacing the use of the "//" axis with "descendant-or-self::". >> >> e.g. >> >> <xsl:template name = "breadcrumb"> >> <xsl:param name = "item" select = >> "$navigation/nav-item[descendant-or-self::nav- >> item[@location=$sourceLoc]]"/> >> >> <xsl:call-template name = "breadcrumblink"> >> <xsl:with-param name = "item" select = "$item"/> >> </xsl:call-template> >> >> <xsl:if test = "not($item/@location=$sourceLoc)"> >> <xsl:text> >> > >> </xsl:text> >> >> <xsl:call-template name = "breadcrumb"> >> <xsl:with-param name = "item" select = >> "$item/nav-item[descendant-or-self::nav-item[@location=$sourceLoc]]"/ >> > >> </xsl:call-template> >> </xsl:if> >> </xsl:template> >> >> -Alex >> >> On May 3, 2005, at 4:56 AM, Carl Barrow wrote: >> >>> Hi Alex >>> >>> Attached is a screenshot from the navigation editor and then a >>> screenshot from the website showing where it has gone wrong. The >>> navigation xml file is detailed below: >>> >>> <?xml version="1.0" encoding="UTF-8"?> >>> <!DOCTYPE nav-template SYSTEM >>> "http://hypercontent.sourceforge.net/dtd/navigation.dtd"> >>> <nav-template customLabel="Home" labelWith="custom" >>> pattern="/index.xml" sortChildren="by-label"> >>> <nav-template pattern="/*/index.xml" sortChildren="by-label"> >>> <nav-template pattern="/*/*" sortChildren="by-label" /> >>> >>> <nav-template pattern="/*/*/index.xml" sortChildren="by-label"> >>> <nav-template pattern="/*/*/*" sortChildren="by-label" /> >>> </nav-template> >>> </nav-template> >>> </nav-template> >>> >>> Many Thanks >>> Carl >>> >>> Alex Vigdor wrote: >>> >>>> Hi Carl, >>>> It would be helpful to see the navigation XML (we'll often >>>> create an XML output for an xml-doctype that has all the includes >>>> but no transformation, to see what is feeding the transform), and >>>> perhaps a screenshot demonstrating where it has gone wrong. >>>> >>>> Alex >>>> >>>> On Apr 29, 2005, at 9:31 AM, Carl Barrow wrote: >>>> >>>>> I'm still having a problems getting breadcrumbs working properly >>>>> on my sites here in Hull. It always displays the first child at >>>>> a Particular level instead of the one which corresponds to the >>>>> directory you are actually in. Does anyone have time to take a >>>>> look at where I might be going wrong? >>>>> >>>>> Many Thanks >>>>> Carl >>>>> >>>>> <xsl:variable name = "navigation" select = >>>>> "/cms:wrapper/child::*/navigation"/> >>>>> <xsl:variable name = "sourceLoc" select = >>>>> "/cms:wrapper/cms:source/@path"/> >>>>> >>>>> >>>>> <xsl:template name = "breadcrumb"> >>>>> <xsl:param name = "item" select = >>>>> "$navigation/nav-item[//nav-item[@location=$sourceLoc]]"/> >>>>> >>>>> <xsl:call-template name = "breadcrumblink"> >>>>> <xsl:with-param name = "item" select = "$item"/> >>>>> </xsl:call-template> >>>>> >>>>> <xsl:if test = "not($item/@location=$sourceLoc)"> >>>>> <xsl:text> >>>>> > >>>>> </xsl:text> >>>>> >>>>> <xsl:call-template name = "breadcrumb"> >>>>> <xsl:with-param name = "item" select = >>>>> "$item/nav-item[//nav-item[@location=$sourceLoc]]"/> >>>>> </xsl:call-template> >>>>> </xsl:if> >>>>> </xsl:template> >>>>> >>>>> <xsl:template name = "breadcrumblink"> >>>>> <xsl:param name = "item" select = "."/> >>>>> >>>>> <a><xsl:attribute name = "href"> >>>>> <xsl:value-of select = "$item/@location"/> >>>>> </xsl:attribute> >>>>> >>>>> <xsl:value-of select = "$item/@label"/></a> >>>>> </xsl:template> >>>>> >>>>> >>>>> -- >>>>> ************************************ >>>>> >>>>> Carl Barrow >>>>> Web Developer >>>>> e-Services >>>>> The University of Hull >>>>> Cottingham Road >>>>> Hull >>>>> HU6 7RX >>>>> Ext. 6838 >>>>> ************************************ >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------- >>>>> SF.Net email is sponsored by: Tell us your software development >>>>> plans! >>>>> Take this survey and enter to win a one-year sub to SourceForge.net >>>>> Plus IDC's 2005 look-ahead and a copy of this survey >>>>> Click here to start! >>>>> http://www.idcswdc.com/cgi-bin/survey?id=105hix >>>>> _______________________________________________ >>>>> Hypercontent-users mailing list >>>>> Hyp...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/hypercontent-users >>>> >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.Net email is sponsored by: NEC IT Guy Games. >>>> Get your fingers limbered up and give it your best shot. 4 great >>>> events, 4 >>>> opportunities to win big! Highest score wins.NEC IT Guy Games. Play >>>> to >>>> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 >>>> _______________________________________________ >>>> Hypercontent-users mailing list >>>> Hyp...@li... >>>> https://lists.sourceforge.net/lists/listinfo/hypercontent-users >>> >>> >>> >>> -- >>> ************************************ >>> >>> Carl Barrow >>> Web Developer >>> e-Services >>> The University of Hull >>> Cottingham Road >>> Hull >>> HU6 7RX >>> Ext. 6838 >>> ************************************ >>> >>> <webpage.jpg><naveditor.jpg> >> >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: NEC IT Guy Games. >> Get your fingers limbered up and give it your best shot. 4 great >> events, 4 >> opportunities to win big! Highest score wins.NEC IT Guy Games. Play to >> win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 >> _______________________________________________ >> Hypercontent-users mailing list >> Hyp...@li... >> https://lists.sourceforge.net/lists/listinfo/hypercontent-users > > > -- > ************************************ > > Carl Barrow > Web Developer > e-Services > The University of Hull > Cottingham Road > Hull > HU6 7RX > Ext. 6838 > ************************************ > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best shot. 4 great > events, 4 > opportunities to win big! Highest score wins.NEC IT Guy Games. Play to > win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20 > _______________________________________________ > Hypercontent-users mailing list > Hyp...@li... > https://lists.sourceforge.net/lists/listinfo/hypercontent-users |