Forum

Thread tagged as: Problem, Blog

Blog previews and redactor images

I have a couple of issues with the blog (and a third being dealt with in another thread).

When I preview blog posts, the preview page isnt working properly. There are no styles loaded, and no blog post. Im using clean urls, and this is the rewrite rule in .htaccess

 RewriteRule ^blog/([a-zA-Z0-9-/]+)/preview$ /blog/post.php?s=$1&preview=all [L]
 RewriteRule ^blog/([a-zA-Z0-9-/]+)$ /blog/post.php?s=$1 [L]

Also, Im using Redactor as a text editor for blog posts. When I add an image using redactor into the body of the text, it displays as a code like this: [cms:asset 883]​ It displays fine in the front end, but should I be able to see the actual image in the back end or not? Is this how Redactor works or is something wrong?

Thanks

post.html

<article class="h-entry">

    <div class="post-header">
        <div class="row padded featured-img">
            <div class="small-7 small-centered columns post-title">
                <h1 class="font-two">
                    <perch:blog id="postTitle" type="text" label="Title" required="true" size="xl autowidth" order="1" value="true" />
                </h1>
            </div>
        </div>
    </div>

    <div class="row padded featured-img">
        <div class="small-12 medium-7 small-centered medium-centered columns post-title">

            <perch:if exists="image"><img class="blog-list-img" src="<perch:blog id="image" type="image" density="2" quality="85" width="365" height="246" crop="true" />" alt="<perch:blog id="altTag" type="text" label="Image Alt Text" required="true" />" /></perch:if>
        </div>
        <div class="small-12 medium-7 small-centered medium-centered columns post-title">
            <div class="blog-description e-content">
                <perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="redactor" html="true" size="xxl autowidth" required="true" />
            </div>
        </div>
        </div><!-- .columns -->
    </div><!-- .row -->

     <div class="row padded">
        <div class="small-12 medium-7 small-centered medium-centered columns">

            <div class="blog-author-share">
                <p class="blog-author small-12 medium-6 columns">BY <perch:blog id="author" type="text" label="Author" order="2"    markdown="false" size="m" required="true" /><br>
                <time class="dt-published" datetime="<perch:blog id="postDateTime" type="date" label="Date" time="true" format="Y-m-d H:i:s" divider-before="Publishing" />">
                <perch:blog id="postDateTime" type="date" time="true" format="%d %B %Y" /> 
                </time>
                </p>
            </div><!-- .blog-author-share -->

                <p class="meta">
                    <perch:categories id="categories" set="blog" label="Categories" display-as="checkboxes" suppress="true">
                        <a href="archive.php?cat=<perch:category id="catSlug" type="slug" />" class="p-category">
                            <perch:category id="catTitle" type="text" />
                        </a>
                    </perch:categories>
                </p>
        </div><!-- .column -->
    </div><!-- .row -->
</article>
Perch: 3.0.9, PHP: 7.0.1, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 7e72f9690b1498a1bead7a637c33a831c0d2f655 $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.9), assets (3.0.9), categories (3.0.9), perch_blog (5.5.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/sites/0/05creative.com/public_html/perch
PERCH_CORE: /var/sites/0/05creative.com/public_html/perch/core
PERCH_RESFILEPATH: /var/sites/0/05creative.com/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 100M, Max POST 100M, Memory: 128M, Total max file upload: 100M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
DOCUMENT_ROOT: /var/sites/0/05creative.com/public_html
HTTP_HOST: 05creative.com
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Chris James

Chris James 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

When I preview blog posts, the preview page isnt working properly. There are no styles loaded, and no blog post. Im using clean urls, and this is the rewrite rule in .htaccess

That sounds like perhaps you've not got your rewrites configured correctly. Otherwise, if you can give us more information we might be able to suggest something.

Is this how Redactor works or is something wrong?

That's how reusable assets work across all editors.

This is how my rewrite rules are in .htaccess - should I be doing something elsewhere too?

 RewriteRule ^blog/([a-zA-Z0-9-/]+)/preview$ /blog/post.php?s=$1&preview=all [L]
 RewriteRule ^blog/([a-zA-Z0-9-/]+)$ /blog/post.php?s=$1 [L]

I'm confused about redactor. When I look at the example of how it works on their website, you can see the image itself in the WYSIWYG editor: https://imperavi.com/redactor/

I only see this: [cms:asset 883]​

Drew McLellan

Drew McLellan 2638 points
Perch Support

What you're seeing is a placeholder for an asset which is dynamically replaced.