Well it turns out you can access the tags really easily: $field->data['tags'] and I think this will do exactly what I need.
I know this is not the intended usage of the tags (I realize it's just meant to help keep the admin side of things clean), but I think it might be the best option for me in this case.
I have used the Page field in a couple of cases already and it has worked a treat, but unless I am not seeing all the possibilities, I am not sure how it will work for me in this case.
For the sake of clarifying my needs, here is some code to show what I am trying to do:
$questions = $pages->get('/modules/local-overview/questions/')->fields;
$form = $modules->get("InputfieldForm"); $form->action = "./"; $form->method = "post"; $form->attr("id+name",'subscribe-form'); foreach($questions as $question){ $qn = $question->name; $field = $modules->get("InputfieldText");
$field->label = $question->label . ' (' . $question->data['tags'] . ')'; $field->attr('id+name',$qn); $field->columnWidth = 50; $field->value = $answers->$qn;
$form->append($field); }
This would do the trick so long as I only have one tag listed for the field. I will refine this a little better, but it is doing the trick to tell the front end user
what units to use when filling out the form. Obviously I could have the template file write out each question manually and enter the units at the end of the label, but I think this approach makes life easier. Would there be a way to use Page field in this case that I am missing?
Thanks again