Forums

can "action" load only when met a condition ?

eddddd 16 Feb, 2012
Hi , I'd like to know how to write a if condition to load an action script . is it possible to do that ?
GreyHead 16 Feb, 2012
Hi eddddd ,

<?php
$user =& JFactory::getUser();
if ( !$user->id ) {
  //this is a guest
} else {
  // this is a logged-in user
}
?>


Bob
eddddd 16 Feb, 2012
mr greyhead , where is the "joomla registration" code ? I didn't see the code when clicking at the "code" tab . If I can't find the "joomla regisration" action code , the i can't stop loading it .
GreyHead 18 Feb, 2012
Hi eddddd,

If you are using ChronoForms v4 the you can either use the Authenticator action; or the Event Switcher [GH] action.

Personally I find it simpler to have two forms, one with registration and one without.

Bob
This topic is locked and no more replies can be posted.