Forum

Thread tagged as: Question, Problem

Shared region not updating on page templates

I appear to have an issue where a global footer which using a shared region is updating okay for normal pages at root level, but not updating on any sub pages that were created using a Perch pages template. On my site I have used templates to create toplevel and sublevel pages. (example template below). When the dynamic page is created it has the following string included:

<?php include(str_replace('/', DIRECTORY_SEPARATOR, '../perch/templates/pages/toplevel.php')); ?>

It would appear that it simply cannot find the template for updating the footer <?php perch_layout('global.footer'); ?> to make the change. I have tried removing the two dots before ../perch but this breaks the page. Can you advise where this string comes from? Is it default from Perch? And can you offer some advice on how to resolve this issue?

example page template

<?php include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php'); ?>

<?php perch_layout('global.header'); ?>

<?php perch_pages_navigation('navigation'); ?>

<?php perch_content('Page Style'); ?>


    <div class="main-content">
      <div class="container">
        <div class="top-level-wrapper">

            <?php perch_content('Blocks'); ?>


        </div>
      </div>
    </div><img class="tg-on-pages triangle-graphic" sizes="25vw" src="/images/triangle-graphic.png" srcset="/images/triangle-graphic-p-500.png 500w, /images/triangle-graphic-p-800.png 800w, /images/triangle-graphic-p-1080.png 1080w, /images/triangle-graphic.png 1128w">
  </div>

 <?php perch_layout('global.footer'); ?>

Diagnostics

Health check

 Perch is up to date
 PHP 5.6.30-0+deb8u1 is up to date
 MySQL 5.5.57-0+deb8u1 is up to date
 Image processing available
Summary information

Perch: 3.0.8, PHP: 5.6.30-0+deb8u1, MySQL: 5.5.57, with PDO
Server OS: Linux, apache2handler
Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), perch_blog (5.5.1), perch_members (1.6.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_members', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/www/perch
PERCH_CORE: /var/www/perch/core
PERCH_RESFILEPATH: /var/www/perch/resources
Image manipulation: Imagick
PHP limits: Max upload 16M, Max POST 16M, Memory: 128M, Total max file upload: 16M
F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
Resource folder writeable: Yes
HTTP_HOST: 217.112.148.242
DOCUMENT_ROOT: /var/www/
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

global footer template

<?php perch_content('Footer Content'); ?>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js" type="text/javascript"></script>
  <script src="/js/firstcitizen.js" type="text/javascript"></script>
  <script src="/js/fcf-aztech.js" type="text/javascript"></script>
  <!-- [if lte IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/placeholders/3.0.2/placeholders.min.js"></script><![endif] -->

<!-- JS script supplied by Aztech for iFrame -->
<script type="text/javascript">

    window.addEventListener('message', function(evt) {


        var instructions = JSON.parse(evt.data);

        var applicationFrame = document.getElementById('application-iframe');

        if (instructions.changeHeight) {

            applicationFrame.height = instructions.changeHeight;

        }

        if (instructions.scrollToTop) {


            //Get The IFrames' Top Position within it's parent

            var iFrameTop  = $(applicationFrame).offset().top;

            //Add The Scroll Position Within The IFrame

            var top =  parseInt(iFrameTop) + parseInt(instructions.scrollToTop);

            //Add The Height Of The NavBar

            var navbar = $('.navbar');

            if (navbar) top -= $(navbar).outerHeight();

            $('html, body').animate({
                    scrollTop: top
                }, 1200); //<-- The speed the window opens


        }

    });     

</script>




  <script>
    $(document).ready(function() {
        // ACCORDION BUTTON ACTION  
        $('div.heading-click').click(function(){
          if($(this).data("slided") === true) {
            $(this).next().slideUp('normal');
            $(this).data("slided", false);
          } else {
        $('div.heading-click').data('slided',false);
            $('div.content-reveal').slideUp('normal');
            $(this).next().slideDown('normal', function() {
              $('html, body').animate({
                scrollTop: $(this).parent().offset().top - 150
              }, 1200); //<-- The speed the window opens
            });
            $(this).data("slided", true);
          }
        });
        //HIDE THE DIVS ON PAGE LOAD  
        $("div.content-reveal").hide();
      });
  </script>
  <script>
    $(document).ready(function() {
        //FORM BUTTON ACCORDIAN ACTION  
        $('a.form-button').click(function(){      
          if($(this).data("slided") === true) {
            $('div.panel2').slideUp('normal');
        $(this).data("slided", false);
          } else {
            $('div.panel2').slideDown('normal', function() {
            $('html, body').animate({
                  scrollTop: $('div.panel2').offset().top - 150
              }, 1200); //<-- The speed the window opens
            });
            $(this).data("slided", true);
          }
        });
      });
  </script>
  <script>
    $(document).ready(function() {
        //FORM BUTTON ACCORDIAN ACTION  
  $("div.panel3").hide();
        $('a.continue2').click(function(){      
          if($(this).data("slided") === true) {
            $('div.panel3').slideUp('normal');
        $(this).data("slided", false);
          } else {
            $('div.panel3').slideDown('normal', function() {
            $('html, body').animate({
                  scrollTop: $('div.panel3').offset().top - 0
              }, 1200); //<-- The speed the window opens
            });
            $(this).data("slided", true);
          }
        });
      });
  </script>
  <script>
    $(document).ready(function() {
        //FORM BUTTON ACCORDIAN ACTION  
  $("div.panel4").hide();
        $('a.continue3').click(function(){      
          if($(this).data("slided") === true) {
            $('div.panel4').slideUp('normal');
        $(this).data("slided", false);
          } else {
            $('div.panel4').slideDown('normal', function() {
            $('html, body').animate({
                  scrollTop: $('div.panel4').offset().top - 0
              }, 1200); //<-- The speed the window opens
            });
            $(this).data("slided", true);
          }
        });
      });
  </script>
  <script>
    Webflow.push(function() {
      addCountries('#country-select');
      function addCountries(whereto) {
      var countriesfile = "Ireland, United Kingdom, United States of America, Afghanistan, Albania, Algeria, Andorra, Angola, Antigua & Deps, Argentina, Armenia, Australia, Austria, Azerbaijan, Bahamas, Bahrain, Bangladesh, Barbados, Belarus, Belgium, Belize, Benin, Bhutan, Bolivia, Bosnia Herzegovina, Botswana, Brazil, Brunei, Bulgaria, Burkina, Burma, Burundi, Cambodia, Cameroon, Canada, Cape Verde, Central African Rep, Chad, Chile, People's Republic of China, Republic of China, Colombia, Comoros, Democratic Republic of the Congo, Republic of the Congo, Costa Rica, Croatia, Cuba, Cyprus, Czech Republic, Denmark, Djibouti, Dominica, Dominican Republic, East Timor, Ecuador, Egypt, El Salvador, Equatorial Guinea, Eritrea, Estonia, Ethiopia, Fiji, Finland, France, Gabon, The Gambia, Georgia, Germany, Ghana, Greece, Grenada, Guatemala, Guinea, Guinea-Bissau, Guyana, Haiti, Honduras, Hungary, Iceland, India, Indonesia, Iran, Iraq, Israel, Italy, Ivory Coast, Jamaica, Japan, Jordan, Kazakhstan, Kenya, Kiribati, North Korea, South Korea, Kosovo, Kuwait, Kyrgyzstan, Laos, Latvia, Lebanon, Lesotho, Liberia, Libya, Liechtenstein, Lithuania, Luxembourg, Macedonia, Madagascar, Malawi, Malaysia, Maldives, Mali, Malta, Marshall Islands, Mauritania, Mauritius, Mexico, Micronesia, Moldova, Monaco, Mongolia, Montenegro, Morocco, Mount Athos, Mozambique, Namibia, Nauru, Nepal, Netherlands, New Zealand, Nicaragua, Niger, Nigeria, Norway, Oman, Pakistan, Palau, Palestine, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland, Portugal, Qatar, Romania, Russian Federation, Rwanda, St Kitts & Nevis, St Lucia, Saint Vincent & the, Grenadines, Samoa, San Marino, Sao Tome & Principe, Saudi Arabia, Senegal, Serbia, Seychelles, Sierra Leone, Singapore, Slovakia, Slovenia, Solomon Islands, Somalia, South Africa, Spain, Sri Lanka, Sudan, Suriname, Swaziland, Sweden, Switzerland, Syria, Tajikistan, Tanzania, Thailand, Togo, Tonga, Trinidad & Tobago, Tunisia, Turkey, Turkmenistan, Tuvalu, Uganda, Ukraine, United Arab Emirates, Uruguay, Uzbekistan, Vanuatu, Vatican City, Venezuela, Vietnam, Yemen, Zambia, Zimbabwe";
      var countries = countriesfile.split(", ");
      for(var c = 0; c<countries.length; c++) {
        $(whereto).append('<option value="' + countries[c] + '">' + countries[c] + '</option>');
      }
    }
    });
  </script>
<script>
Webflow.push(function() {

  addCounties('#roi-county-select');
  function addCounties(whereto) {

  var countiesfile = "Carlow, Cavan, Clare, Cork, Donegal, Dublin, Galway, Kerry, Kildare, Kilkenny, Laois, Leitrim, Limerick, Longford, Louth, Mayo, Meath, Monaghan, Offaly, Roscommon, Sligo, Tipperary, Waterford, Westmeath, Wexford, Wicklow";

  var counties = countiesfile.split(", ");
  for(var c = 0; c<counties.length; c++) {
    $(whereto).append('<option value="' + counties[c] + '">' + counties[c] + '</option>');
  }
}
});
</script>

<script>
Webflow.push(function() {

  addCounties('#roi-county-select-2');
  function addCounties(whereto) {

  var countiesfile = "Carlow, Cavan, Clare, Cork, Donegal, Dublin, Galway, Kerry, Kildare, Kilkenny, Laois, Leitrim, Limerick, Longford, Louth, Mayo, Meath, Monaghan, Offaly, Roscommon, Sligo, Tipperary, Waterford, Westmeath, Wexford, Wicklow";

  var counties = countiesfile.split(", ");
  for(var c = 0; c<counties.length; c++) {
    $(whereto).append('<option value="' + counties[c] + '">' + counties[c] + '</option>');
  }
}
});
</script>




  <script>
    Webflow.push(function() {
      addCounties('#county-select');
      function addCounties(whereto) {
      var countiesfile = "Antrim, Armagh, Carlow, Cavan, Clare, Cork, Derry, Donegal, Down, Dublin, Fermanagh, Galway, Kerry, Kildare, Kilkenny, Laois, Leitrim, Limerick, Longford, Louth, Mayo, Meath, Monaghan, Offaly, Roscommon, Sligo, Tipperary, Tyrone, Waterford, Westmeath, Wexford, Wicklow";
      var counties = countiesfile.split(", ");
      for(var c = 0; c<counties.length; c++) {
        $(whereto).append('<option value="' + counties[c] + '">' + counties[c] + '</option>');
      }
    }
    });
  </script>
  <script>
    Webflow.push(function() {
      addYears('#years-select');
      function addYears(whereto) {
      var yearsfile = "1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 ";
      var years = yearsfile.split(", ");
      for(var c = 0; c<years.length; c++) {
        $(whereto).append('<option value="' + years[c] + '">' + years[c] + '</option>');
      }
    }
    });
  </script>
</body>
</html>
Cormac Kerrigan

Cormac Kerrigan 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are the regions showing up as shared in the control panel, or do they also appear on those pages as page-local regions?

No there is only one shared region in the control panel, controlled by the template 'footer content'. That then displays the global footer for all pages. Only now when I add an image to the global footer via the 'footer content' template is will not display on dynamic pages.

Do you have any further update/advise on what the issue is here?

Resolved the issue, thanks.