We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
Passing variables into templates with the API
I'm not sure if I'm missing something or doing something wrong but I need to access the ID of an item from within a template with my custom app.
What I'm doing is displaying a fixed field
echo $Form->text_field('projectName', 'Project Name', isset($details['projectName'])?$details['projectName']:false, false, false);
Then displaying the template fields
echo $Form->fields_from_template($Template, $details, $Projects->static_fields);
Within that template i have a repeater:
<perch:repeater id="layout" label="Layout" divider-before="Layout" scope-parent="true"> <perch:projects id="device" label="Device" type="devices" project="<perch:projects id="parent.projectID" />" /> </perch:repeater>
The device is a custom field type i have built that looks up devices relating to the current project, but I can't work out how to pass the current project id into the field.
Want to reply to this thread?Login with Perch