Forum

Thread tagged as: Question, Problem, Blog

Duplicate blog app - best way to do this

Hi,

I attempted to duplicate app to create a unique blog app for a different type of blog i want on my site. i realised duplicating was a non-starter - far too complex.

What is the best way to create a separate blog? i.e. i want a separate URL to the blog i..e /news and /success-stories

Both ideally managed separately in cms with different fields and slightly different look on the front-end

Would this be blog sections? or using categories or using different post.html templates. Or a mix of all? i'm slightly confused with all these configurations and how they all behave.

Thanks

Paul Langley

Paul Langley 0 points

  • 3 years ago
Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

Hello Paul,

If you are using regular Perch, you can have different post types so you can use different fields for different post types. However, all the posts appear under one listing.

If you are using Runway, you can add more than one blog and each blog can have its own master template for the post edit form. The posts are displayed separately in the control panel so it is easier to manage.

Hi Al

I am using standard perch.

So if the posts are all under 1 listing do all fields display? i.e. all the fields from the separate templates? Or does it somehow filter them?

Also, can i use a separate URL for each type of post?

Can you also tell me what the use for blog sections is?

Thanks for your help

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

So if the posts are all under 1 listing do all fields display? i.e. all the fields from the separate templates? Or does it somehow filter them?

I think if you use perch_blog_post(), it will display the post using the same edit form template. So if your post type is /templates/blog/posts/alt_post.html, the function, I think, will automatically use that template to display your post.

Also, can i use a separate URL for each type of post?

You can check for the postTemplate to conditionally output different URLs:

<perch:if id="postTemplate" value="posts/alt_post.html">
<a href="/success-stories/<perch:blog id="postSlug" />">
<perch:else/>
<a href="/news/<perch:blog id="postSlug" />">
</perch:if>

Can you also tell me what the use for blog sections is?

I never used sections, but they could be useful in your case. From the docs:

Creating two Blog Sections can be useful if you want to have two distinct blog or news-like sections of your site. For example a traditional Blog and a company news page.

I believe you would still need to use post types to have different edit forms, but using sections should allow you to list the posts in each section (news and success stories in your case) separately.

So:

  • Use post types to have different edit forms
  • Use sections to separate News and Success Stories posts and list them separately

Hi Hussein

Great thanks

One other thing: for post templates documentation it states:

The template for each new post type goes into the templates/blog/posts folder. For example you might have templates/blog/posts/news.html.

Once new templates are added, the user will be prompted to select a post type when creating a new post.

I added a new template to the folder. I was expecting to be prompted to choose post type - why am i not?

Thakns

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

I added a new template to the folder. I was expecting to be prompted to choose post type - why am i not?

If you add templates inside templates/blog/posts then you go to create a new post, you should be prompted to choose a post type. Is this not happening?

Hi

No its not happening, no

What type of prompt is it? a select box or modal window or something?

i am on perch and not perch runway - but documentation doesnt seem to discriminate

ta

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

It's a select box. It gives you the option to pick the default master template blog/post.html and any other templates in blogs/posts/.

No its not happening, no

I don't know why it wouldn't. It's not a Runway only feature. Perhaps Rachel or Drew can help here. If you post your diagnostic report, they should be able to assist you.

Perch is up to date PHP 5.4.45 version is okay, but a little out of date. Consider updating soon. MySQL 5.5.5-10.1.24-MariaDB is up to date Image processing available Summary information Perch: 3.1.1, PHP: 5.4.45, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO Server OS: Linux, cgi-fcgi Installed apps: content (3.1.1), assets (3.1.1), categories (3.1.1), perch_blog (5.6.1), perch_twitter (4.0) App runtimes: <?php $apps_list = [ 'perch_twitter', 'perch_blog' ]; PERCH_LOGINPATH: /development/locate/admin PERCH_PATH: /home/cluster-sites/4/t/twelveyardsout.com/public_html/development/locate/admin PERCH_CORE: /home/cluster-sites/4/t/twelveyardsout.com/public_html/development/locate/admin/core PERCH_RESFILEPATH: /home/cluster-sites/4/t/twelveyardsout.com/public_html/development/locate/admin/resources Image manipulation: GD PHP limits: Max upload 64M, Max POST 64M, Memory: 128M, Total max file upload: 64M F1: 3b606135b33e6a102526838f4152a807 Resource folder writeable: Yes HTTP_HOST: twelveyardsout.com DOCUMENT_ROOT: /home/cluster-sites/4/t/twelveyardsout.com/public_html REQUEST_URI: /development/locate/admin/core/settings/diagnostics/ SCRIPT_NAME: /development/locate/admin/core/settings/diagnostics/index.php

Extended:

Perch information Perch: 3.1.1 Production mode: Production (100) Installed apps: content (3.1.1), assets (3.1.1), categories (3.1.1), perch_blog (5.6.1), perch_twitter (4.0) DB driver: PDO DB tables: perch3_blog_authors (3), perch3_blog_comments (0), perch3_blog_index (268), perch3_blog_posts (4), perch3_blog_posts_to_tags (0), perch3_blog_sections (2), perch3_blog_tags (0), perch3_blog_webmention_queue (0), perch3_blogs (1), perch3_categories (3), perch3_category_counts (0), perch3_category_sets (2), perch3_content_index (2401), perch3_content_items (985), perch3_content_regions (289), perch3_menu_items (12), perch3_navigation (0), perch3_navigation_pages (0), perch3_page_templates (4), perch3_pages (36), perch3_resource_log (1876), perch3_resource_tags (67), perch3_resources (497), perch3_resources_to_tags (132), perch3_settings (32), perch3_twitter_scheduled_tweets (0), perch3_twitter_settings (1), perch3_twitter_tweets (40), perch3_user_passwords (1), perch3_user_privileges (37), perch3_user_role_privileges (2), perch3_user_roles (2), perch3_users (6) Users: 6 App runtimes: <?php $apps_list = [ 'perch_twitter', 'perch_blog' ]; Scheduled tasks for perch_blog: delete_spam_comments (1440 mins), publish_posts (1 mins), process_webmentions (1 mins) Scheduled tasks for perch_twitter: post_tweets (1 mins), update_tweets (60 mins) Editor plug-ins: ckeditor H1: a580f5023f8d1065b29bbf4c18f67f27 L1: fc8fc84fadf1e67c60c1e4be865890f3 F1: 3b606135b33e6a102526838f4152a807 headerColour: #00c0d4 content_singlePageEdit: 1 helpURL: siteURL: / hideBranding: 1 content_collapseList: 1 lang: en-gb installedAt: 3.1.1 update_3.1.1: done latest_version: on_sale_version: 3.1.1 headerScheme: dark dashboard: 1 sidebar_back_link: 1 content_frontend_edit: 1 hide_pwd_reset: 0 keyboardShortcuts: 0 content_hideNonEditableRegions: 0 content_skip_region_list: 0 assets_restrict_buckets: 0 perch_twitter_update: 4.0 perch_blog_site_name: perch_blog_post_url: /blog/post.php?s={postSlug} perch_blog_slug_format: %Y-%m-%d-{postTitle} perch_blog_akismet_key: perch_blog_max_spam_days: 0 perch_blog_comment_notify: 0 perch_blog_webmention_tx: 0 perch_blog_webmention_rx: 0 logoPath: /development/locate/admin/resources/locate-east-sussex-rgb-01-1.png perch_blog_update: 5.6 perch_successstories_update: 5.6 PERCH_DEVELOPMENT: 10 PERCH_STAGING: 50 PERCH_PRODUCTION: 100 PERCH_DB_USERNAME: locat-pkc-u-176731 PERCH_DB_SERVER: 46.32.240.39 PERCH_DB_DATABASE: locat-pkc-u-176731 PERCH_DB_PREFIX: perch3_ PERCH_TZ: UTC PERCH_EMAIL_FROM: langleyp@hotmail.com PERCH_EMAIL_FROM_NAME: paul langley PERCH_LOGINPATH: /development/locate/admin PERCH_PATH: /home/cluster-sites/4/t/twelveyardsout.com/public_html/development/locate/admin PERCH_CORE: /home/cluster-sites/4/t/twelveyardsout.com/public_html/development/locate/admin/core PERCH_RESFILEPATH: /home/cluster-sites/4/t/twelveyardsout.com/public_html/development/locate/admin/resources PERCH_RESPATH: /development/locate/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_ASSET_VERSION: 8255e4c4a367cfa3e2bd PERCH_DEBUG: PERCH_PREVIEW_ARG: preview PERCH_TEMPLATE_PATH: /home/cluster-sites/4/t/twelveyardsout.com/public_html/development/locate/admin/templates PERCH_TEMPLATE_FILTERS: PERCH_DEFAULT_DOC: index.php PERCH_DEFAULT_EXT: .php PERCH_PRODUCTION_MODE: 100 PERCH_XHTML_MARKUP: PERCH_RWD: 1 PERCH_HTML_ENTITIES: PERCH_SSL: PERCH_STRIPSLASHES: PERCH_PROGRESSIVE_FLUSH: 1 PERCH_PARANOID: PERCH_FORCE_SECURE_COOKIES: PERCH_DEFAULT_BUCKET: default PERCH_TRANSLATION_ASSIST: PERCH_PASSWORD_MIN_LENGTH: 6 PERCH_MAX_FAILED_LOGINS: 10 PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR PERCH_VERIFY_UPLOADS: PERCH_PRIV_ASSIST: PERCH_CUSTOM_EDITOR_CONFIGS: PERCH_ENABLE_EXIF: 1 PERCH_AUTH_PLUGIN: PERCH_DB_CHARSET: utf8 PERCH_DB_PORT: PERCH_DB_SOCKET: PERCH_APPS_EDITOR_PLUGIN: markitup PERCH_APPS_EDITOR_MARKUP_LANGUAGE: markdown Hosting settings PHP: 5.4.45 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.5-10.1.24-MariaDB Free disk space: 9.91 TB 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: W1mDiNjpcOzClJ2tAP6oagAAAAw SCRIPT_URL: /development/locate/admin/core/settings/diagnostics/ SCRIPT_URI: https://twelveyardsout.com/development/locate/admin/core/settings/diagnostics/ HTTP_HOST: twelveyardsout.com HTTP_UPGRADE_INSECURE_REQUESTS: 1 HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36 HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8 HTTP_REFERER: https://twelveyardsout.com/development/locate/admin/core/settings/diagnostics/add-ons/ HTTP_ACCEPT_ENCODING: gzip, deflate HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.9 HTTP_COOKIE: cmsa=1; MCPopupClosed=yes; PHPSESSID=9k0kafnh13gpvq5l4r07u4nn83 HTTP_X_BRAND: 123 HTTP_X_BRANDID: 2 HTTP_CONNECTION: close SERVER_SIGNATURE: <address>Apache/2.4.33 (Unix) Server at twelveyardsout.com Port 80</address> SERVER_SOFTWARE: Apache/2.4.33 (Unix) SERVER_NAME: twelveyardsout.com SERVER_ADDR: 10.16.12.14 SERVER_PORT: 80 REMOTE_ADDR: 194.102.14.122 DOCUMENT_ROOT: /home/cluster-sites/4/t/twelveyardsout.com/public_html REQUEST_SCHEME: http CONTEXT_DOCUMENT_ROOT: /home/cluster-sites/4/t/twelveyardsout.com/public_html SERVER_ADMIN: root@localhost SCRIPT_FILENAME: /home/cluster-sites/4/t/twelveyardsout.com/public_html/development/locate/admin/core/settings/diagnostics/index.php REMOTE_PORT: 43406 GATEWAY_INTERFACE: CGI/1.1 SERVER_PROTOCOL: HTTP/1.1 REQUEST_METHOD: GET QUERY_STRING: extended REQUEST_URI: /development/locate/admin/core/settings/diagnostics/?extended SCRIPT_NAME: /development/locate/admin/core/settings/diagnostics/index.php PHP_SELF: /development/locate/admin/core/settings/diagnostics/index.php REQUEST_TIME_FLOAT: 1532593032.9148 REQUEST_TIME: 1532593032

Hi,

Any update on this?

Drew McLellan

Drew McLellan 2638 points
Perch Support

What sort of update are you looking for?