Copied to clipboard

Flag this post as spam?

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


  • Roger Withnell 128 posts 613 karma points
    Aug 24, 2015 @ 14:51
    Roger Withnell
    0

    Content won't update immediately with domain names set in "Culture and Hostnames"

    I am using one instance of Umbraco for several independent websites.

    I have a root page, accessed by domain name root.com and then children of the root page, home pages of independent sites, accessed by their domain names, child1.com, child2.com etc. The home page of each of the child sites has its domain names set in the "Culture and Hostnames" section.

    Within one of the child sites, its home page displays the output of a macro to display a picture slider. The macro gets the pictures from a "Slider" page whose children each contains a picture, title and description. The Slider Macro code is:

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    
        <div id="myCarousel" class="carousel slide" data-ride="carousel">
    
            @{
                var vHomeNode = Model.Content.AncestorOrSelf(2);
                var vSliderNode = vHomeNode;
                foreach (var vNode in vHomeNode.Children)
                {
                    if (vNode.Name == "Slider")
                    {
                        vSliderNode = vNode;
                        break;
                    }
                }
            }
    
      <!-- Indicators -->
      <ol class="carousel-indicators">
          @{
              var vCtr = 0;
          }
          @foreach (var vItem in vSliderNode.Children)
          {
              if (vCtr == 0)
              {
                <li data-target="#myCarousel" data-slide-to="@vCtr" class="active"></li>
              }
              else
              {
                <li data-target="#myCarousel" data-slide-to="@vCtr"></li>
              }
              vCtr += 1;
          }
      </ol>
    
      <!-- Wrapper for slides -->
      <div class="carousel-inner" role="listbox" style="margin-bottom:16px">
          @{
              vCtr = 0;
        }
            @foreach (var vItem in vSliderNode.Children)
            {
                if (vCtr == 0)
                {
                    <div class="item active">
                        @{
                            var vMediaUrl= Umbraco.Media(vItem.GetPropertyValue("panorama")).Url;
                        }
                        <a href="http://www.brilley.co.uk" target="_blank">
                            <img src="@vMediaUrl" alt="@vItem.GetProperty("Title").Value" class="img-responsive" />
                            <div class="carousel-caption">
                                <h3>@vItem.GetProperty("Title").Value</h3>
                                <p>@vItem.GetProperty("Text").Value</p>
                            </div>
                        </a>
                    </div>
                    vCtr = 1;
                }
                else
                {
                    <div class="item">
                        @{
                            var vMediaUrl = Umbraco.Media(vItem.GetPropertyValue("panorama")).Url;
                        }
                        <img src="@vMediaUrl" alt="@vItem.GetProperty("Title").Value">
                        <div class="carousel-caption">
                            <h3>@vItem.GetProperty("Title").Value</h3>
                            <p>@vItem.GetProperty("Text").Value</p>
                        </div>
                    </div>
                }
            }
    </div>
    </div>
    

    In the front end, I can look at the home page of the site containing the slider in two ways: 1) root.com/child1/ or 2) child1.com

    What happens is this. Let's say there are four child pages under the Slider page. User 1 or 2 above, the picture slider display the four pictures correctly.

    I now add a fifth child page under the Slider page. Using 1 above, the five pictures are immediately displayed. Using 2 only four pictures continue to be displayed.

    I've tried reloading the nodes, refreshing the pages, deleting cookies, trying different browsers and different computers to no avail. However, after sleeping on it (or rather dreaming about it) using 2 above did display the five pages! But adding a sixth picture gave the same problem.

    I also tested my code because I thought, perhaps, that using the domain name set on Child1 in Culture and Hostnames, the level values might have changed but this is not the case. Using 1 and 2 gets the same ID values for vHomeNode and vSliderNode in the macro.

    Is this something to do with caching? The server uses Windows 2008 R2 with IIS7

    Your help would be much appreciated.

    Thanking you in anticipation.

    Roger

Please Sign in or register to post replies

Write your reply to:

Draft