Jump to content

How to get page field reference when using radio boxes?


Recommended Posts

Posted

How can I get the page object, which was selected in the radio box list?

$id = $page->pagefield_radios; // page field with checkboxes - returns id of selected: 1183 (as string?)

$cat = $pages->get($id);
echo $cat->title; // returns nothing
echo $cat // returns 1 (id of root Home)

$kat = $pages->get(1183); // id entered directly
echo $cat->title; // returns correct "Acryl"
Posted

You're right thanks! I was confused as the script wasn't working because I made a error and I checked what the $page->pagefield_radios returns...

Posted

Yep. Happens so often here too. Should always remember to use var_dump($var) instead of echo, when doing quick debugging.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...