Forum

Thread tagged as: Question, Problem

Region not appearing

Hi Drew,

I have a page template which contains two regions. When I create a page using this template the "Content" region doen't appear in the regions list. The really weird thing is that I've used it for two other pages and it has appeared.

Any thoughts

<article>  
   <h1 class="below-slider" class="balance-text"><?php perch_content('Main heading'); ?></h1>
   <?php perch_content_custom('Content', array (
   'paginate' => true,
   'count' => 4,
   )); ?>
</article>
<aside>
<h3>Resources</h3>
<?php perch_pages_navigation(array(
  'navgroup' =>'press',
  'template' =>'press.html',
  'levels' => 2
)); ?>
</aside>
Nick Loat

Nick Loat 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

perch_content_custom() doesn't create regions - you need to use perch_content() or perch_content_create() to create the region.

OK I'll give that a go. On the two pages that I though were using that template and are working is there a: way to check which page template is being used and b: if it is the same one will updating it lose the content they contain?

Just created a new page template using perch_content_create() and the region is still a no show. Is this correct?

   <?php perch_content_create('Content', array (
   'paginate' => true,
   'count' => 4,
   )); ?>

My understanding is that it would create a region call Content and that is contents would paginate after every fourth item.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Pagination is a setting for outputting a region - it has no impact on how it's created. So there are two distinct actions:

  1. creating a region
  2. displaying a region

perch_content() is unique in that it does both jobs.

perch_content_create() creates a region.

perch_content_custom() displays a region.

OK got it seems to be working. Many thanks

I was wondering is there a way that I can make the pagination count user definable?

Hang on it s not, I've used perch_content() and its creating the region but not displaying it.

OK got it now (sorry its taken so long for the peny to drop!)

This seems to have done it

   <?php perch_content_create('Content'); ?>

   <?php perch_content_custom('Content', array (
   'paginate' => true,
   'count' => 4,
   )); ?>

Is that the best way?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that's right.

Great. Thanks for you patience.

Hi Drew,

Sorry to open this up again, but the content region is still not being created (it has at least twice previously) but I've just added a new page in exactly the same way as before and… no "Content" region. same master page being used - really strange and frustrating.

The codefor the regions is…

<section>
<article>  
   <h1 class="below-slider" class="balance-text"><?php perch_content('Main heading'); ?></h1>
   <?php perch_content_create('Content'); ?>

   <?php perch_content_custom('Content', array (
   'paginate' => true,
   'count' => 4,
   )); ?>
</article>
<aside>
<h3>Resources</h3>
<?php perch_pages_navigation(array(
  'navgroup' =>'press',
  'template' =>'press.html',
  'levels' => 2
)); ?>
</aside>

</section>

Diagnostic below. (Not sure if its relevant but the pages are restricted to a member group.)

Perch information

    Perch: 2.8.15
    Production mode: Production (100)
    Installed apps: content (2.8.15), assets (2.8.15), categories (2.8.15), perch_forms (1.8.3), perch_gallery (2.8.6), perch_mailchimp (2.0.1), perch_blog (5.0), perch_newsfeed (1), perch_comments (1.1), perch_members (1.4), perch_backup (1.2), perch_twitter (3.5.1)
    DB driver: PDO
    DB tables: perch2_blog_authors, perch2_blog_comments, perch2_blog_index, perch2_blog_posts, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_blogs, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, perch2_mailchimp_campaigns, perch2_mailchimp_history, perch2_mailchimp_log, perch2_mailchimp_stats, perch2_mailchimp_subscribers, perch2_members, perch2_members_forms, perch2_members_member_tags, perch2_members_sessions, perch2_members_tags, perch2_navigation, perch2_navigation_pages, perch2_newsfeed, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_scheduled_tasks, perch2_settings, perch2_twitter_scheduled_tweets, perch2_twitter_settings, perch2_twitter_tweets, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
    Users: 2
    App runtimes:

    <?php
        $apps_list = array(
            'content', 
            'categories',
            'perch_blog',
            'perch_comments',
            'perch_forms',
            'perch_mailchimp',
            'perch_members',
            'perch_twitter',
            'perch_newsfeed',
        );

    Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
    Scheduled tasks for perch_mailchimp: update_list_stats (60 mins)
    Scheduled tasks for perch_twitter: post_tweets (1 mins), update_tweets (10 mins)
    Scheduled tasks for perch_newsfeed: update_news (1440 mins)
    Editor plug-ins: ckeditor, tinymce, redactor, markitup
    H1: 79a8ac065165c0a0be89b727cbba9fd0
    L1: e1c252c3a4472f148eba51660f761193
    headerColour: #ffffff
    content_singlePageEdit: 1
    helpURL:
    perch_mailchimp_secret: 60e4accf6814078a980df398cd18fded
    hideBranding: 1
    content_collapseList: 1
    lang: en-gb-alt
    update_2.8.8: done
    latest_version: 2.8.15
    on_sale_version: 2.8.15
    headerScheme: light
    dashboard: 1
    hide_pwd_reset: 0
    content_hideNonEditableRegions: 1
    content_frontend_edit: 0
    perch_blog_update: 5.0.1
    perch_blog_post_url: /news/post.php?s={postSlug}
    perch_backup_mysqldump_path:
    perch_blog_slug_format: %Y-%m-%d-{postTitle}
    perch_blog_akismet_key:
    perch_blog_max_spam_days: 1
    perch_comments_akismet_key:
    perch_gallery_bucket_mode: dynamic
    perch_gallery_bucket: default
    perch_mailchimp_api_key: d14886cc8f69d57462b8d13ccb0572d6-us4
    perch_mailchimp_list_id: a5132b78a9
    perch_mailchimp_campaign_url: /mailchimp/campaign.php?s={campaignSlug}
    perch_members_login_page: /members/login.php?r={returnURL}
    perch_blog_comment_notify: 1
    perch_gallery_basicUpload: 0
    siteURL: /
    perch_mailchimp_update: 2.0
    logoPath: /admin/resources/logo-RW.svg
    update_2.8.10: done
    perch_twitter_update: 3.5
    update_2.8.11: done
    update_2.8.13: done
    update_2.8.14: done
    update_2.8.15: done
    perch_members_update: 1.4
    perch_blog_site_name: Rapture & Wright
    PERCH_DEVELOPMENT: 10
    PERCH_STAGING: 50
    PERCH_PRODUCTION: 100
    PERCH_DB_USERNAME: cl18-rapture
    PERCH_DB_SERVER: localhost
    PERCH_DB_DATABASE: cl18-rapture
    PERCH_DB_PREFIX: perch2_
    PERCH_TZ: UTC
    PERCH_EMAIL_FROM: rebecca@raptureandwright.co.uk
    PERCH_EMAIL_FROM_NAME: Rebecca Aird
    PERCH_LOGINPATH: /admin
    PERCH_PATH: /home/sites/raptureandwright.co.uk/public_html/admin
    PERCH_CORE: /home/sites/raptureandwright.co.uk/public_html/admin/core
    PERCH_RESFILEPATH: /home/sites/raptureandwright.co.uk/public_html/admin/resources
    PERCH_RESPATH: /admin/resources
    PERCH_HTML5: 1
    PERCH_SCHEDULE_SECRET: junkanoo
    PERCH_RUNWAY:
    PERCH_ERROR_MODE: DIE
    PERCH_DATE_LONG: %d %B %Y
    PERCH_DATE_SHORT: %d %b %Y
    PERCH_TIME_SHORT: %H:%M
    PERCH_TIME_LONG: %H:%M:%S
    PERCH_DEBUG:
    PERCH_PREVIEW_ARG: preview
    PERCH_TEMPLATE_PATH: /home/sites/raptureandwright.co.uk/public_html/admin/templates
    PERCH_DEFAULT_DOC: index.php
    PERCH_DEFAULT_EXT: .php
    PERCH_PRODUCTION_MODE: 100
    PERCH_RWD:
    PERCH_HTML_ENTITIES:
    PERCH_SSL:
    PERCH_STRIPSLASHES:
    PERCH_PROGRESSIVE_FLUSH: 1
    PERCH_AUTH_PLUGIN:
    PERCH_DB_CHARSET: utf8
    PERCH_DB_PORT:
    PERCH_DB_SOCKET:
    PERCH_SESSION_TIMEOUT_MINS: 20
    PERCH_APPS_EDITOR_PLUGIN: markitup
    PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile

Hosting settings

    PHP: 5.5.30
    Zend: 2.5.0
    OS: Linux
    SAPI: cgi-fcgi
    Safe mode: not detected
    MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $
    MySQL server: 5.5.35
    Extensions: Core, date, ereg, libxml, openssl, pcre, zlib, bz2, calendar, ctype, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, sockets, mbstring, tokenizer, xml, cgi-fcgi, bcmath, curl, dom, enchant, fileinfo, gd, imap, intl, json, ldap, exif, mcrypt, mssql, mysqlnd, mysql, mysqli, odbc, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, recode, soap, sqlite3, sysvmsg, sysvsem, sysvshm, tidy, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip, mhash, ionCube Loader, Zend Guard Loader
    GD: Yes
    ImageMagick: No
    PHP max upload size: 64M
    PHP max form post size: 64M
    PHP memory limit: 128M
    Total max uploadable file size: 64M
    Resource folder writeable: Yes
    Session timeout: 24 minutes
    Native JSON: Yes
    Filter functions: Yes
    Transliteration functions: Yes
    PATH: /usr/local/bin:/usr/bin:/bin
    UNIQUE_ID: VktqgH8AAAEAADGliLsAAABR
    SCRIPT_URL: /admin/core/settings/diagnostics/
    SCRIPT_URI: https://raptureandwright.co.uk/admin/core/settings/diagnostics/
    HTTP_HOST: raptureandwright.co.uk
    HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:44.0) Gecko/20100101 Firefox/44.0
    HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    HTTP_ACCEPT_LANGUAGE: en-GB,en;q=0.5
    HTTP_ACCEPT_ENCODING: gzip, deflate
    HTTP_REFERER: https://raptureandwright.co.uk/admin/core/settings/diagnostics/
    HTTP_COOKIE: PHPSESSID=sfcs5omua8je1o6rqq1p335du2; cmsa=1; __atuvc=12%7C46; __atuvs=564b65ddb4fb683b00b; _ga=GA1.3.112149028.1447781854; p_m=9b222f43e1ca311859f5e2405b97b19566ede310; _gat=1
    HTTP_CONNECTION: close
    SERVER_SOFTWARE: Apache/2.4.16 (Unix)
    SERVER_NAME: raptureandwright.co.uk
    SERVER_ADDR: 10.0.1.178
    SERVER_PORT: 80
    REMOTE_ADDR: 92.31.70.246
    DOCUMENT_ROOT: /home/sites/raptureandwright.co.uk/public_html
    REQUEST_SCHEME: http
    CONTEXT_DOCUMENT_ROOT: /home/sites/raptureandwright.co.uk/public_html
    SERVER_ADMIN: root@localhost
    SCRIPT_FILENAME: /home/sites/raptureandwright.co.uk/public_html/admin/core/settings/diagnostics/index.php
    REMOTE_PORT: 50766
    GATEWAY_INTERFACE: CGI/1.1
    SERVER_PROTOCOL: HTTP/1.1
    REQUEST_METHOD: GET
    QUERY_STRING: extended
    REQUEST_URI: /admin/core/settings/diagnostics/?extended
    SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
    PHP_SELF: /admin/core/settings/diagnostics/index.php
    REQUEST_TIME_FLOAT: 1447783040.453
    REQUEST_TIME: 1447783040
Drew McLellan

Drew McLellan 2638 points
Perch Support

How about if you change

perch_content_create('Content');

to

perch_content('Content', true);

Seems to have done the trick. Any ideas why it did work before and then didn't - the inconsistency is a bit odd.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I think you probably need to pass a broader set of options to the create function, but it doesn't seem like that would serve you well in this instance.