Forum

Thread tagged as: Question

Blog App Questions

Hello, I have two questions regarding the Blog app (5.0):

  • I've imported about 800 posts from WP, and am running into a problem where several posts have the same title (for a recurring weekly topic) and so they also have the same slug. WP handles this problem by adding incrementing numerals to the end of duplicate slugs, which I would love to see in Perch, something like prevent-duplicate="true" would be awesome. For now, though, it seems I can't even change the slug without changing the title. I've set editable="true" indelible="false" on postSlug in post.html, but when I change the slug and save, the slug reverts back to the automatically generated slug which is based on postTitle.
  • Is it possible to add an author selection to the post edit page, or can that now only be changed in the Meta and Social tab?

post.html:

<perch:blog id="postURL" type="hidden" />
<perch:blog id="postTitle" type="text" label="Title" required="true" size="xl autowidth" />
<perch:blog id="postDescHTML" type="textarea" label="Post" editor="ckeditor" html="true" size="xxl autowidth" required="true" />

<perch:blog id="feat_img" type="image" width="1920" quality="90" label="Featured Image" bucket="blog" divider-before="Options" />
<perch:blog id="excerpt" type="textarea" label="Excerpt" suppress="true" size="s" />
<perch:repeater id="highlights" label="Highlights"><perch:blog id="highlight" type="textarea" label="Highlight" size="s" /></perch:repeater>

<perch:blog id="postDateTime" type="date" label="Date" time="true" format="Y-m-d H:i:s" divider-before="Publishing" />
<perch:categories id="categories" set="blog" label="Categories" display-as="checkboxes" >
  <perch:before>Category: </perch:before>
  <a href="/blog/category/<perch:category id="catSlug" type="slug" />"><perch:category id="catTitle" type="text" /></a><perch:if not-exists="perch_item_last">, </perch:if>
</perch:categories>
<perch:blog id="postSlug" type="slug" for="postTitle" editable="true" indelible="false" label="Slug" help="Leave blank to automatically generate. Please ensure slug is unique for all posts." />

<perch:noresults>
  Nope.
</perch:noresults>

Diagnostics:

HEALTH CHECK

Perch Runway is up to date
PHP 5.6.14-1+deb.sury.org~trusty+1 is up to date
MySQL 5.5.46-0ubuntu0.14.04.2 is up to date
Image processing available
SUMMARY INFORMATION

Perch Runway: 2.8.32, PHP: 5.6.14-1+deb.sury.org~trusty+1, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_blog (5.0)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', );
PERCH_LOGINPATH: /ifs-admin
PERCH_PATH: /var/www/public/ifstudies.dev/ifs-admin
PERCH_CORE: /var/www/public/ifstudies.dev/ifs-admin/core
PERCH_RESFILEPATH: /var/www/public/ifstudies.dev/ifs-admin/resources
Image manipulation: GD Imagick
PHP limits: Max upload 100M, Max POST 100M, Memory: 128M, Total max file upload: 100M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: ifstudies.dev
DOCUMENT_ROOT: /var/www/public/ifstudies.dev
REQUEST_URI: /ifs-admin/core/settings/diagnostics/
SCRIPT_NAME: /ifs-admin/core/settings/diagnostics/index.php
Shane Lenzen

Shane Lenzen 18 points

  • 4 years ago

try removing indelible="false"

indelible is already false by default, therefore you only need to specify when it is true

Hey Robert, I've tried removing the option altogether. No change.

Drew McLellan

Drew McLellan 2638 points
Perch Support

If the posts had existing slugs that were unique, why are they now colliding? I don't believe the importer changes the slugs.

I think it might. I've run the importer before and the slugs seem to be rebuilt based on the slug format in settings. In any case, the burden is on my client and all of the authors to ensure they don't create multiple posts with the same title. This site has over 50 authors and posts going back 10 years, so it's a problem.

Drew McLellan

Drew McLellan 2638 points
Perch Support

It uses the value of the post_name item in the WordPress XML for the slug.

Right...and they all had the same post name.

Is it intended that the postSlug cannot be changed directly and can only be changed by changing postTitle, or is this a bug that can be fixed?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I think that's a bug with the Blog app.

Ok, thanks. We're looking to launch in a month...I know you're hard at work for 2.9, but is there any chance this could get fixed before then?

Drew McLellan

Drew McLellan 2638 points
Perch Support

We're hard at work for 3.0!

I'll take a look and see what's involved.

Great, thanks Drew!

Just noticed that when I change the author on the 'Meta and Social' page, I get this warning that shows above the top nav in Runway:

Warning: Invalid argument supplied for foreach() in /var/www/public/ifstudies.dev/ifs-admin/core/apps/content/PerchContent_Util.class.php on line 124

I was also wondering, it looks like the WP import brought over all of the authors correctly, but they weren't created as actual Perch users. If I need to create user accounts for these authors, do I just need to use the same email address and it will link to their author profile? It seems I can't create new authors without creating new Perch users, is that correct?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, use the same email addresses. You don't need a user for each author unless you want them to be able to log in.