Copied to clipboard

Flag this post as spam?

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


  • Trine 29 posts 89 karma points
    Sep 28, 2013 @ 20:34
    Trine
    0

    Node ID of deleted node still displaying on page

    I've had strange issue today which I can't seem to fix.

    I added a new property (a supporting link image) to an existing Document Type (a staff member). The content for this new property was pulled in from existing content elsewhere on the site. This displayed the node ID for the new property on the page. I then deleted the new property from the Document Type.

    However, the site now displays a "0" in the place where the property node ID was displaying and I can't get rid of it. This "0" not only displays on the current Document Type content, but on all new content created using this Document Type.

    I have tried republishing everything, creating new content and clearing my browser cache, but it's still there. What can I do?

     

    Thanks!

  • Jon Dunfee 199 posts 468 karma points
    Sep 28, 2013 @ 20:46
    Jon Dunfee
    0

    I assume there is an associated macro generating this output.  I would start there and look for clues, or copy/paste the offending macro and we can review the script.

  • Trine 29 posts 89 karma points
    Sep 28, 2013 @ 23:42
    Trine
    0

    This is the part of the template which the issue is appearing in:

        <div class="team-member"><umbraco:Macro Alias="TeamMember1" runat="server"></umbraco:Macro></div>

    In Firebug the HTML is showing as:

        <div class="team-member"><p><span>Lorem ipsum mofo that's the shizzle amizzle, consectetizzle bling bling elit. Nullizzle sapizzle funky fresh, hizzle volutpat, ghetto quis, boom shackalack vizzle, break it down. Pellentesque you son of a bizzle tortor. Sed erizzle.</span></p>0</div>


    The XSLT which the TeamMember1 macro is pulling in is:

        <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library"
        exclude-result-prefixes="msxml umbraco.library">

        <xsl:output method="xml" omit-xml-declaration="yes"/>
        <xsl:param name="currentPage"/>

        <xsl:template match="/">
            <xsl:apply-templates select="$currentPage/teamMember1[normalize-space()]" />
        </xsl:template>

        <xsl:template match="teamMember1">
            <xsl:variable name="data" select="umbraco.library:GetXmlNodeById(.)" />

            <xsl:apply-templates select="$data[not(error)]" mode="container" />
        </xsl:template>

        <xsl:template match="*" mode="children">
                <xsl:value-of select="text()" disable-output-escaping="yes" />
                <xsl:apply-templates select="child::node()[@isDoc]" mode="container" />
        </xsl:template>

        <xsl:template match="*" mode="container">
                <xsl:apply-templates select="child::node()" mode="children" />
        </xsl:template>

    </xsl:stylesheet>

     

    As you can see in the HTML, there is a "0" being pulled in from somewhere, and I can't for the life of me work out where from!

    Any ideas?

     

     

     

     

  • Jon Dunfee 199 posts 468 karma points
    Sep 29, 2013 @ 17:02
    Jon Dunfee
    100

    Have you tried outputting the XML to see what you are working with?

    <xsl:template match="teamMember1">
         <xsl:variable name="data" select="umbraco.library:GetXmlNodeById(.)" />
         <textarea><xsl:copy-of select="$data" /></textarea>
         <xsl:apply-templates select="$data[not(error)]" mode="container" />
    </xsl:template>

  • Trine 29 posts 89 karma points
    Sep 29, 2013 @ 19:20
    Trine
    0

    Sorry for being ignorant, but how do I do that?

     

  • Jon Dunfee 199 posts 468 karma points
    Sep 29, 2013 @ 20:26
    Jon Dunfee
    0

    Look at the snippet I provided, if you can add the line to your macro and preview it, a textarea box should appear with some XML populated inside.  A clue might be revealed.

    <textarea><xsl:copy-of select="$data" /></textarea>

  • Trine 29 posts 89 karma points
    Sep 29, 2013 @ 23:59
    Trine
    0

    You genius!

    Viewing the XML revealed this snippet:

        <umbracoNaviHide>0</umbracoNaviHide>

    It's rendering a Generic Property in the Document Type, and as that was set to false (not ticked) it was showing as a 0.

    It was rendering because the Macro is told to pull in all properties related to that Document Type (even those which are backend housekeeping), so removing the NaviHide solved the problem and the 0 is now gone!

     

    Thank you so much Jon! :-)

     

  • Jon Dunfee 199 posts 468 karma points
    Sep 30, 2013 @ 01:53
    Jon Dunfee
    0

    Sweet, so that doesn't happen again, you may want to find a XSLT guru or figure out how to limit your output to just the properties you want to display so this doesn't happen to you again.

Please Sign in or register to post replies

Write your reply to:

Draft