Forum
Blank blog previews
Good morning all,
I installed Perch on my site 6 months ago (mrqwest.co.uk). I'm not sure if I installed something wrong at the beginning but I've never been able to preview blog posts.
I'm keen to get this working now whilst I work on a slew of posts. I want to preview these posts prior to posting so I know everything is formatted how it should be!
So the issue is this. I can write and post fine in Perch. When I save a post as a draft, I see the preview button. Hitting that will bring up a page with my header, footer and navigation etc... but no actual content.
The preview button opens a new tab and appends /preview
to the URL but as I said, I get no actual content.
As an example, here's a post I made a few weeks back > https://mrqwest.co.uk/blog/553/adventures-with-fullscreen which works perfectly. Adding /preview
to the url renders the page how I see it on new draft posts > https://mrqwest.co.uk/blog/553/adventures-with-fullscreen/preview
Have I done something wrong with the templates? How can I get these previews working as they should?
Have you added the rewrite rule for preview?
https://docs.grabaperch.com/addons/blog/installation/clean-urls/
Hey Drew,
I hadn't added that, no - and had missed that on the clean URLs page. It looks to be the cause but it's not fixed it, I'm pretty sure it's down to a silly mistake in the htaccess. My knowledge of htaccess rules is somewhat lacking.
For my blog I'm using
RewriteRule ^blog/([a-zA-Z0-9-/]+)/([a-zA-Z0-9-/]+)$ /blog/post.php?s=$1 [L]
which works fine. I'm guessing I'll need to useRewriteRule ^blog/([a-zA-Z0-9-/]+)/([a-zA-Z0-9-/]+)/preview$ /blog/post.php?s=$1&preview=all [L]
however I've dropped this into my .htaccess and it hasn't made any difference.Can you advise if my htaccess is set up wrong?
Scratch that Drew, I found an old post (https://forum.grabaperch.com/forum/11-04-2014-configure-preview-urls) where you said to switch the htaccess rules around so more specific one is first. That's done the trick!