Forum
Cannot preview pages - blog
Hello,
I am using Perch Blog app but I cannot preview pages.
I have put a version of index.php and post.php in a folder called /blog/ and when I try to preview a blog entry, i.e. a draft it comes up blank.
Is there a particular <?php(); ?>
section I must add to a page in order to preview content?
Hi,
Have you included the perch runtime at the top of the page?
Cheers Dennis
Hi Dennis,
I have included that.
I am using
<?php perch_content_create(); ?>
for additional fields but they don't reference any blog .html templates.Also, my actual .php pages, are in a /blog/ folder i.e. /blog/index.html and /blog/post.php
Thanks for writing
If you are rewriting your URLs then you will need to ensure you have a rule for the preview as explained in the documentation.
You do not need to put anything extra on your pages to preview them.
Ok,
I'll read the documentation but is there any reason it needs to append /preview/ on the end of the URL or is there any way to stop that from occurring?
The page needs to know it should be showing a preview.
Can you post your diagnostics?
Which aspect of the preview isn't working for you?
Hi Drew,
If I put the blog entry into Draft mode and then click Preview, it comes up with the "overriding" template, i.e. everything without the content from the blog.
Personally, this would not bother me but if others' are to become blog creators or let alone editors, then they might be a bit confused having to navigate to the actual page which while not difficult might put some off diving into the world of arbitrary markup.
Can you turn debug on and let me know what it outputs for the page?
From the blog post page:
From the post.php page referencing the blog:
Are those both in preview mode?
This is after I've selected Draft mode in the page accessed via the Blog menu (minus identifying information):
The first of the previous two posts, was from the page accessed via the Blog app and the second Debug was from the /blog/post.php page
I hope this information is useful.
Can you try adding this top the top of your post page, after the runtime include?
Hi Drew,
I've done that but I'm still unable to view the Blog via /preview/
This is the code I am using:
Thanks again
The .html template code:
Kind regards
Have you configured that URL to route to your
post.php
page?Hi Drew,
My apologies but I don't know which URL you are talking about.
It isn't critical since there are no content editors for this particular site but it would be nice to be able to preview the "blog" even though I am only using Blog App tags in regular pages.
Cheers
Me neither after two weeks! :)
I think your preview URL. Do you have a route for preview URLs?