Path

ez projects / powercontent / forum / general / powercontent: how to add us...


Powercontent: How to add user parametrers ?

You need to be logged in to post messages in the forums. New users may register here.

Seb gaillard

Member since:
03 March 2009

Posts: 7

Tuesday 19 May 2009 9:16:36 am

Hi,

I use powercontent for adding 2 different types of content ('testimony','tip').
When a user contribute, i would like to display a message like "We have received your testimony/tip. It will be available soon".

I have do this at the end of modules/powercontent/action.php
before:



  $Result['rerun_uri'] = $module->redirectionURI( 'content', 'edit', array( $ObjectID, $EditVersion, $EditLanguage ) );


  $module->setExitStatus( eZModule::STATUS_RERUN );



after:



  $Result['rerun_uri'] = $module->redirectionURI( 'content', 'edit', array( $ObjectID, $EditVersion, $EditLanguage ), null, array('type' => 'testimony') );


  $module->setExitStatus( eZModule::STATUS_RERUN );



It does'nt work....
when I set the debug redirection, and display some "echo" in lib/ezutils/classes/ezmodule.php, I see that the function redirectionURI is called 2 times.
the first times, it display this kind of url:
/content/edit/44310/1/fre-FR//(type)/testimony

and the second time
/content/edit/44310/1/fre-FR/

Someone has an idea for doing this ???
Thank's,

Seb
Up

Kristof Coomans

Member since:
12 February 2004

Posts: 68

Tuesday 19 May 2009 8:01:52 pm

Hi Seb

What exactly do you want to accomplish by passing user parameters to the content/edit module? I think you'd rather want to have content/edit to redirect to another page which handles the "type" user parameter and displays the message. You can use the RedirectURIAfterPublish post variable for that.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Up

Seb gaillard

Member since:
03 March 2009

Posts: 7

Tuesday 19 May 2009 10:16:53 pm

Hi Kristof,

I think that the RedirectURIAfterPublish post variable can do what I want.
You have understood what I search to accomplish:
1/ add a new content with powarcontent
2/ after, redirect to the main node with a parameter used to display a message like "thank's for your contribution....".
How can I use the RedirectURIAfterPublish post variable ?
Do I make something in action.php ?

Thank's for your help and excuse my english...

Seb
Up

Kristof Coomans

Member since:
12 February 2004

Posts: 68

Thursday 28 May 2009 10:01:25 pm

Hi Seb

Redirecting to the main node of the newly created content is possible with the RedirectToMainNodeAfterPublish post variable. You will need the redirect extension as well though: http://projects.ez.no/redirect2

Adding user parameters to the node view url which the browser will eventually be redirected to is not possible right now, but that might be a nice enhancement. Would one powercontent-specific user parameter be enough? Or should the template writer have the possibility to add another post variable to pass the desired user parameters?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Up

Seb gaillard

Member since:
03 March 2009

Posts: 7

Thursday 11 June 2009 6:07:39 pm

Hi Kristof,

Thank's for your reply. By reading your last reply, I have realised that it would better that I stop learning eZ and I use that time to study english... I didn't explain correclu what I would like to do.
Finaly I have done what I would like to do like this :



<input type="hidden" name="RedirectURIAfterPublish" value="/{$node.url_alias}/(param)"/>



I don't know why I don't have think to this before...

I use this to tell you about an other redirection problem:
when PreViewCache=enabled in site.ini.append.php the redirect doesn't work.
Do you know why ?


Up

You need to be logged in to post messages in the forums. New users may register here.