tkfeeny Posted August 3, 2014 Report Share Posted August 3, 2014 Hello everyone, I have added a custom field and I want to show it in profile_main.tpl, What is it that I can put to it is shown, This is the table that will do custom field <td align="left"><strong>Aircraft:</strong></td> <td align="left">here, i want to what has been entered in the custom field</td> Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted August 4, 2014 Administrators Report Share Posted August 4, 2014 Add something like $this->set('allfields', PilotData::GetFieldData($pilotid, false)); to your controller replacing the $pilotid with whatever is relevant for that controller and then in your template use the "allfields" variable to show the fields you want. Quote Link to comment Share on other sites More sharing options...
tkfeeny Posted August 4, 2014 Author Report Share Posted August 4, 2014 I apologize for the inconvenience, But what is it, how to used by the variable ($allfields) when bearing on the page. Is this true? <?php echo $allfields->Aircraft; ?> with this controller: $this->set('allfields', PilotData::GetFieldData($userinfo, false)); *Note: the Custom Fields name: Aircraft Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted August 4, 2014 Administrators Report Share Posted August 4, 2014 I think that I may be mis-understanding what you are trying to do. Is this a custom field added to the pilot profile through the phpvms admin panel, or is this a field you have manually added to another database table? Quote Link to comment Share on other sites More sharing options...
tkfeeny Posted August 4, 2014 Author Report Share Posted August 4, 2014 No, i added a custom field control panel administration, and now i want to show in the profile page of the pilot. Using the previous orders of course. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted August 4, 2014 Administrators Report Share Posted August 4, 2014 Then yes, this should get you the field from your database. Just make sure the name is the same as you have set in the table. In your example you have "Aircraft", if it is "aircraft" in your table then you probably not going to see it, you will probably get an error that the variable is undefined. <?php echo $allfields->Aircraft; ?> Quote Link to comment Share on other sites More sharing options...
tkfeeny Posted August 4, 2014 Author Report Share Posted August 4, 2014 Oh yeah, thank you for your support. i want to try it and tell you the details later. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.