eZ Community » Forums » Extensions » Do you think it's possible ?
expandshrink

Do you think it's possible ?

Do you think it's possible ?

Monday 05 September 2011 6:18:20 pm - 1 reply

Hi everybody,
For a customer's needs, i have duplicated the "cjw_newsletter_article" to create a "cjw_newsletter_article_automatique". When i choose this class, the content is preloaded with the content of some Articles (fetch function) (i have overrided ezxmltext_ezoe.tpl).
That works fine but, here's what i would like when i choose my "cjw_newsletter_article_automatique" :
- First screen : language (as it already is)
- Second screen : to choose a list of objects (Articles, Events,...)
- Last screen : the newsletter class with preloaded content (content from the objects choosen on the second screen) .
Do you think this is possible and how ?
I hope i was clear...
Thanks,
Fred

Monday 17 October 2011 10:47:27 pm

You have several possible options how to do this. You have to do this on API/PHP level.

One option is to implement a Module with a view where you select the Language (or pass it from another view) and make an instance of eZContentBrowse. In the browse window you select the objects. Withe the result of the browse (object id's) you can create the object, prefill the content attributes and redirect to normal content/edit mask. Or you store the browse result in session and fetch session variables in your templete. Example API Code:

 $redirectionURI = "/content/edit/".$object->attribute( 'id' )."/$editVersion/$editLanguage";
                                eZContentBrowse::browse( array( 'action_name' => 'SelectSourceObjectsBrowse',
                                                'from_page' => $redirectionURI,
                                                'cancel_page' => $redirectionURI ), 
                                         $module );

The other option is to use the EditHandler interface. So you can add a custom template to the edit mask from where you can start the browser or a template based search. In the template you can add a post button which is captured by the PHP code of the EditHandler. In the php code you can prefill your attribute or set session variables the same as above.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from