We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Extension: Entry Preview **TESTERS WANTED**

Development and Programming

Brett DeWoody's avatar
Brett DeWoody
140 posts
18 years ago
Brett DeWoody's avatar Brett DeWoody

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

       
ExpressionEngineer's avatar
ExpressionEngineer
148 posts
18 years ago
ExpressionEngineer's avatar ExpressionEngineer

Hey Brett, thanks for sharing the ext-in-progress, it’s looking great.

Some quick notes:

line #40, you don’t use $PREFS, so no need to global it. line #64, you don’t use $PREFS, so no need to global it, instead global $FNS; line #70, hardcoded url “http://www.converssation.com/”, change to this: $FNS->create_url($template); line #85, you don’t use $PREFS, so no need to global it. line #93, to preset settings you can serialize() an associative array instead of having the settings column empty on install.

I think that’s all I could see, this EXT seems very helpful. I’d love to see this implemented on the EDIT tab also.

best Andy

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
18 years ago
Mark Bowen's avatar Mark Bowen

Hi Brett,

Just downloading now. Looks like it will be a good one so thanks for that! Will have to try out in a couple of days though as have a really difficult job I am working with at the moment!!

Andy I don’t know if you know or not but just took a look at your site and it seems as though the CSS isn’t working properly. I am using Safari on Mac OSX 10.4.6 (MacBook Pro). Just thought I would give you a quick heads up! Also Andy do you have a complete list anywhere of all the modules, plugins and extensions that you have made for EE. I would be interested in looking at that if you do. Thanks.

Again Brett thanks for creating this. If I have understood the description correctly then it will help me out no end.

Thanks.

Mark

       
Djive's avatar
Djive
97 posts
18 years ago
Djive's avatar Djive

i tryed extension.. stil l need to change site url in extension code.. becuse is showing your site…

       
Djive's avatar
Djive
97 posts
18 years ago
Djive's avatar Djive

it will be great if you can to make it to show preview not based on ID.. or to choose ID or url-name.

this will be very helpfull extension, thx

       
ruraldreams's avatar
ruraldreams
279 posts
18 years ago
ruraldreams's avatar ruraldreams

is “dynamic_parameters” a parameter made up for this extension? I’d usually use show_future_entries=”yes”

       
ruraldreams's avatar
ruraldreams
279 posts
18 years ago
ruraldreams's avatar ruraldreams

Gah, I’m afraid I can’t get it working. I don’t see the hardcoded url in the code so I’m assuming it was changed before I downloaded. I get a blank screen when I hit “view” from the edit tab or “update” from the entry form.

From what I can see from what is working and your description, I’d find this most useful if it basically transformed the “preview” button from the entry form page into the actual page view - but in a new window. I imagine that’s more complex though. I’d want to have my preview screen and my entry form screen open at the same time.

I can see how this would be useful if an editor or a second set of eyes was checking entries before publication - the person could go through a bunch of entry views quickly this way and easily navigate to the entry form if a change needed to be made.

       
Brett DeWoody's avatar
Brett DeWoody
140 posts
18 years ago
Brett DeWoody's avatar Brett DeWoody

ruraldreams: The “dynamic_parameters” parameter is a standard ExpressionEngine entries parameter. It allows you to pass variables via a POST request to your page. This could be useful for passing a specific date range, etc. For more information, visit the EE support page on Dynamic Parameters.

As for not getting it to work I apologize. I hastily uploaded an incomplete version. I have updated the download at the top with the most recent version. It contains a few features that are still in the works, but overall it works fine. The installation instructions are the same as the original instructions. The following are the new features:

  • Adds a “View Preview” link to the Edit tab - this will eventually be made conditional based on whether the entry has been published yet. If the entry is a future entry it will display “View Preview”, if the entry is already published, it will display something like “View Entry”.
       
ruraldreams's avatar
ruraldreams
279 posts
18 years ago
ruraldreams's avatar ruraldreams

Thanks for the dynamic parameters link - I’d never seen that before and I actually did a search for it before I posted!

Well I’m getting somewhere… I have the view preview link in my edit tab (as in your screenshot) but I don’t see anything anywhere else. Is there supposed to be a link from the cp preview page? Maybe I’m misunderstanding something.

It’s not pulling the correct template group/template from the extension settings. I’m getting your default instead of the one that I’ve specified. I’ve checked it twice and been sure to submit.

Another thing is about creating a conditional based on the entry date to indicate whether something has published or not. I think that folks sometimes use status instead of date for this. Don’t know how you would manage that but I thought I’d mention it.

       
Brett DeWoody's avatar
Brett DeWoody
140 posts
18 years ago
Brett DeWoody's avatar Brett DeWoody

ruraldreams: please disable the extension, upload the most recent version (available above), re-install it, re-enable it, enter your template group/names into the settings and try again.

       
ruraldreams's avatar
ruraldreams
279 posts
18 years ago
ruraldreams's avatar ruraldreams

Sorry but no luck. Now the “view preview” link does nothing and I don’t see anything anywhere else.
Did the whole thing twice.

       
Brett DeWoody's avatar
Brett DeWoody
140 posts
18 years ago
Brett DeWoody's avatar Brett DeWoody

What other extensions do you have installed?

Also, can you be more specific on the errors you’re seeing? What do you mean you “don’t see anything anywhere else”? Is every EE page a blank white?

       
Brett DeWoody's avatar
Brett DeWoody
140 posts
18 years ago
Brett DeWoody's avatar Brett DeWoody

I have updated the ViewPreview extension to v1.0.0. The download is available in the first posting in this thread. Please post all questions and comments to this thread.

       
Djive's avatar
Djive
97 posts
18 years ago
Djive's avatar Djive

Notice: Undefined variable: EXT in /home/user/public_html/system/extensions/ext.viewpreview.php on line 115

Notice: Undefined variable: EXT in /home/user/public_html/system/extensions/ext.viewpreview.php on line 113

i gaet many lines like this on edit tab

       
Brett DeWoody's avatar
Brett DeWoody
140 posts
18 years ago
Brett DeWoody's avatar Brett DeWoody

Did you make sure to view the Settings and click the Submit button?

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.