![]() |
|
Adding new fields to metadata - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Adding new fields to metadata (/thread-10816.html) |
Adding new fields to metadata - webdeveloper@geh - 05-02-2013 I would like to add new fields to the metadata section at Albums->Images. I have read on the forums about a workaround, but no one goes into greater detail. What I want is to add fields where City, Location, Copyright exist. I understand that the data comes from the image, but I want the user to be able to add their content so that it is searchable. how can I do that without augmenting the core files? Adding new fields to metadata - sbillard - 05-02-2013 This can be done, but would probably require "participation" by other users of the custom data field. Since we do not really know what plugins might use the field there is some risk, but at least for a local install the risk is mangeable. The general technique is to store multiple fields in an array with the array index of the field being then name of the field. That array is serialized when stored in the custom data database field and unserialized when you want to use the data. There is a filter The Adding new fields to metadata - acrylian - 06-02-2013 As mentioned on the ticket, you don't need to store arrays in the custom data field. You should be able also use the filters mention to keep the custom data plain as it is and add new fields using the Adding new fields to metadata - webdeveloper@geh - 07-02-2013 okay, so let's say I want to go the route of creating new fields in the metadata section using the "plugin_storage" table in the database. Please tell me how I would go about doing that? What pages in your code would I need to change? I am competent with using PHP and MySQL and I know that queries are going to need to be written, but I want to safeguard that anything I touch won't get wiped out with an upgrade of your product. I have already successfully created a new theme for my purposes with your product, so this last little bit would be extremely useful to get my last project finished. Adding new fields to metadata - acrylian - 07-02-2013 You will need to use the right filters and the object model: Here is a demp plugin that splits teh custom field into several fields: Info about all database tables on the admin overview pages. There is also a pdf in your install under /docs that shows the rough interactions between the tables |