Adding Database Fields & Sort Options

How difficult would it be to add fields to the ZP database? I like the current sort features that ZP offers, but I wanted to also add a field for price so that it could be sorted from low to high. Is that possible?

Comments

  • There is actually a field reserved for this sort of thing-the custom_data field. You do have to be careful, though, since there may be other demands on the field (for instance from some other plugins.)

    But you can also add such a field through PHPmyAdmin. But of course there would be no Zenphoto interface to update/change/view the values. The object model provides a basic `get()` and `set()` methods which would let you code such accesses.
  • acrylian Administrator, Developer
    I think actually the new general purpose `plugin_storage` database table should be used if you require special extra fields, e.g. more than there are already (you can use the custom field but also of course codeblock or location for anything). Of course using that table that requires a little more code work since you have to relatively assign that to elements.
Sign In or Register to comment.