Christophe Posted October 27, 2016 Share Posted October 27, 2016 Hi, I've tried several things (before posting), they don't seem to work. It's the first time, if I remember well, that I use "Radios" or "Checkboxes" page fields in order to display the values on the front-end. I've just managed to make the checkboxes' ones work with PHP's implode function (with delimiters). But I can't manage to make the radios' ones work. Not sure to remember well as I first tried with "Radios" a few hours ago (and have forgotten to eat...) , but I think that I tried with things like: $page->nameofthefield->title and $page->nameofthefield->name seen in posts. I've tried with a foreach, but (logically?) it adds another radio button's value each time I change the selected one and save the page. I need some experts' help. Thank you so much in advance! Edit: I'm using ProcessWire 2.8 (for the first time - upgraded recently). Link to comment Share on other sites More sharing options...
Gideon So Posted October 28, 2016 Share Posted October 28, 2016 Hi, I think it should be $page->nameofthefield->title and $page->nameofthefield->value Gideon Link to comment Share on other sites More sharing options...
Robin S Posted October 28, 2016 Share Posted October 28, 2016 3 hours ago, Christophe said: It's the first time, if I remember well, that I use "Radios" or "Checkboxes" page fields in order to display the values on the front-end. The inputfield you choose for your Page field has no impact on how you access the field value using the API. So it's just like any other Page field. The important setting is "Dereference in API as" and this determines whether your field value is a PageArray or a Page object. 2 Link to comment Share on other sites More sharing options...
Christophe Posted October 28, 2016 Author Share Posted October 28, 2016 Hello @Robin S, I had seen this but I guess I was "afraid" that changing the setting would mess things up, but it's only for the API. I wanted to still be able to change the selected radio button if needed. Perhaps I thought that if I changed this setting I would lose all the other choices. I don't know why, as even then, as the pages would still be there , I could easily have had them all again by reverting back to the previous setting. Thank you :)! Have a nice weekend! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now