Copied to clipboard

Flag this post as spam?

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


  • Matt Salmon 22 posts 43 karma points
    Oct 14, 2010 @ 14:21
    Matt Salmon
    0

    Changing document and template aliases breaks navigation macro

    Hi all,

    I've got a site I'm developing in Umbraco v 4.5.2 (Assembly version: 1.0.3891.20719), so a pretty recent version, and have discovered that if I re-name a document type alias (and associated template alias), my navigation mac has started showing duplicate links to the pages in my site.

    To explain further, take this a simplified version of my site hierarchy:

    Home

    - About Us

    - Contact Us

    I have a top navigation macro used in my master template which lists the pages directly below the home node using an XSLT foreach loop, as follows (this seems to be the standard way of achieving this):

    <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">

    When I first set the site up, this was working perfectly. My 2 sub pages were based on a document type called 'Content', but I've since added an additional template for content, so it made sense for my 2 templates to be called "Single Column" and "Two Column" to represent the way the content is laid out. So I renamed my document types, and templates accordingly.

    However, now when I look at my site, the top navigation has 4 items (each top-level item is duplicated). This isn't the reflective of the content tree in the back office, which just shows the original 2 items.

    I've tried re-starting the app pool and the website but it makes no difference. I figure this is probably a bug, and that the change hasn't propagated through the database correctly, so I took a look at the database tables to see if I could figure out what the problem is. The only odd thing I can notice is that in the "cmsDocument" table, for each page there's obviously multiple versions, but the one with the most recent 'updateDate' has its published flag set to 'false' (it's the chronologically penultimate record that is set to published=True). I'd expect to see the most recently updated version as the published one.

    I'll raise a bug on CodePlex in due course, but for now I just need to get this site sorted. Can anyone suggest how I can get around this problem?

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Oct 14, 2010 @ 14:29
    Aaron Powell
    0

    Have you done a full republish of your site?

    Are the pages appearing multiple times in the XML cache?

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Oct 14, 2010 @ 14:30
    Nik Wahlberg
    0

    Hi Matt, did you try to Republish entire site from the root node in your content tree? This sounds like an XML cache issue. 

    HTH,
    Nik

  • Matt Salmon 22 posts 43 karma points
    Oct 14, 2010 @ 14:43
    Matt Salmon
    0

    Thanks guys, really really appreciate the help.

    I right-clicked my home node, selected 'publish' and checked the box for 'all child nodes', but that didn't resolve it.

    So then I read this article on XML caching, which informed me that the umbraco.config file (in the App_Data folder in this version) is the XML cache:

    http://forum.umbraco.org/yaf_postst4161_Umbraco-caching-explained.aspx

    So, I deleted that file and hey presto, my navigation is back to normal. Great to know there's a simple fix if I ever come across that again, although from what I read I would've thought that re-publishing and re-starting IIS should clear the cache and resolve the problem. Do you think there's still a case for filing a bug?

     

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Oct 14, 2010 @ 14:46
    Nik Wahlberg
    0

    You should have used the "Republish entire site" available from the Content node. That would have done the same thing for you. And, this does not sound like it warrants a bug entry in codeplex. 

    Cheers.

  • Matt Salmon 22 posts 43 karma points
    Oct 14, 2010 @ 14:53
    Matt Salmon
    0

    Ah yes, I see.

    Fair enough, well thanks again.

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Oct 14, 2010 @ 15:00
    Nik Wahlberg
    0

    You bet, glad to help. 

Please Sign in or register to post replies

Write your reply to:

Draft