Forum

Thread tagged as: Question

Page attributes not set when creating a page

For a master page I have a bodyclass page attribute specifically set for the given referenced page however when I create a page from it the page attribute isn't set and instead you have to manually set in Page Details after page has been created.

What could I be doing wrong?

Neil Duddridge

Neil Duddridge 1 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

I'd need to see some code otherwise I'd be making vague guesses :)

If you can post your Diagnostics Report and the code/step by step to reproduce then we can help much faster.

Hi Rachel

Page Details of ‘referenced’ page https://www.evernote.com/l/Ai9pGuX3dSBKIa--Dmk3bvqS_rINWfmUAwU

Master Page https://www.evernote.com/l/Ai-jbzPEXFdF642fQ_Zyu2tjhQ-fDR3NpJg

Creating a page https://www.evernote.com/l/Ai-rfEFjNLdCzYhk6NdEalvdpe7O4V-QPwU

Page Details of created page https://www.evernote.com/l/Ai9XgdKNzbROxoynPbcg1Dwu3ZV7lNRVyQ4

Master page code is this

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

    perch_layout('global.header');

    // Get Perch page title for content
    $pg_title = perch_pages_title(true); 

    PerchSystem::set_var('page_title', $pg_title);

    perch_content_custom('Page Banner', array(
        'template'=>'page_banner.html'
    ));
    //

    perch_pages_breadcrumbs();

    perch_layout('page.service');   

    perch_content('Get A Quote');

    perch_layout('global.footer');

?>

In the global.header code there is this


<body class="<?php perch_page_attribute('bodyclass', array( 'template' => 'body_attributes.html' )); ?> layout_changer">

PERCH INFORMATION

Perch: 2.8.29
Production mode: Production (100)
Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), perch_blog (5.0), perch_forms (1.8.3), perch_gallery (2.8.6)
DB driver: PDO
DB tables: perch2_blog_authors (2), perch2_blog_categories (4), perch2_blog_comments (0), perch2_blog_index (855), perch2_blog_posts (30), perch2_blog_posts_to_categories (47), perch2_blog_posts_to_tags (89), perch2_blog_sections (1), perch2_blog_tags (98), perch2_blogs (1), perch2_categories (4), perch2_category_counts (3), perch2_category_sets (1), perch2_content_index (452), perch2_content_items (80), perch2_content_regions (25), perch2_content_resources (0), perch2_forms (1), perch2_forms_responses (10), perch2_gallery_albums (27), perch2_gallery_image_versions (3504), perch2_gallery_images (584), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (2), perch2_pages (14), perch2_resource_log (374), perch2_resource_tags (0), perch2_resources (348), perch2_resources_to_tags (0), perch2_settings (32), perch2_user_passwords (0), perch2_user_privileges (43), perch2_user_role_privileges (22), perch2_user_roles (2), perch2_users (2)
Users: 2
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog',
        'perch_gallery',
        'perch_forms',
    );
?>
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: ckeditor, markitup, redactor
H1: 2627a80131b0b1078c651cde2f352d0f
L1: 9e1883be335fc9c6a6286bae79f2d0f6
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.1.4: done
latest_version: 2.8.15
headerScheme: light
dashboard: 1
content_hideNonEditableRegions: 0
logoPath: /site_admin/resources/dgstrees-logo-cms.png
perch_blog_post_url: /blog/post.php?s={postSlug}
perch_blog_update: 5.0.1
update_2.2.5: done
update_2.2.7: done
perch_gallery_update: 2.8.5
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_gallery_bucket_mode: single
perch_gallery_bucket: default
perch_blog_comment_notify: 0
perch_gallery_basicUpload: 0
update_2.8.29: done
on_sale_version: 2.8.29
perch_blog_site_name:
perch_blog_max_spam_days: 0
hide_pwd_reset: 0
content_frontend_edit: 0
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_PORT: 8889
PERCH_DB_DATABASE: dgstrees_dev
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: #
PERCH_EMAIL_FROM_NAME: #
PERCH_LOGINPATH: /site_admin
PERCH_PATH: #
PERCH_CORE: #
PERCH_RESFILEPATH: #
PERCH_RESPATH: /site_admin/resources
PERCH_HTML5: 1
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_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: #
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_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 7.0.0
Zend: 3.0.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: 7e72f9690b1498a1bead7a637c33a831c0d2f655 $
MySQL server: 5.5.42
Free disk space: 90.32 GB
Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, mcrypt, pgsql, pdo_pgsql
GD: Yes
ImageMagick: No
PHP max upload size: 32M
PHP max form post size: 32M
PHP memory limit: 128M
Total max uploadable file size: 32M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
HTTP_HOST: dgstrees.dev:8888
HTTP_CONNECTION: keep-alive
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER: #
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_COOKIE: cmsa=1; TawkConnectionTime=0; __tawkuuid=e::dgstrees.dev::dP1/a/MDskFrrMRmsItyGGo+Zm4Qd/cbn9+tPYBNyeM4WL6/2uw6mMAXfH33TT1Y::2; Tawk_56e5e22d1e82531d56946d50=vs13.tawk.to:443::0; PHPSESSID=31d3a36de8cf544b8ac3b3dff1cf1e8d
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache
SERVER_NAME: dgstrees.dev
SERVER_ADDR: ::1
SERVER_PORT: 8888
REMOTE_ADDR: ::1
DOCUMENT_ROOT: #
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: #
REMOTE_PORT: 57991
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /site_admin/core/settings/diagnostics/?extended
SCRIPT_NAME: /site_admin/core/settings/diagnostics/index.php
PHP_SELF: /site_admin/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1466533806.31
REQUEST_TIME: 1466533806
argc: 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

When you create a new referenced page, the region properties can be copied, but the page attributes are not. This is because it's a new page.

Ok thanks Drew, that explains it