Forum

Thread tagged as: Error

Display region to another page

I want to get a region to display on another page. But i'm getting an error "No matching content regions found. Check region name (Subpages left content) and page path options."

On my test page I have the following:

 <?php
 perch_content_custom('Subpages left content', array(
 'skip-template' => false,
 'template'=>'subpages/catlist_test.html'
 ));
 ?>

On my the other page

                            perch_content_create('Subpages left content', array(
                            'template' => 'subpages/subpages_details_left_column.html',
                            'multiple' => false,
                            'sort' => 'date',
                            'sort-order' => 'DESC',
                            'searchable' => true,
                            'filter' => 'slug',
                            'match' => 'eq',
                            'value' => perch_get('s'),
                            'count' => 1,
                            ));
                            perch_content_custom('Subpages left content', array(
                            'skip-template' => false,
                            'template'=>'subpages/subpages_details_left_column.html'
                            ));
Edward Johansen

Edward Johansen 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

perch_content_custom() will retrieve regions for the current page, unless you specify that it should get them from a different page. You do that with the page option.

perch_content_custom('Subpages left content', [
    'template'=>'subpages/catlist_test.html',
    'page' => '/path/to/page/with/region/on.php',
]);