Forums / General / (Resolved) Article preview and going back to editing

(Resolved) Article preview and going back to editing

Author Message

David Zaoui

Friday 01 June 2007 9:17:00 am

Hi everybody,

I am developing a website which allow users to edit and preview articles from the front office.
When a user creates/modify an article, he can publish it or see a preview, by clicking on the corresponding buttons. To manage article preview, i created an override of "versionview.tpl" of the admin interface.
Almost everything works fine (the preview page is good etc..) :

- When the user creates a new article he can preview it, and then from the preview page he can publish or going back to editing,thanks to a "EditButton".When going back to editing again,the content of the draft is exactly in the same state than it was just before clicking on "preview"

- When the user modifies a existing article, the problem is here : when he modifies the article, then click on "preview" and then click on "edit" to go back to editing, the edit draft is NOT in the same state that it was just before clicking "preview"(that's what i want) BUT in the state that it was when it was published.

Have you got some ideas about my problem?
Thanks

David

André R.

Friday 01 June 2007 1:12:32 pm

Seesm like you need a version parameter somewhere, look at the ezwebin code ( the fronoffice editing extension added to 3.9, or the Website Interface as we call it ).

http://svn.ez.no/svn/extensions/ezwebin/trunk/packages/ezwebin_extension/ezextension/ezwebin/

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

David Zaoui

Wednesday 27 June 2007 7:43:39 am

Hi André,

It's weird, because i kept all parameters from the orginals edit.tpl , So i don't think it lacks a parameter.
To avoid the problem i want to open the preview in a new window so the user won"t have to go back to continue editing.

But do you know how to do this?

For now my edit.tpl file is like this :

<form enctype="multipart/form-data" id="editform" method="post" action={concat("/content/edit/",$object.id,"/",$edit_version,"/",$edit_language|not|choose(concat($edit_language,"/"),''))|ezurl}>

....
	<input class="button" type="submit" name="PreviewButton" value="{'Preview'|i18n('design/ezwebin/content/edit')}" />

.....
</form>

I try to modify it to have the preview open in a new window but it doesn't work :-(

Thanks

David Zaoui

Thursday 28 June 2007 5:08:49 am

Hi,

i finally found what i wanted : i simply added the following code to the "EditButton" on my preview page :

onclick="history.back()"

Thank you all !