From: Kevin D. <dri...@gm...> - 2006-09-21 04:04:02
|
For anyone dealing with the same issue, here is some code that I am working with: function OnUserRow(&$record) { if( empty($record['user_fields'])) return; $tf_columns = array( array( 'field' => 'user_profexp', 'label' => 'Professional Experience'), [...etc, etc...] )); $key = count( $record['user_fields']); for ($k = 0; $k < count($tf_columns); $k++) { $field = $tf_columns[$k]['field']; $label = $tf_columns[$k]['label']; $value = $record[$field]; if (!(empty($value))) { $record['user_fields'][$key] = array( 'label' => $label, 'value' => $value); $key++; } } } Kevin On 9/20/06, Victor Stone <fou...@gm...> wrote: > On 9/19/06, Kevin Driscoll <dri...@gm...> wrote: > > Okay. I am having no trouble adding things to my db tables through > > the typical user entry forms. However, now I am stuck displaying the > > data correctly. The template code in question is here: > > > > <p tal:repeat="uf record/user_fields"><em tal:content="uf/label" > > /><tal:block condition="uf/label">: </tal:block>${uf/value}</p> > > If you are using a skin based on skin-simple then all the user_fields > will "display themselves" in the user_listing macro in user.xml. > > The 'user_fields' gets formatted during GetRecordFromRow() which > triggers a _USER_ROW event. Classic example can be found in > ccextras/cc-forums.php, look for OnUserRow() > > You shouldn't need to derive from anything. Any class can be an event catcher. > > VS > |