Forum

Thread tagged as: Problem

Content saving but not appearing

Ive been building templates and suddenly hit a point where no content added in the admin appears on the page. It saves fine, but doesn't show. If I use perch_content and then choose the template, there's no problem. But when I use this instead

<?php 
    perch_content_create('Header', array(
        'template' => '/case-studies/cs-header.html',
        'edit-mode' => 'listdetail'
    ));
?>

...the template doesn't render at all, but appears to save no problem. Note, this was working fine earlier but now has stopped. Im working on my localhost and have deleted and re added regions/templates several times and stopped/restarted MAMP.

Diagnostics

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)
DB driver: PDO
DB tables: perch2_blog_authors (1), perch2_blog_comments (0), perch2_blog_index (373), perch2_blog_posts (6), perch2_blog_posts_to_tags (0), perch2_blog_sections (1), perch2_blog_tags (0), perch2_blogs (1), perch2_categories (2), perch2_category_counts (2), perch2_category_sets (1), perch2_content_index (119), perch2_content_items (30), perch2_content_regions (9), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (5), perch2_pages (4), perch2_resource_log (89), perch2_resource_tags (0), perch2_resources (92), perch2_resources_to_tags (0), perch2_settings (12), perch2_user_passwords (0), perch2_user_privileges (34), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (2)
Users: 2
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog',
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: ckeditor, markitup, redactor
H1: c87b44bc657e9af37948723c0114367d
L1: deafd3d744d4853868dd3a0a40634081
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.29: done
latest_version: 2.8.15
on_sale_version: 2.8.29
perch_blog_update: 5.0.1
perch_blog_post_url: /blog/post.php?s={postSlug}
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: 05_dev
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: chris@05creative.com
PERCH_EMAIL_FROM_NAME: Chris James
PERCH_LOGINPATH: /perch
PERCH_PATH: /Applications/MAMP/htdocs/05creative/05-dev-site/perch
PERCH_CORE: /Applications/MAMP/htdocs/05creative/05-dev-site/perch/core
PERCH_RESFILEPATH: /Applications/MAMP/htdocs/05creative/05-dev-site/perch/resources
PERCH_RESPATH: /perch/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: /Applications/MAMP/htdocs/05creative/05-dev-site/perch/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_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_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 5.6.2
Zend: 2.6.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: 5.5.38
MySQL server: 5.5.38
Free disk space: 19.43 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, mysql, mysqli, session, PDO, pdo_sqlite, standard, posix, Reflection, Phar, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, gettext, mcrypt, yaz, pgsql, pdo_pgsql, pdo_mysql
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: dev05
HTTP_CONNECTION: keep-alive
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER: https://dev05/perch/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_COOKIE: cmsa=1; _ga=GA1.1.1793317530.1461080844; PHPSESSID=31404b679c35875c6fa1ca663fefcfb2
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache
SERVER_NAME: dev05
SERVER_ADDR: 127.0.0.1
SERVER_PORT: 80
REMOTE_ADDR: 127.0.0.1
DOCUMENT_ROOT: /Applications/MAMP/htdocs/05creative/05-dev-site
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: /Applications/MAMP/htdocs/05creative/05-dev-site/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 52539
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1466173510.36
REQUEST_TIME: 1466173510
argc: 1
Chris James

Chris James 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

perch_content_create() just creates a region if it doesn't exist. It would display a region. To display a region you need to use perch_content() or perch_content_custom()

I see Ive misunderstood how this works. I need to display a template while skipping the step where you choose the template in the dropdown list. How do I achieve that?

Simon Clay

Simon Clay 127 points

Hi, keep your perch_content_create code at the top of the page, this creates the region in Admin and selects the template automatically.

Then, add this where you'd like the content to show on the page:

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