Jump to content

Show a custom field in profile main


tkfeeny

Recommended Posts

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>

Link to comment
Share on other sites

  • Administrators

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Administrators

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; ?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...