Skip to content

Need to document best practices for plugin development #6

@patrickmj

Description

@patrickmj

Existing "Best Practices" is a mix of real best practices and "things you must do to make it work" I'd like to distinguish those, and put together a list of real best practices for 2.0.

Hopefully, very early in the process of upgrading plugins we can nail these down, and get things written up for us to follow.

Draft of the page is underway at Documentation/build/html/Tutorials/bestPracticesPlugins.html

On the list --- updated according to comments and discussion below

  • Method Naming Conventions
  • Maintaining Expected behavior -- e.g., if you override browseAction, keep the expected hooks in place
  • User View Partials
  • Put form-building logic in controller, not in extending Omeka_Form or Omeka_Form_Admin
  • Use Omeka_Form or Omeka_Admin_Form or view helpers
  • Use Omeka_Plugin_AbstractPlugin
  • When and how to override Omeka_Record_AbstractRecord::recordUrl()
  • Maintain admin look and feel (Omeka_Form_Admin helps here, but should include new CSS classes and whatnot when form is too complex for Omeka_Form_Admin to easily handle)
  • Use HTML5
  • Use nav(), and include a name for your nav so other plugins can filter it
  • Make your content searchable
  • Follow Omeka's guidelines for functions e.g., globals don't echo (need to document these)
  • Internationalization (need to figure out/document adding new i18n files)
  • Omeka Jobs -- default and long-running. When and why to choose

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions