Timothy Kiselev Posted June 1, 2019 Share Posted June 1, 2019 I know it says that it's for "advanced users", but I'm trying to understand how to show a custom field in the personnel roster. I created a new Personnel > Custom Field called "Rating" where a soldier may be given a rating (A, B, C, ...) as a radio. As a test, I configured the display as "<span>{title}: {value}</span>". When I add this field to Personnel > Settings > Customize, I get a template error that "Template perscom/front/columns/field_1 does not exist. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme." As a bit of a Hail Mary, I tried to create this template with the same content and variables settings as perscom/front/columns/custom, but this threw a general error. I didn't find anything when searching the forums, could someone help me, direct me to any relevant answers, or let me know what additional information I should provide? Thanks! Quote Link to comment Share on other sites More sharing options...
Administrators Jon Erickson Posted June 1, 2019 Administrators Share Posted June 1, 2019 Timothy, we recreated what you were talking about on our development site here: https://dev.deschutesdesigngroup.com/index.php?/perscom/personnel/. We selected the "Rating" field from the dropdown list and assigned it as the last column within the roster. Is this what you are wishing to accomplish? Quote Owner Deschutes Design Group LLC email | jon@deschutesdesigngroup.com Link to comment Share on other sites More sharing options...
Timothy Kiselev Posted June 1, 2019 Author Share Posted June 1, 2019 Jon, yes that's pretty much it. The styling would be a bit different (use an image or CSS class) but I assume I'd be able to adjust that after I got it basically working. Our site is using IPB 4.3.6 since our theme doesn't seem to be compatible with 4.4, and Perscom 1.2.5. https://2ndrb.org/ipb/index.php?/perscom/personnel/roster/1-combat-roster/ I got it to stop showing the error by creating perscom/front/columns/field_1 and tried the contents {$soldier->personnel_field_1->_value} and variable $soldier. But I assume that's beside the point if it's supposed to work out of the box. -Tim Quote Link to comment Share on other sites More sharing options...
Administrators Jon Erickson Posted June 1, 2019 Administrators Share Posted June 1, 2019 Correct, you should not have to create your own templates. There is a template called “custom” within the columns group that is used for every personnel custom field. I’m not sure why it’s trying to use “field_1”. If you submit a support request with ACP information, I can take a look to see what’s going on. Quote Owner Deschutes Design Group LLC email | jon@deschutesdesigngroup.com Link to comment Share on other sites More sharing options...
Timothy Kiselev Posted June 1, 2019 Author Share Posted June 1, 2019 Thanks Jon, I did so. Quote Link to comment Share on other sites More sharing options...
Timothy Kiselev Posted June 7, 2019 Author Share Posted June 7, 2019 (edited) For the small group of people (if it even exists) who might also have this problem, it was because I was still using IPB 4.3. I created the template "field_1" with variable "$soldier" and used something like the following: {{$fields = \IPS\perscom\Personnel\CustomField::roots( 'view', NULL, array( 'field_visible=?', 1 ) );}} {{$column = $fields[1]->column();}} {$soldier->$column} The index to fields will depend on which one you're trying to get. Thanks again for the help, Jon! -Tim Edited June 7, 2019 by Timothy Kiselev 1 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.