Custom Fields in Album

thommy Member
I'm trying to add custom Fields in Album.
Event_title
Event_parent_id
Event_id

I took the Example from https://github.com/zenphoto/Unsupported/blob/master/plugins/filter-custom_data/filter-custom_data.php

`

function custom_data_save_album($discard, $prefix) {

return sanitize($_POST[$prefix.'x_album_custom_data'], 1);

}

function custom_data_edit_album($discard, $album, $prefix) {

return

'

'.gettext("Special data:").'

'.htmlentities($album->get('custom_data'),ENT_COMPAT,getOption("charset")).'

';

}

`

It seems, that's only possible to add one custom field. How is it to realize to use more fields?
Any suggestions? Does somebody has an example?

Comments

  • acrylian Administrator, Developer
    What you did is re-adding the same custom_data field that already exists. You could
    - add serialized content to that field so it "looks" like several.
    - have to add code to add/get data from for example the `plugin_storage` db table.

    Also take a look at the fieldExtender plugin to add real custom fields. See the documentation on top of the plugin file itself how to use it. That's currently the only way for extra fields.
Sign In or Register to comment.