SOLVED Article plugin: condition

Status
Not open for further replies.

futuron

Member
I made a form where our client can enter his portfolio. He offers 3 different services. When adding a new project to his portfolio he selects a service (dbjoin). How can i set it so it's saved in the right category?
$service = $origData['fab_portfolio___service'];
if ($service != 1) {
if ($service == 1) {
return true;
}
}
return false;
with _raw it's also not working
$service = $origData['fab_portfolio___service_raw'];
if ($service != 1) {
if ($service == 1) {
return true;
}
}
return false;
Screenshot phpdebug template attatched. Doesn't look like an array here. Or won't you see that?
 

Attachments

  • Schermafbeelding 2013-11-26 om 19.54.37.png
    Schermafbeelding 2013-11-26 om 19.54.37.png
    216 KB · Views: 227
Solved with tips from Rob. I tried this in the condition field of the article plugin on the form:

PHP:
$service = $data['fab_portfolio___service'];
echo "service = ";print_r($service);
exit;
and it returned: service = Array ( [0] => Consultancy )

So the condition was.
PHP:
$service = $data['fab_portfolio___service'];
if ($service[0] === 'Bookings') {
return true;
} else {
return false;
}
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top