Request help to make sample generic plugin or smth. to display affiliation data in user grid

Hi all,

Maybe someone can show me some basic steps to make a small generic plugin to display the affiliation data in user grid?

I can add a column by adding code below to the controllers/grid/settings/user/UserGridHandler.inc.php, but no data in user’s row’s “affiliation” cell exists, only column title in the grid. I see the affiliation data in gridRow.tpl ({$row|@debug_print_var}). Why it not displays in the grid?

/controllers/grid/settings/user/UserGridHandler.inc.php/
// Affiliation
$cellProvider = new DataObjectGridCellProvider();
$this->addColumn(
new GridColumn(
‘affiliation’,
‘user.affiliation’,
null,
null,
$cellProvider
)
);

Also, I known, this is not valid way to extend the PKP functionality. I think, I must to write plugin, but I dont know how. I read the PKP documentation here and I understood the basic concepts, but in this situation, I need more information, than the basic concepts. So, help please :slight_smile:

Thanks in advance.

Hi @vitas,

At the moment, I think it’ll be pretty difficult to extend a grid using a plugin; I’d suggest implementing this as a local modification for now. Tools like git can help avoid causing trouble migrating modifications when it comes time to upgrade OJS.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank You for response.
Maybe you can tell me what git branch I must to clone, when job will done? I’m sorry, if I’m not understood something.

Regards,
VItas.

Hi @vitas,

You can either check out the tag corresponding to the version you want to use (e.g. ojs-3_1_0-1), or use the stable branch, e.g. ojs-stable-3_1_0.

Regards,
Alec Smecher
Public Knowledge Project Team