Forum

Thread tagged as: Question

How to use perch:blog as per perch:content

I have been able to edit .html blog templates however how would I go about "recycling" content to use in a regular page?

I have a /blog/ folder of which I have copied .php templates into and the .html templates in /perch/templates/content/blog/ are working so I guess what I am after is some kind of variable but not in the sense of dataselect

Thanks for any help

Garth Holmes

Garth Holmes 1 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What are you trying to do?

Hi Drew,

I am trying to use the blog title as the <title></title> in posts.

Cheers

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can you post your Diagnostic Report please?


Perch information Perch: 2.8.8 Production mode: Production (100) Installed apps: content (2.8.8), assets (2.8.8), categories (2.8.8), perch_blog (4.6), perch_forms (1.8.3), perch_mailchimp (2.0.1), perch_members (1.2), perch_backup (1.2) 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_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_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_scheduled_tasks, perch2_settings, 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_forms', 'perch_mailchimp', 'perch_members', ); ?> Scheduled tasks for perch_blog: delete_spam_comments (1440 mins) Scheduled tasks for perch_mailchimp: update_list_stats (60 mins) Editor plug-ins: markitup H1: 105ac2522953975ae65ce63d3a19775a L1: 6a10ba8fd6cf183b9e51e15979d54d45 headerColour: #ffffff content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 0 content_collapseList: 1 lang: en-gb update_2.1.4: done latest_version: 2.8 update_2.3.3: done on_sale_version: 2.8.8 update_2.3.4: done update_2.4: done update_2.4.1: done update_2.4.2: done update_2.4.3: done update_2.4.4: done update_2.4.5: done update_2.4.6: done update_2.4.7: done update_2.4.9: done update_2.5: done update_2.5.2: done update_2.5.3: done update_2.5.4: done update_2.6: done update_2.6.3: done update_2.6.6: done update_2.7: done update_2.7.2: done update_2.7.3: done update_2.7.4: done update_2.7.5: done update_2.7.6: done update_2.7.7: done update_2.7.8: done update_2.7.9: done update_2.7.10: done update_2.8.2: done update_2.8.4: done update_2.8.5: done update_2.8.6: done update_2.8.7: done perch_blog_update: 5.0 perch_blog_post_url: /blog/{postSlug} perch_mailchimp_secret: 7623a548bd20a1094942ff47dc42fd68 perch_mailchimp_update: 2.0 headerScheme: light perch_members_login_page: /members/login.php?r={returnURL} perch_blog_slug_format: {postTitle} perch_blog_akismet_key: perch_blog_max_spam_days: 0 perch_mailchimp_api_key: perch_mailchimp_list_id: perch_mailchimp_campaign_url: /mailchimp/campaign.php?s={campaignSlug} perch_backup_mysqldump_path: dashboard: 0 hide_pwd_reset: 0 content_hideNonEditableRegions: 0 content_frontend_edit: 0 perch_blog_comment_notify: 0 update_2.8.8: done PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: sitemast_myperch PERCH_DB_SERVER: localhost PERCH_DB_DATABASE: PERCH_DB_PREFIX: perch2_ PERCH_TZ: UTC PERCH_EMAIL_FROM: PERCH_EMAIL_FROM_NAME: PERCH_LOGINPATH: /perch PERCH_PATH: /home/sitemaster/public_html/perch PERCH_CORE: /home/sitemaster/public_html/perch/core PERCH_RESFILEPATH: /home/sitemaster/public_html/perch/resources PERCH_RESPATH: /perch/resources PERCH_HTML5: 1 PERCH_DEBUG: PERCH_APPS_EDITOR_MARKUP_LANGUAGE: html PERCH_APPS_EDITOR_PLUGIN: ckeditor 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_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /home/sitemaster/public_html/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_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: Hosting settings PHP: 5.4.41 Zend: 2.4.0 OS: Linux SAPI: cgi-fcgi Safe mode: not detected MySQL client: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $ MySQL server: 5.5.42-cll Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, fileinfo, filter, ftp, gd, hash, iconv, SPL, json, mcrypt, session, mysql, mysqli, standard, Phar, posix, Reflection, mysqlnd, SimpleXML, sockets, imap, tokenizer, xml, xmlreader, xmlwriter, zip, cgi-fcgi, PDO, pdo_sqlite, pdo_mysql GD: Yes ImageMagick: No PHP max upload size: 32M PHP max form post size: 64M 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: No DOCUMENT_ROOT: /home/sitemaster/public_html GATEWAY_INTERFACE: CGI/1.1 HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8,text/vnd.wap.wml;q=0.6 HTTP_ACCEPT_ENCODING: gzip, deflate HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.5 HTTP_CONNECTION: keep-alive HTTP_COOKIE: PHPSESSID=5869eca610f838b2b5650b6d4cc2c2a2; cmsa=1; __zlcmid=VBeidPrGaxb5e9 HTTP_HOST: HTTP_REFERER: HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0 SeaMonkey/2.33.1 PATH: /bin:/usr/bin QUERY_STRING: extended REDIRECT_STATUS: 200 REMOTE_ADDR: 59.167.232.140 REMOTE_PORT: 62744 REQUEST_METHOD: GET REQUEST_URI: /perch/core/settings/diagnostics/?extended SCRIPT_FILENAME: /home/sitemaster/public_html/perch/core/settings/diagnostics/index.php SCRIPT_NAME: /perch/core/settings/diagnostics/index.php SERVER_ADDR: 27.124.121.210 SERVER_ADMIN: SERVER_NAME: SERVER_PORT: 80 SERVER_PROTOCOL: HTTP/1.1 SERVER_SIGNATURE: <address>Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 Server at </address> SERVER_SOFTWARE: Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 UNIQUE_ID: VXkY6xt8edIAAHjh5OYAAAAS PHP_SELF: /perch/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1433999595.19 REQUEST_TIME: 1433999595 argc: 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can use:

<?php perch_blog_post_field(perch_get('s'), 'postTitle'); ?>

That is totally awesome, Drew.

Thank you once again.