Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-4603

Migrate campaign configuration fields to a sidebar

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Should have Should have
    • 2.19
    • 4
    • Migrations
    • Sprint #116, Sprint #117, Sprint #118, Sprint #119, Sprint #120

      These fields are currently managed using "custom metaboxes", which are backend generated forms which need a page refresh to get updated values, so have limited possibilities for customizing the editor. Also, being under the content, they are cumbersome to reach, especially if there is a lot of content.

      Wordpress already has an API for interacting with the post meta data, which is where the campaign configuration fields are stored. There is also an API to add additional sidebars. So we will create a new sidebar that has input controls that connect with the post meta.

       

      • investigate current duplications of color and font definitions (scss variables, custom metabox creation) and find a way to have this definition in one place and have it used for css, the sidebar and backend validation. Using a scss file for this looks like an appealing option because it's readable, though that would mean having an additional configuration file if there are non-css configurations.

       

      • Make the theme options definition avaible to frontend JS, either through a static file or a REST API endpoint

       

      • Optionally have backend validation for the meta fields (to see if the value is in the allowed values for the theme of the post). Currently this is handled by the custom metabox (partially, it doesn't have allowed values for a theme, but one list). This can be tricky as you can specify a validator function for a post meta field, but it only gets the value of that field (e.g. link color) and is not aware of the value of the field that it depends on. EDIT: It is actually better to have the meta fields be entirely unaware of which values can be used in the editor for a certain theme.

       

       

      • Create a message where the controls currently are to point to the new sidebar.

            pvincent Pieter Vincent
            pcuadrad Pablo Cuadrado (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: