Share » Forums » General » Suscribing to a course #2

Suscribing to a course #2

Suscribing to a course #2

Saturday 11 October 2003 2:45:56 pm - 2 replies

Author Message

Thomas Schamm

Tuesday 14 October 2003 1:39:23 pm

I'm afraid i will jump out of the window the next moment ... I don't get this thing working :-(
What i found out in
http://www.ez.no/developer/ez_publish_3/forum/developer/pass_additional_information_to_cart
is the possibility to bring back my $setCourseID variable in the template, but i don't get it working with the user/edit module.

If i am thinking correct, the /user/edit.php calls the /content/edit.php, and i want to take my variable from the <input type="hidden" name="setCourseID" ...> in my template file through the user/edit.php to content/edit.php and then use {$setCourseID} in my content/edit.tpl file to show my variable there.

Can someone help me here??
Kind Regards, Thomas

Thomas Schamm

Wednesday 15 October 2003 4:16:16 pm

Another try doesn't work:
My course.tpl File has a form and should transfer the $node.node_id to the /content/edit.tpl. I try it this way:

<input type="hidden" name="setCourseID" value="{$node.node_id}" />

I stored my setCourseID in my user/edit.php in a session variable:

if ( $Module->isCurrentAction( "Edit" ) )
{
if ( $http->hasPostVariable( 'setCourseID' ) )
{
$setCourseID = $http->postVariable( 'setCourseID' );
$http->setSessionVariable( 'setCourseID', $setCourseID );
$Module->redirectTo( '/content/edit/' . $UserID );
return;
}
else
{
$Module->redirectTo( '/content/edit/' . $UserID );
return;
}
}

Then, i added these Lines to user/attribute_edit.php:

if ( $http->hasSessionVariable( 'setCourseID' ) )
{
$setCourseID = $http->sessionVariable( 'setCourseID' );
$tpl->setVariable( 'setCourseID', $setCourseID );
}

But i still don't get any attribute in /content/edit.tpl with {$setCourseID}

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

36 542 Users on board!

Forums menu