Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • PedroM. 28 posts 87 karma points
    Jan 21, 2014 @ 16:32
    PedroM.
    0

    Help with breadcrumb and multiple sites

    Hi,

    I have a XSLT to make my breadcrumb

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
      <!ENTITY nbsp "&#x00A0;">
    ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:umbraco.library="urn:umbraco.library"
        exclude-result-prefixes="umbraco.library"
    >

      <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />

      <xsl:param name="currentPage"/>

      <xsl:variable name="minLevel" select="1"/>
      <xsl:variable name="sep" select="/macro/separator"/>
     
     <!-- Grab the top node -->
        <xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@minLevel = $minLevel]" />
       
      <xsl:template match="/">
        <xsl:if test="$currentPage/@level &gt; $minLevel">
          <xsl:for-each select="$currentPage/ancestor::* [@level &gt; $minLevel and string(umbracoNaviHide) != '1']">
            <!--umbracoNaviInactive-->
            <xsl:choose>
              <xsl:when test="string(umbracoNaviInactive) != '1'">
                <a href="{umbraco.library:NiceUrl(@id)}">
                  <xsl:value-of select="@nodeName"/>
                </a>
              </xsl:when>
              <xsl:otherwise>
                <span class="inactive">
                  <xsl:value-of select="@nodeName"/>
                </span>
              </xsl:otherwise>
            </xsl:choose>
            <span class="sep">
              <xsl:value-of disable-output-escaping="yes" select="$sep"/>
            </span>
          </xsl:for-each>
          <!-- print currentpage -->
          <span class="sel">
            <xsl:value-of select="$currentPage/@nodeName"/>
          </span>
        </xsl:if>
      </xsl:template>
    </xsl:stylesheet>

     

    Have created the site like this

    site1 ( domain1: this is the IIS binding of the server)
    site1/en ( domain1/en)

    <umbracoUseDomainPrefixes> config is set to true

    It's giving a error opening the site

     

     

    Specified cast is not valid.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidCastException: Specified cast is not valid.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [InvalidCastException: Specified cast is not valid.]
       System.Data.SqlClient.SqlBuffer.get_Byte() +52
       umbraco.DataLayer.RecordsReaderAdapter`1.GetByte(String fieldName) +147
       umbraco.cms.businesslogic.macro.MacroProperty.setup() +356
       umbraco.cms.businesslogic.macro.MacroProperty.GetProperties(Int32 MacroId) +314
       umbraco.cms.businesslogic.macro.MacroModel..ctor(Macro m) +232
       umbraco.macro..ctor(String alias) +302
       umbraco.presentation.templateControls.Macro.CreateChildControls() +1323
       System.Web.UI.Control.EnsureChildControls() +189
       System.Web.UI.Control.InitRecursive(Control namingContainer) +186
       System.Web.UI.Control.InitRecursive(Control namingContainer) +421
       System.Web.UI.Control.InitRecursive(Control namingContainer) +421
       System.Web.UI.Control.InitRecursive(Control namingContainer) +421
       System.Web.UI.Control.InitRecursive(Control namingContainer) +421
       System.Web.UI.Control.InitRecursive(Control namingContainer) +421
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2098
    

     

     

     

    I'm not sure what is the issue on the breadcrumb code.

    Someone can explain me what is missing or is wrong?

Please Sign in or register to post replies

Write your reply to:

Draft