Jump to content

Forums

How to call custom fields


Recommended Posts

  • Administrators

Custom fields are stored as JSON data in the 'perscom_personnel' table under the column 'personnel_custom_fields'.

You should be able to pull this data like the following:

{soldier="custom_fields" id="$soldier->id"}

This will return JSON data. Make sure to pass the soldier's id to the ID parameter, rather than the soldier object.

However, because this is a template plugin, you cannot do anything with that data. My suggestion is to do something like the following:

{{$fields = json_decode($soldier->custom_fields, YES);}}

You can then display the data like so:

{$fields['the custom field id']}

 

  • Thanks 1

Owner
Deschutes Design Group LLC
email | jon@deschutesdesigngroup.com

Link to comment
Share on other sites

  • 1 year later...

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.   Paste as plain text instead

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.