I’m in the process of creating a new extension that gives a true preview of an entry, even if the entry is posted for a future date. Here are the features (so far):
-Adds a “View Preview” link to the View Entry screen (the one you see right after Submitting or Updating an entry)
-Allows you to define which template group to use for each weblog you have
-Uses the exact template you use on your site (even for future entries) which eliminates the need to maintain separate preview templates.
I would like to have some outsiders test this for usability and bugs. I have attached the files you’ll need (ext.viewpreview.php and lang.viewpreview.php).
Installation Instructions:
1. Download the files and upload them to the /extensions and /language/english directories.
2. Go to your Admin > Utilities > Extensions Manager page and Enable the View Entry Preview extension
3. Click on the Settings link and enter the appropriate templategroup/templatename into the corresponding weblog fields
4. Hit the Submit button (Note: The extension will not work if you don’t hit submit - I hope to fix this soon)
5. MOST IMPORTANT STEP - You must make one teeny, tiny change to your entry templates. This change will not (or shouldn’t at least) effect anything on your site or anything else for that matter. The change requires adding to your {exp:weblog:entries ... } tag the “dynamic_parameters=“show_future_entries”” parameter. As an example, let’s say your template currently contains {exp:weblog:entries weblog=“my_blog”}....you’ll need to change this to {exp:weblog:entries weblog=“my_blog” dynamic_parameters=“show_future_entries”}. This step is crucial because it allows you to preview future entries only when the “show_future_entries” parameter is passed to the template via a POST request.
That’s it, you’re ready to view some previews. To view a preview, go to your “Edit” tab and click the “View” link next to one of your entries. You’ll then see the “View Preview” link at the bottom.
Please let me know if you find any strange behaviors or if this doesn’t work for you? I plan on making it more robust by including a Preview link in other places (like the Edit page, perhaps a tab on the Publish form, etc)
Also, any recommendations are greatly appreciated!
UPDATE: Duuuhhh… I had a variable hardcoded. I’ve updated the download with the new change.
Thanks,
-Brett
