Forum
Image path problem
I'm uploading images via the image button on CKeditor but it's incorrectly creating a path with /posts/ in front of it and also %22 at the beginning and end i.e.
/posts/%22/perch/resources/-image-name.jpg%22
This is what my .htaccess file is looking like – is there a problem here?
Redirect to PHP if it exists.
# e.g. example.com/foo will display the contents of example.com/foo.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]
redirect html pages to the root domain
RewriteRule ^index.html$ / [NC,R,L]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^posts/([a-zA-Z0-9-/]+)$ /posts/post.php?s=$1 [L]
</IfModule>
Just tried adding an image to a content field on a non-blog post page all is just fine. So just a problem when it comes to blog posts.
Can you post your Diagnostics Report and the template being used. You will have been asked for these when creating the post as they enable us to help you more quickly.
Diagnostics:
Perch: 2.8.13, PHP: 5.3.29, MySQL: 5.5.42, with PDO Server OS: Linux, cgi-fcgi Installed apps: content (2.8.13), assets (2.8.13), categories (2.8.13), perch_blog (4.6) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog' ); PERCH_LOGINPATH: /perch PERCH_PATH: /home/sitename/public_html/perch PERCH_CORE: /home/sitename/public_html/perch/core PERCH_RESFILEPATH: /home/sitename/public_html/perch/resources Image manipulation: GD PHP limits: Max upload 128M, Max POST 128M, Memory: 128M, Total max file upload: 128M Resource folder writeable: Yes DOCUMENT_ROOT: /home/sitename/public_html HTTP_HOST: www.sitename.com REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Template:
<div class="post"> <?php perch_blog_post(perch_get('s')); ?>
That looks like your page, we need to see your template - where the Perch tags are.
Are we talking about post.html in perch_blog/templates/blog/
<article class="h-entry">
</article>
<perch:blog id="excerpt" type="textarea" label="Excerpt" markdown="true" order="3" suppress="true" size="s" /> <perch:blog id="image" type="image" width="50" height="50" crop="true" suppress="true" />
Yes - you have ckeditor on your field, which is an HTML editor, but then have specified markdown="true"
You need to remove markdown="true" and add html="true" if you want to use a WYSIWYG.
https://docs.grabaperch.com/docs/customizing-perch/installing-editors/
Ah, thanks! A simple problem hey?
On another note, CKEditor doesn't seem to let you choose an already existing image asset.
Is there another editor you have available that does that as my client will go potty trying to upload the same image each time.
We don't have that option yet.
Ah, thought I'd ask incase I'm doing something wrong.
It's planned for a future update, and that may include CKEditor. On the whole we'd encourage more structured ways of managing content (e.g. Blocks) and so features for WYSIWYG fall further down the list.