Copied to clipboard

Flag this post as spam?

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


  • Ast355 2 posts 22 karma points
    Sep 26, 2013 @ 15:24
    Ast355
    0

    Top node stops being homepage after publishing causing 404

    I'm using Umbraco 6.1.1.

    Also, the 'Link to document' changes from '/' to 'home.aspx'. After publishing, it is necessary to go to 'Republish entire site' to get things back to normal.

    I'd really appreciate any help sorting this out quickly, as we are handing over the site to a client soon so this is obviously quite a big problem for us.

     

    Thanks in advance.

  • Ast355 2 posts 22 karma points
    Sep 26, 2013 @ 16:00
    Ast355
    0

    This seems to have sorted it out. It still doesn't show '/' as the 'Link to document' (or in the navigation), but using just the domain name in the browser is now going to the right page.

     

    using Umbraco.Core;

    using umbraco.BusinessLogic;

    using umbraco.cms.businesslogic;

    using umbraco.cms.businesslogic.web;

     

    namespace Umbraco.Extensions.EventHandlers

    {

        public class RegisterEvents : ApplicationEventHandler

        {

            protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)

            {

                Document.AfterPublish += Document_AfterPublish;

            }

     

            private void Document_AfterPublish(Document sender, PublishEventArgs e)

            {

                Log.Add(LogTypes.Debug, sender.Id, "the document " + sender.Text + " has just been published about to refresh");

     

                umbraco.library.RefreshContent();

            }

        }

    }

Please Sign in or register to post replies

Write your reply to:

Draft