From 8170a4cac889ceae019da740a3b511610b3cf5ad Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Fri, 17 Mar 2023 16:37:48 -0400 Subject: [PATCH 1/5] Add basic Bibliotech post type ** Why are these changes being introduced: * We need to create a post type for Bibliotech articles ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/lm-149 ** How does this address that need: * This creates a "Mitlib Post Bibliotechs" plugin, which defines the shell of the Bibliotech post type. * Please note that this is only the post type itself, and the set of relevant fields will be created under LM-150. ** Document any side effects to this change: * None (subject to the above bullet points about the scope of this work) --- .gitignore | 1 + .../plugins/mitlib-post-bibliotechs/README.md | 7 ++ .../mitlib-post-bibliotechs.php | 27 ++++++ .../src/class-bibliotech.php | 94 +++++++++++++++++++ 4 files changed, 129 insertions(+) create mode 100644 web/app/plugins/mitlib-post-bibliotechs/README.md create mode 100644 web/app/plugins/mitlib-post-bibliotechs/mitlib-post-bibliotechs.php create mode 100644 web/app/plugins/mitlib-post-bibliotechs/src/class-bibliotech.php diff --git a/.gitignore b/.gitignore index 6f398e70..7e2e1957 100644 --- a/.gitignore +++ b/.gitignore @@ -78,6 +78,7 @@ web/app/plugins/* !web/app/plugins/mitlib-multisearch-widget !web/app/plugins/mitlib-pending-posts !web/app/plugins/mitlib-plugin-canary +!web/app/plugins/mitlib-post-bibliotechs !web/app/plugins/mitlib-post-events !web/app/plugins/mitlib-post-exhibits !web/app/plugins/mitlib-post-experts diff --git a/web/app/plugins/mitlib-post-bibliotechs/README.md b/web/app/plugins/mitlib-post-bibliotechs/README.md new file mode 100644 index 00000000..96aa0090 --- /dev/null +++ b/web/app/plugins/mitlib-post-bibliotechs/README.md @@ -0,0 +1,7 @@ +# MITlib Post Bibliotechs + +This defines a Bibliotech custom post type, extending the Base class provided by +Mitlib Post. + +The fields within this post type are defined in a JSON file that can be found in +the Mitlib Post data folder. diff --git a/web/app/plugins/mitlib-post-bibliotechs/mitlib-post-bibliotechs.php b/web/app/plugins/mitlib-post-bibliotechs/mitlib-post-bibliotechs.php new file mode 100644 index 00000000..25a573d1 --- /dev/null +++ b/web/app/plugins/mitlib-post-bibliotechs/mitlib-post-bibliotechs.php @@ -0,0 +1,27 @@ + _x( 'Bibliotechs', 'Post Type General Name', 'text_domain' ), + 'singular_name' => _x( 'Bibliotech', 'Post Type Singular Name', 'text_domain' ), + 'menu_name' => __( 'Bibliotechs', 'text_domain' ), + 'name_admin_bar' => __( 'Bibliotech', 'text_domain' ), + 'parent_item_colon' => __( 'Parent Bibliotech', 'text_domain' ), + 'all_items' => __( 'All Bibliotechs', 'text_domain' ), + 'add_new_item' => __( 'Add New Bibliotech', 'text_domain' ), + 'add_new' => __( 'New Bibliotech', 'text_domain' ), + 'new_item' => __( 'New Bibliotech', 'text_domain' ), + 'edit_item' => __( 'Edit Bibliotech', 'text_domain' ), + 'update_item' => __( 'Update Bibliotech', 'text_domain' ), + 'view_item' => __( 'View Bibliotech', 'text_domain' ), + 'search_items' => __( 'Search Bibliotechs', 'text_domain' ), + 'not_found' => __( 'No Bibliotechs found', 'text_domain' ), + 'not_found_in_trash' => __( 'No Bibliotechs found in Trash', 'text_domain' ), + ); + $args = array( + 'label' => __( 'Bibliotech', 'text_domain' ), + 'description' => __( 'Bibliotech', 'text_domain' ), + 'labels' => $labels, + 'supports' => array( 'title', 'editor', 'thumbnail' ), + 'taxonomies' => array( 'category' ), + 'hierarchical' => true, + 'public' => true, + 'show_ui' => true, + 'show_in_menu' => true, + 'menu_position' => 5, + 'menu_icon' => 'dashicons-media-document', + 'show_in_admin_bar' => true, + 'show_in_nav_menus' => true, + 'can_export' => true, + 'has_archive' => true, + 'exclude_from_search' => false, + 'publicly_queryable' => true, + 'capability_type' => 'post', + ); + register_post_type( 'bibliotech', $args ); + } + + /** + * Define the Bibliotech Issues custom taxonomy, which is used to group + * articles according to the issue in which they originally appeared. + */ + public static function taxonomies() { + $labels = array( + 'name' => _x( 'Bibliotechs', 'Taxonomy General Name', 'text_domain' ), + 'singular_name' => _x( 'Bibliotech', 'Taxonomy Singular Name', 'text_domain' ), + 'menu_name' => __( 'Issues', 'text_domain' ), + 'all_items' => __( 'All Issues', 'text_domain' ), + 'parent_item' => __( 'Parent Issue', 'text_domain' ), + 'parent_item_colon' => __( 'Parent Issue:', 'text_domain' ), + 'new_item_name' => __( 'New Issue', 'text_domain' ), + 'add_new_item' => __( 'Add New Issue', 'text_domain' ), + 'edit_item' => __( 'Edit Issue', 'text_domain' ), + 'update_item' => __( 'Update Issue', 'text_domain' ), + 'separate_items_with_commas' => __( 'Separate Issues with commas', 'text_domain' ), + 'search_items' => __( 'Search Issues', 'text_domain' ), + 'add_or_remove_items' => __( 'Add or Remove Issues', 'text_domain' ), + 'choose_from_most_used' => __( 'Choose from the most used Issues', 'text_domain' ), + 'not_found' => __( 'Not Found', 'text_domain' ), + ); + + $args = array( + 'labels' => $labels, + 'hierarchical' => false, + 'public' => true, + 'show_ui' => true, + 'show_admin_column' => true, + 'show_in_nav_menus' => true, + 'show_tagcloud' => true, + ); + register_taxonomy( 'bibliotech_issues', array( 'bibliotech' ), $args ); + } +} From 766ae90eb5b4d9c152c1e80af8e9a55fcd13987a Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Fri, 17 Mar 2023 16:53:40 -0400 Subject: [PATCH 2/5] Add basic Spotlight post type ** Why are these changes being introduced: * We need to create a post type for Spotlight articles ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/lm-149 ** How does this address that need: * This creates a "Mitlib Post Spotlights" plugin, which defines the shell of the Spotlight post type. * Please note that this is only the post type itself, and the set of relevant fields will be created under LM-150. ** Document any side effects to this change: * None --- .gitignore | 1 + .../plugins/mitlib-post-spotlights/README.md | 7 +++ .../mitlib-post-spotlights.php | 26 ++++++++ .../src/class-spotlight.php | 59 +++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 web/app/plugins/mitlib-post-spotlights/README.md create mode 100644 web/app/plugins/mitlib-post-spotlights/mitlib-post-spotlights.php create mode 100644 web/app/plugins/mitlib-post-spotlights/src/class-spotlight.php diff --git a/.gitignore b/.gitignore index 7e2e1957..db05c093 100644 --- a/.gitignore +++ b/.gitignore @@ -83,6 +83,7 @@ web/app/plugins/* !web/app/plugins/mitlib-post-exhibits !web/app/plugins/mitlib-post-experts !web/app/plugins/mitlib-post-locations +!web/app/plugins/mitlib-post-spotlights !web/app/plugins/mitlib-pull-events !web/app/plugins/mitlib-pull-hours diff --git a/web/app/plugins/mitlib-post-spotlights/README.md b/web/app/plugins/mitlib-post-spotlights/README.md new file mode 100644 index 00000000..eaa4a7c3 --- /dev/null +++ b/web/app/plugins/mitlib-post-spotlights/README.md @@ -0,0 +1,7 @@ +# MITlib Post Spotlights + +This defines a Spotlight custom post type, extending the Base class provided by +MITlib Post. + +The fields within this post type are defined in a JSON file that can be found in +the Mitlib Post data folder. diff --git a/web/app/plugins/mitlib-post-spotlights/mitlib-post-spotlights.php b/web/app/plugins/mitlib-post-spotlights/mitlib-post-spotlights.php new file mode 100644 index 00000000..ace4ef0d --- /dev/null +++ b/web/app/plugins/mitlib-post-spotlights/mitlib-post-spotlights.php @@ -0,0 +1,26 @@ + _x( 'Spotlights', 'Post Type General Name', 'text_domain' ), + 'singular_name' => _x( 'Spotlight', 'Post Type Singular Name', 'text_domain' ), + 'menu_name' => __( 'Spotlights', 'text_domain' ), + 'name_admin_bar' => __( 'Spotlight', 'text_domain' ), + 'parent_item_colon' => __( 'Parent Spotlight', 'text_domain' ), + 'all_items' => __( 'All Spotlights', 'text_domain' ), + 'add_new_item' => __( 'Add New Spotlight - should be about 60 characters', 'text_domain' ), + 'add_new' => __( 'New Spotlight', 'text_domain' ), + 'new_item' => __( 'New Spotlight', 'text_domain' ), + 'edit_item' => __( 'Edit Spotlight', 'text_domain' ), + 'update_item' => __( 'Update Spotlight', 'text_domain' ), + 'view_item' => __( 'View Spotlight', 'text_domain' ), + 'search_items' => __( 'Search Spotlights', 'text_domain' ), + 'not_found' => __( 'No Spotlights found', 'text_domain' ), + 'not_found_in_trash' => __( 'No Spotlights found in Trash', 'text_domain' ), + ); + $args = array( + 'label' => __( 'Spotlight', 'text_domain' ), + 'description' => __( 'Spotlight', 'text_domain' ), + 'labels' => $labels, + 'supports' => array( 'title' ), + 'taxonomies' => array( 'category' ), + 'hierarchical' => true, + 'public' => true, + 'show_ui' => true, + 'show_in_menu' => true, + 'menu_position' => 5, + 'menu_icon' => 'dashicons-megaphone', + 'show_in_admin_bar' => true, + 'show_in_nav_menus' => true, + 'can_export' => true, + 'has_archive' => true, + 'exclude_from_search' => false, + 'publicly_queryable' => true, + 'capability_type' => 'post', + ); + register_post_type( 'spotlights', $args ); + } +} From 6a7a650ee695d2c857e873483a20a58a7710c42d Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Tue, 21 Mar 2023 11:23:00 -0400 Subject: [PATCH 3/5] Copy-pasted news site field groups ** Why are these changes being introduced: * There are 14 different field groups defined within the News site, which need to be brought over to the new application. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/lm-150 ** How does this address that need: * This exports the 14 legacy field groups to the mitlib-post/data folder, where our other field groups are defined. Each file is named using the key for that group. * No changes are made to these files in this commit - that will be next. ** Document any side effects to this change: * None, although 14 files is a code smell. --- .../mitlib-post/data/group_54dd062ba7953.json | 67 ++++++ .../mitlib-post/data/group_54dd062bee0d5.json | 77 +++++++ .../mitlib-post/data/group_54dd062c086fd.json | 72 ++++++ .../mitlib-post/data/group_54dd062c123b5.json | 67 ++++++ .../mitlib-post/data/group_54dd062c26afa.json | 48 ++++ .../mitlib-post/data/group_54dd062c31627.json | 66 ++++++ .../mitlib-post/data/group_54dd062c453cb.json | 58 +++++ .../mitlib-post/data/group_54dd062c4f33d.json | 80 +++++++ .../mitlib-post/data/group_54dd062c59653.json | 153 +++++++++++++ .../mitlib-post/data/group_54dd062c84904.json | 115 ++++++++++ .../mitlib-post/data/group_55096c358857e.json | 43 ++++ .../mitlib-post/data/group_55101c53c2d37.json | 210 ++++++++++++++++++ .../mitlib-post/data/group_55101c54091f3.json | 113 ++++++++++ .../mitlib-post/data/group_55c25be764027.json | 79 +++++++ 14 files changed, 1248 insertions(+) create mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062ba7953.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062bee0d5.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062c086fd.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062c26afa.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062c4f33d.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_55096c358857e.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_55101c53c2d37.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json create mode 100644 web/app/mu-plugins/mitlib-post/data/group_55c25be764027.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062ba7953.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062ba7953.json new file mode 100644 index 00000000..82320f8f --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062ba7953.json @@ -0,0 +1,67 @@ +[ + { + "key": "group_54dd062ba7953", + "title": "Date fields", + "fields": [ + { + "key": "field_543696fae1ec4", + "label": "Date start", + "name": "date_start", + "type": "date_picker", + "instructions": "Enter the start date", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "first_day": 1, + "return_format": "Ymd", + "display_format": "d\/m\/Y" + }, + { + "key": "field_54369712e1ec5", + "label": "Date end", + "name": "date_end", + "type": "date_picker", + "instructions": "Enter the end date.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "first_day": 1, + "return_format": "Ymd", + "display_format": "d\/m\/Y" + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "exhibits" + } + ], + [ + { + "param": "post_type", + "operator": "==", + "value": "updates" + } + ] + ], + "menu_order": 0, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [], + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062bee0d5.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062bee0d5.json new file mode 100644 index 00000000..f956791c --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062bee0d5.json @@ -0,0 +1,77 @@ +[ + { + "key": "group_54dd062bee0d5", + "title": "Link to Bibliotech pdf", + "fields": [ + { + "key": "field_54d13de713e1c", + "label": "Link to Bibliotech pdf", + "name": "bibLink", + "type": "text", + "instructions": "Link to pdf", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + }, + { + "key": "field_54d14348b8bf3", + "label": "Caption", + "name": "bibCaption", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "page", + "operator": "==", + "value": "17615" + } + ], + [ + { + "param": "page", + "operator": "==", + "value": "17705" + } + ] + ], + "menu_order": 0, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c086fd.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c086fd.json new file mode 100644 index 00000000..9272860d --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c086fd.json @@ -0,0 +1,72 @@ +[ + { + "key": "group_54dd062c086fd", + "title": "Features", + "fields": [ + { + "key": "field_54359302ca174", + "label": "Spotlight type", + "name": "feature_type", + "type": "select", + "instructions": "", + "required": 1, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "choices": { + "check": "Check it out", + "collection": "Featured collection", + "exhibit": "Featured exhibit", + "service": "Featured service", + "story": "Featured story", + "video": "Featured video", + "media": "In the media", + "tip": "Tip", + "update": "Update" + }, + "default_value": [], + "allow_null": 0, + "multiple": 0, + "ui": 1, + "ajax": 0, + "placeholder": "", + "disabled": 0, + "readonly": 0, + "return_format": "value" + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ] + ], + "menu_order": 1, + "position": "acf_after_title", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "the_content", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "featured_image", + "send-trackbacks" + ], + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json new file mode 100644 index 00000000..47eaac24 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json @@ -0,0 +1,67 @@ +[ + { + "key": "group_54dd062c123b5", + "title": "subtitle", + "fields": [ + { + "key": "field_54b54d9262fa8", + "label": "Subtitle", + "name": "subtitle", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + } + ] + ], + "menu_order": 1, + "position": "acf_after_title", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "send-trackbacks" + ], + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c26afa.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c26afa.json new file mode 100644 index 00000000..72dbbae7 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c26afa.json @@ -0,0 +1,48 @@ +[ + { + "key": "group_54dd062c26afa", + "title": "External links", + "fields": [ + { + "key": "field_5432b230123f7", + "label": "Link", + "name": "external_link", + "type": "text", + "instructions": "Add the link associated with this spotlight here.", + "required": 1, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ] + ], + "menu_order": 3, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [], + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json new file mode 100644 index 00000000..75c0f0ad --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json @@ -0,0 +1,66 @@ +[ + { + "key": "group_54dd062c31627", + "title": "Urgent for post", + "fields": [ + { + "key": "field_543699593ef84", + "label": "Urgent", + "name": "urgent", + "type": "true_false", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "message": "This post is urgent.", + "default_value": 0, + "ui": 0, + "ui_on_text": "", + "ui_off_text": "" + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ] + ], + "menu_order": 3, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "categories", + "tags", + "send-trackbacks" + ], + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json new file mode 100644 index 00000000..eb85dce1 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json @@ -0,0 +1,58 @@ +[ + { + "key": "group_54dd062c453cb", + "title": "Notes for admins", + "fields": [ + { + "key": "field_549476bac49d2", + "label": "Notes for editorial team", + "name": "notes", + "type": "textarea", + "instructions": "Please use this area to communicate with the editorial team. For news\/event posts - if you cannot find an image, let us know what you are looking for and we will try to help. Reminder, spotlights do not need images.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "maxlength": "", + "rows": "", + "new_lines": "br", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ], + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ] + ], + "menu_order": 5, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "the_content", + "excerpt", + "featured_image" + ], + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c4f33d.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c4f33d.json new file mode 100644 index 00000000..b76ef7a9 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c4f33d.json @@ -0,0 +1,80 @@ +[ + { + "key": "group_54dd062c4f33d", + "title": "Bibliotech Author", + "fields": [ + { + "key": "field_54b8223f87188", + "label": "Bilbiotech author", + "name": "bauthor", + "type": "text", + "instructions": "This field will be displayed as the author if it is filled out, if it is left blank then the author will be the logged in user that is creating the post.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + } + ], + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + } + ] + ], + "menu_order": 6, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "the_content", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "categories", + "tags", + "send-trackbacks" + ], + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json new file mode 100644 index 00000000..35118686 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json @@ -0,0 +1,153 @@ +[ + { + "key": "group_54dd062c59653", + "title": "Images for all post types", + "fields": [ + { + "key": "field_549485f7cbb49", + "label": "Grid view long top image", + "name": "featuredListImg", + "type": "image_crop", + "instructions": "This image is for the homepage and should be the exact dimensions 662px width by 256px height", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "crop_type": "hard", + "target_size": "news-feature", + "width": "662px", + "height": "256px", + "preview_size": "full", + "force_crop": "yes", + "save_in_media_library": "yes", + "retina_mode": "no", + "save_format": "url", + "library": "all" + }, + { + "key": "field_549489d7cbb4b", + "label": "Libraries homepage image", + "name": "homeImg", + "type": "image_crop", + "instructions": "This image is for the homepage and should be the exact dimensions 113px width by 206px height", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "crop_type": "hard", + "target_size": "news-home", + "width": "", + "height": "", + "preview_size": "full", + "force_crop": "yes", + "save_in_media_library": "yes", + "retina_mode": "no", + "save_format": "url", + "library": "all" + }, + { + "key": "field_54cfa8ab5b6f2", + "label": "Grid view regular box image", + "name": "listImg", + "type": "image_crop", + "instructions": "This image is for the news homepage and should be the exact dimensions 323px width by 111px height", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "crop_type": "hard", + "target_size": "news-listing", + "width": "", + "height": "", + "preview_size": "full", + "force_crop": "yes", + "save_in_media_library": "yes", + "retina_mode": "no", + "save_format": "url", + "library": "all" + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + } + ], + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + } + ], + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + } + ], + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + } + ] + ], + "menu_order": 7, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "categories", + "tags", + "send-trackbacks" + ], + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json new file mode 100644 index 00000000..99f4407f --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json @@ -0,0 +1,115 @@ +[ + { + "key": "group_54dd062c84904", + "title": "Select for Featured Article", + "fields": [ + { + "key": "field_5474bef390af8", + "label": "Featured Article on News Page", + "name": "featuredArticle", + "type": "radio", + "instructions": "Should this be featured on the front page of the news?", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "choices": { + "false": "Should not display on homepage", + "True": "Feature on homepage" + }, + "other_choice": 0, + "save_other_choice": 0, + "default_value": "false : Should not display on homepage", + "layout": "vertical", + "allow_null": 0, + "return_format": "value" + } + ], + "location": [ + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + } + ] + ], + "menu_order": 2000, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_55096c358857e.json b/web/app/mu-plugins/mitlib-post/data/group_55096c358857e.json new file mode 100644 index 00000000..b6781eda --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_55096c358857e.json @@ -0,0 +1,43 @@ +[ + { + "key": "group_55096c358857e", + "title": "Image info", + "fields": [ + { + "key": "field_55096c43b870d", + "label": "Use the “Add Media” button below to upload the image(s) to your post.", + "name": "", + "type": "message", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "message": "Remember to rename and resize (if too large) your files before uploading.
For complete information\/image help see Image instructions.<\/a>", + "esc_html": 0, + "new_lines": "wpautop" + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ] + ], + "menu_order": 3, + "position": "acf_after_title", + "style": "default", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_55101c53c2d37.json b/web/app/mu-plugins/mitlib-post/data/group_55101c53c2d37.json new file mode 100644 index 00000000..3faa0943 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_55101c53c2d37.json @@ -0,0 +1,210 @@ +[ + { + "key": "group_55101c53c2d37", + "title": "Event fields", + "fields": [ + { + "key": "field_53ecc2067d32f", + "label": "Is event", + "name": "is_event", + "type": "true_false", + "instructions": "Check the box to mark this post as an event.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "message": "", + "default_value": 0, + "ui": 0, + "ui_on_text": "", + "ui_off_text": "" + }, + { + "key": "field_53ecc21c7d330", + "label": "Event date", + "name": "event_date", + "type": "date_picker", + "instructions": "Select the event date.", + "required": 0, + "conditional_logic": [ + [ + { + "field": "field_53ecc2067d32f", + "operator": "==", + "value": "1" + } + ] + ], + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "first_day": 1, + "return_format": "Ymd", + "display_format": "F d" + }, + { + "key": "field_53ecc24f7d331", + "label": "Event Start Time", + "name": "event_start_time", + "type": "text", + "instructions": "Enter the event start time. This field is not required.", + "required": 0, + "conditional_logic": [ + [ + { + "field": "field_53ecc2067d32f", + "operator": "==", + "value": "1" + } + ] + ], + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "12pm", + "prepend": "", + "append": "", + "maxlength": 8 + }, + { + "key": "field_53ecc2667d332", + "label": "Event end time", + "name": "event_end_time", + "type": "text", + "instructions": "Enter the event end time. This field is not required.", + "required": 0, + "conditional_logic": [ + [ + { + "field": "field_53ecc2067d32f", + "operator": "==", + "value": "1" + } + ] + ], + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "3pm", + "prepend": "", + "append": "", + "maxlength": 8 + }, + { + "key": "field_5a2a9ca90a81c", + "label": "Calendar URL", + "name": "calendar_url", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "maxlength": "" + }, + { + "key": "field_5a2a9cd20a81d", + "label": "Calendar ID", + "name": "calendar_id", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "maxlength": "" + }, + { + "key": "field_5a2a9ce50a81e", + "label": "Calendar Image", + "name": "calendar_image", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "maxlength": "" + } + ], + "location": [ + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "contributor" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ] + ], + "menu_order": 2, + "position": "acf_after_title", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json b/web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json new file mode 100644 index 00000000..2ace82cd --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json @@ -0,0 +1,113 @@ +[ + { + "key": "group_55101c54091f3", + "title": "Homepage fields", + "fields": [ + { + "key": "field_53ecc2b9abf15", + "label": "Homepage post title", + "name": "homepage_post_title", + "type": "text", + "instructions": "Enter the title of the post as it should appear on the homepage.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "none", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ] + ], + "menu_order": 11, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_55c25be764027.json b/web/app/mu-plugins/mitlib-post/data/group_55c25be764027.json new file mode 100644 index 00000000..b08267c5 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/group_55c25be764027.json @@ -0,0 +1,79 @@ +[ + { + "key": "group_55c25be764027", + "title": "Post Author", + "fields": [ + { + "key": "field_55c25bebd5a82", + "label": "Post Author", + "name": "pauthor", + "type": "text", + "instructions": "This field will be displayed as the author if it is filled out, if it is left blank then the author will be the logged in user that is creating the post.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "contributor" + } + ] + ], + "menu_order": 3, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "the_content", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "categories", + "tags", + "send-trackbacks" + ], + "active": true, + "description": "", + "show_in_rest": false + } +] \ No newline at end of file From 77841c75436a8a889a1663f54462f26e44b2ccf3 Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Tue, 21 Mar 2023 13:58:26 -0400 Subject: [PATCH 4/5] Update news site field group definitions ** Why are these changes being introduced: * The exported field groups added in the last commit need updates to be loaded correctly, and need better documentation ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/lm-150 ** How does this address that need: * This updates the field group JSON files to allow them to be loaded correctly. It also updates the group titles and descriptions, which are seen in the field groups admin screen (but does not change either the field names themselves, or how they appear on the record edit screen). ** Document any side effects to this change: * I need to investigate whether these are properly scoped for this approach; I worry that this approach will leak these fields to other sites that use Post records (which is about half the site). --- .../mitlib-post/data/group_54dd062ba7953.json | 67 --- .../mitlib-post/data/group_54dd062bee0d5.json | 139 +++--- .../mitlib-post/data/group_54dd062c086fd.json | 138 +++--- .../mitlib-post/data/group_54dd062c123b5.json | 126 +++--- .../mitlib-post/data/group_54dd062c26afa.json | 90 ++-- .../mitlib-post/data/group_54dd062c31627.json | 124 +++--- .../mitlib-post/data/group_54dd062c453cb.json | 108 +++-- .../mitlib-post/data/group_54dd062c4f33d.json | 152 ++++--- .../mitlib-post/data/group_54dd062c59653.json | 288 +++++++------ .../mitlib-post/data/group_54dd062c84904.json | 220 +++++----- .../mitlib-post/data/group_55096c358857e.json | 80 ++-- .../mitlib-post/data/group_55101c53c2d37.json | 396 +++++++++--------- .../mitlib-post/data/group_55101c54091f3.json | 216 +++++----- .../mitlib-post/data/group_55c25be764027.json | 150 ++++--- 14 files changed, 1097 insertions(+), 1197 deletions(-) delete mode 100644 web/app/mu-plugins/mitlib-post/data/group_54dd062ba7953.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062ba7953.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062ba7953.json deleted file mode 100644 index 82320f8f..00000000 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062ba7953.json +++ /dev/null @@ -1,67 +0,0 @@ -[ - { - "key": "group_54dd062ba7953", - "title": "Date fields", - "fields": [ - { - "key": "field_543696fae1ec4", - "label": "Date start", - "name": "date_start", - "type": "date_picker", - "instructions": "Enter the start date", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "first_day": 1, - "return_format": "Ymd", - "display_format": "d\/m\/Y" - }, - { - "key": "field_54369712e1ec5", - "label": "Date end", - "name": "date_end", - "type": "date_picker", - "instructions": "Enter the end date.", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "first_day": 1, - "return_format": "Ymd", - "display_format": "d\/m\/Y" - } - ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "exhibits" - } - ], - [ - { - "param": "post_type", - "operator": "==", - "value": "updates" - } - ] - ], - "menu_order": 0, - "position": "normal", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": [], - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062bee0d5.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062bee0d5.json index f956791c..c1b57be3 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062bee0d5.json +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062bee0d5.json @@ -1,77 +1,68 @@ -[ - { - "key": "group_54dd062bee0d5", - "title": "Link to Bibliotech pdf", - "fields": [ - { - "key": "field_54d13de713e1c", - "label": "Link to Bibliotech pdf", - "name": "bibLink", - "type": "text", - "instructions": "Link to pdf", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "formatting": "html", - "maxlength": "", - "readonly": 0, - "disabled": 0 +{ + "key": "group_54dd062bee0d5", + "title": "Link to Bibliotech pdf", + "fields": [ + { + "key": "field_54d13de713e1c", + "label": "Link to Bibliotech pdf", + "name": "bibLink", + "type": "text", + "instructions": "Link to pdf", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + }, + { + "key": "field_54d14348b8bf3", + "label": "Caption", + "name": "bibCaption", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ { - "key": "field_54d14348b8bf3", - "label": "Caption", - "name": "bibCaption", - "type": "text", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "formatting": "html", - "maxlength": "", - "readonly": 0, - "disabled": 0 + "param": "page", + "operator": "==", + "value": "17615" } - ], - "location": [ - [ - { - "param": "page", - "operator": "==", - "value": "17615" - } - ], - [ - { - "param": "page", - "operator": "==", - "value": "17705" - } - ] - ], - "menu_order": 0, - "position": "normal", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": "", - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + ] + ], + "menu_order": 0, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "News site: Link to current Bibliotech materials for one page (the index of past issues)", + "show_in_rest": false +} \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c086fd.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c086fd.json index 9272860d..5e729329 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c086fd.json +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c086fd.json @@ -1,72 +1,70 @@ -[ - { - "key": "group_54dd062c086fd", - "title": "Features", - "fields": [ +{ + "key": "group_54dd062c086fd", + "title": "Spotlight type", + "fields": [ + { + "key": "field_54359302ca174", + "label": "Spotlight type", + "name": "feature_type", + "type": "select", + "instructions": "", + "required": 1, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "choices": { + "check": "Check it out", + "collection": "Featured collection", + "exhibit": "Featured exhibit", + "service": "Featured service", + "story": "Featured story", + "video": "Featured video", + "media": "In the media", + "tip": "Tip", + "update": "Update" + }, + "default_value": [], + "allow_null": 0, + "multiple": 0, + "ui": 1, + "ajax": 0, + "placeholder": "", + "disabled": 0, + "readonly": 0, + "return_format": "value" + } + ], + "location": [ + [ { - "key": "field_54359302ca174", - "label": "Spotlight type", - "name": "feature_type", - "type": "select", - "instructions": "", - "required": 1, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "choices": { - "check": "Check it out", - "collection": "Featured collection", - "exhibit": "Featured exhibit", - "service": "Featured service", - "story": "Featured story", - "video": "Featured video", - "media": "In the media", - "tip": "Tip", - "update": "Update" - }, - "default_value": [], - "allow_null": 0, - "multiple": 0, - "ui": 1, - "ajax": 0, - "placeholder": "", - "disabled": 0, - "readonly": 0, - "return_format": "value" + "param": "post_type", + "operator": "==", + "value": "spotlights" } - ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ] - ], - "menu_order": 1, - "position": "acf_after_title", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": [ - "permalink", - "the_content", - "excerpt", - "custom_fields", - "discussion", - "comments", - "revisions", - "slug", - "author", - "featured_image", - "send-trackbacks" - ], - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + ] + ], + "menu_order": 1, + "position": "acf_after_title", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "the_content", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "featured_image", + "send-trackbacks" + ], + "active": true, + "description": "News site: Add a type field to Spotlight records", + "show_in_rest": false +} \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json index 47eaac24..7c36fd3e 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json @@ -1,67 +1,65 @@ -[ - { - "key": "group_54dd062c123b5", - "title": "subtitle", - "fields": [ +{ + "key": "group_54dd062c123b5", + "title": "Subtitle", + "fields": [ + { + "key": "field_54b54d9262fa8", + "label": "Subtitle", + "name": "subtitle", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ { - "key": "field_54b54d9262fa8", - "label": "Subtitle", - "name": "subtitle", - "type": "text", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "formatting": "html", - "maxlength": "", - "readonly": 0, - "disabled": 0 + "param": "post_type", + "operator": "==", + "value": "post" } ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - } - ] - ], - "menu_order": 1, - "position": "acf_after_title", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": [ - "permalink", - "excerpt", - "custom_fields", - "discussion", - "comments", - "revisions", - "slug", - "author", - "format", - "featured_image", - "send-trackbacks" - ], - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + } + ] + ], + "menu_order": 1, + "position": "acf_after_title", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "send-trackbacks" + ], + "active": true, + "description": "News site: Add a subtitle to Post and Bibliotech records", + "show_in_rest": false +} \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c26afa.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c26afa.json index 72dbbae7..a580d5c7 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c26afa.json +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c26afa.json @@ -1,48 +1,46 @@ -[ - { - "key": "group_54dd062c26afa", - "title": "External links", - "fields": [ +{ + "key": "group_54dd062c26afa", + "title": "External links", + "fields": [ + { + "key": "field_5432b230123f7", + "label": "Link", + "name": "external_link", + "type": "text", + "instructions": "Add the link associated with this spotlight here.", + "required": 1, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ { - "key": "field_5432b230123f7", - "label": "Link", - "name": "external_link", - "type": "text", - "instructions": "Add the link associated with this spotlight here.", - "required": 1, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "formatting": "html", - "maxlength": "", - "readonly": 0, - "disabled": 0 + "param": "post_type", + "operator": "==", + "value": "spotlights" } - ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ] - ], - "menu_order": 3, - "position": "normal", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": [], - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + ] + ], + "menu_order": 3, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [], + "active": true, + "description": "News site: Add a link field to Spotlight records", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json index 75c0f0ad..781a5ae7 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json @@ -1,66 +1,64 @@ -[ - { - "key": "group_54dd062c31627", - "title": "Urgent for post", - "fields": [ +{ + "key": "group_54dd062c31627", + "title": "Urgency flag", + "fields": [ + { + "key": "field_543699593ef84", + "label": "Urgent", + "name": "urgent", + "type": "true_false", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "message": "This post is urgent.", + "default_value": 0, + "ui": 0, + "ui_on_text": "", + "ui_off_text": "" + } + ], + "location": [ + [ { - "key": "field_543699593ef84", - "label": "Urgent", - "name": "urgent", - "type": "true_false", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "message": "This post is urgent.", - "default_value": 0, - "ui": 0, - "ui_on_text": "", - "ui_off_text": "" + "param": "post_type", + "operator": "==", + "value": "post" } ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ] - ], - "menu_order": 3, - "position": "normal", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": [ - "permalink", - "excerpt", - "custom_fields", - "discussion", - "comments", - "revisions", - "slug", - "author", - "format", - "featured_image", - "categories", - "tags", - "send-trackbacks" - ], - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + [ + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ] + ], + "menu_order": 3, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "categories", + "tags", + "send-trackbacks" + ], + "active": true, + "description": "News site: Add a flag for urgent review to Post and Spotlight records", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json index eb85dce1..364de29f 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json @@ -1,58 +1,56 @@ -[ - { - "key": "group_54dd062c453cb", - "title": "Notes for admins", - "fields": [ +{ + "key": "group_54dd062c453cb", + "title": "Notes for admins", + "fields": [ + { + "key": "field_549476bac49d2", + "label": "Notes for editorial team", + "name": "notes", + "type": "textarea", + "instructions": "Please use this area to communicate with the editorial team. For news\/event posts - if you cannot find an image, let us know what you are looking for and we will try to help. Reminder, spotlights do not need images.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "maxlength": "", + "rows": "", + "new_lines": "br", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ { - "key": "field_549476bac49d2", - "label": "Notes for editorial team", - "name": "notes", - "type": "textarea", - "instructions": "Please use this area to communicate with the editorial team. For news\/event posts - if you cannot find an image, let us know what you are looking for and we will try to help. Reminder, spotlights do not need images.", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "maxlength": "", - "rows": "", - "new_lines": "br", - "readonly": 0, - "disabled": 0 + "param": "post_type", + "operator": "==", + "value": "spotlights" } ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ], - [ - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ] - ], - "menu_order": 5, - "position": "normal", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": [ - "the_content", - "excerpt", - "featured_image" - ], - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ] + ], + "menu_order": 5, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "the_content", + "excerpt", + "featured_image" + ], + "active": true, + "description": "News site: Add a notes field for admin review to Post and Spotlight records", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c4f33d.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c4f33d.json index b76ef7a9..91e05d59 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c4f33d.json +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c4f33d.json @@ -1,80 +1,78 @@ -[ - { - "key": "group_54dd062c4f33d", - "title": "Bibliotech Author", - "fields": [ +{ + "key": "group_54dd062c4f33d", + "title": "Bibliotech Author", + "fields": [ + { + "key": "field_54b8223f87188", + "label": "Bilbiotech author", + "name": "bauthor", + "type": "text", + "instructions": "This field will be displayed as the author if it is filled out, if it is left blank then the author will be the logged in user that is creating the post.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ { - "key": "field_54b8223f87188", - "label": "Bilbiotech author", - "name": "bauthor", - "type": "text", - "instructions": "This field will be displayed as the author if it is filled out, if it is left blank then the author will be the logged in user that is creating the post.", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "formatting": "html", - "maxlength": "", - "readonly": 0, - "disabled": 0 + "param": "post_type", + "operator": "==", + "value": "bibliotech" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" } ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - }, - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - } - ], - [ - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - }, - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - } - ] - ], - "menu_order": 6, - "position": "normal", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": [ - "permalink", - "the_content", - "excerpt", - "custom_fields", - "discussion", - "comments", - "revisions", - "slug", - "author", - "format", - "featured_image", - "categories", - "tags", - "send-trackbacks" - ], - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + } + ] + ], + "menu_order": 6, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "the_content", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "categories", + "tags", + "send-trackbacks" + ], + "active": true, + "description": "News site: Add a field for article author to Bibliotech records - visible only for admins and above", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json index 35118686..7510daaa 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json @@ -1,153 +1,151 @@ -[ - { - "key": "group_54dd062c59653", - "title": "Images for all post types", - "fields": [ - { - "key": "field_549485f7cbb49", - "label": "Grid view long top image", - "name": "featuredListImg", - "type": "image_crop", - "instructions": "This image is for the homepage and should be the exact dimensions 662px width by 256px height", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "crop_type": "hard", - "target_size": "news-feature", - "width": "662px", - "height": "256px", - "preview_size": "full", - "force_crop": "yes", - "save_in_media_library": "yes", - "retina_mode": "no", - "save_format": "url", - "library": "all" +{ + "key": "group_54dd062c59653", + "title": "Surrogate images", + "fields": [ + { + "key": "field_549485f7cbb49", + "label": "Grid view long top image", + "name": "featuredListImg", + "type": "image_crop", + "instructions": "This image is for the homepage and should be the exact dimensions 662px width by 256px height", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" }, - { - "key": "field_549489d7cbb4b", - "label": "Libraries homepage image", - "name": "homeImg", - "type": "image_crop", - "instructions": "This image is for the homepage and should be the exact dimensions 113px width by 206px height", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "crop_type": "hard", - "target_size": "news-home", + "crop_type": "hard", + "target_size": "news-feature", + "width": "662px", + "height": "256px", + "preview_size": "full", + "force_crop": "yes", + "save_in_media_library": "yes", + "retina_mode": "no", + "save_format": "url", + "library": "all" + }, + { + "key": "field_549489d7cbb4b", + "label": "Libraries homepage image", + "name": "homeImg", + "type": "image_crop", + "instructions": "This image is for the homepage and should be the exact dimensions 113px width by 206px height", + "required": 0, + "conditional_logic": 0, + "wrapper": { "width": "", - "height": "", - "preview_size": "full", - "force_crop": "yes", - "save_in_media_library": "yes", - "retina_mode": "no", - "save_format": "url", - "library": "all" + "class": "", + "id": "" }, - { - "key": "field_54cfa8ab5b6f2", - "label": "Grid view regular box image", - "name": "listImg", - "type": "image_crop", - "instructions": "This image is for the news homepage and should be the exact dimensions 323px width by 111px height", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "crop_type": "hard", - "target_size": "news-listing", + "crop_type": "hard", + "target_size": "news-home", + "width": "", + "height": "", + "preview_size": "full", + "force_crop": "yes", + "save_in_media_library": "yes", + "retina_mode": "no", + "save_format": "url", + "library": "all" + }, + { + "key": "field_54cfa8ab5b6f2", + "label": "Grid view regular box image", + "name": "listImg", + "type": "image_crop", + "instructions": "This image is for the news homepage and should be the exact dimensions 323px width by 111px height", + "required": 0, + "conditional_logic": 0, + "wrapper": { "width": "", - "height": "", - "preview_size": "full", - "force_crop": "yes", - "save_in_media_library": "yes", - "retina_mode": "no", - "save_format": "url", - "library": "all" + "class": "", + "id": "" + }, + "crop_type": "hard", + "target_size": "news-listing", + "width": "", + "height": "", + "preview_size": "full", + "force_crop": "yes", + "save_in_media_library": "yes", + "retina_mode": "no", + "save_format": "url", + "library": "all" + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" } ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "post" - }, - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - } - ], - [ - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - }, - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - } - ], - [ - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - }, - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - } - ], - [ - { - "param": "post_type", - "operator": "==", - "value": "post" - }, - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - } - ] + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + } ], - "menu_order": 7, - "position": "normal", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": [ - "permalink", - "excerpt", - "custom_fields", - "discussion", - "comments", - "revisions", - "slug", - "author", - "format", - "featured_image", - "categories", - "tags", - "send-trackbacks" + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + } ], - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + } + ] + ], + "menu_order": 7, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "categories", + "tags", + "send-trackbacks" + ], + "active": true, + "description": "News site: Add fields for specifically-sized images when Post and Bibliotech records are promoted - visible only to admins and above", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json b/web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json index 99f4407f..412cac61 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json +++ b/web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json @@ -1,115 +1,113 @@ -[ - { - "key": "group_54dd062c84904", - "title": "Select for Featured Article", - "fields": [ +{ + "key": "group_54dd062c84904", + "title": "Featured Article flag", + "fields": [ + { + "key": "field_5474bef390af8", + "label": "Featured Article on News Page", + "name": "featuredArticle", + "type": "radio", + "instructions": "Should this be featured on the front page of the news?", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "choices": { + "false": "Should not display on homepage", + "True": "Feature on homepage" + }, + "other_choice": 0, + "save_other_choice": 0, + "default_value": "false : Should not display on homepage", + "layout": "vertical", + "allow_null": 0, + "return_format": "value" + } + ], + "location": [ + [ { - "key": "field_5474bef390af8", - "label": "Featured Article on News Page", - "name": "featuredArticle", - "type": "radio", - "instructions": "Should this be featured on the front page of the news?", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "choices": { - "false": "Should not display on homepage", - "True": "Feature on homepage" - }, - "other_choice": 0, - "save_other_choice": 0, - "default_value": "false : Should not display on homepage", - "layout": "vertical", - "allow_null": 0, - "return_format": "value" + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" } ], - "location": [ - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - } - ] + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + } ], - "menu_order": 2000, - "position": "normal", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": "", - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + } + ] + ], + "menu_order": 2000, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "News site: Add a flag to promote news site content (Posts, Bibliotech, Spotlights) to parent site front page - visible only to admins and above", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_55096c358857e.json b/web/app/mu-plugins/mitlib-post/data/group_55096c358857e.json index b6781eda..e923e6d6 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_55096c358857e.json +++ b/web/app/mu-plugins/mitlib-post/data/group_55096c358857e.json @@ -1,43 +1,41 @@ -[ - { - "key": "group_55096c358857e", - "title": "Image info", - "fields": [ +{ + "key": "group_55096c358857e", + "title": "Image info", + "fields": [ + { + "key": "field_55096c43b870d", + "label": "Use the “Add Media” button below to upload the image(s) to your post.", + "name": "", + "type": "message", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "message": "Remember to rename and resize (if too large) your files before uploading.
For complete information\/image help see
Image instructions.<\/a>", + "esc_html": 0, + "new_lines": "wpautop" + } + ], + "location": [ + [ { - "key": "field_55096c43b870d", - "label": "Use the “Add Media” button below to upload the image(s) to your post.", - "name": "", - "type": "message", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "message": "Remember to rename and resize (if too large) your files before uploading.
For complete information\/image help see
Image instructions.<\/a>", - "esc_html": 0, - "new_lines": "wpautop" + "param": "post_type", + "operator": "==", + "value": "post" } - ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ] - ], - "menu_order": 3, - "position": "acf_after_title", - "style": "default", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": "", - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + ] + ], + "menu_order": 3, + "position": "acf_after_title", + "style": "default", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "News site: Add an info box reminding authors how to attach images to an article.", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_55101c53c2d37.json b/web/app/mu-plugins/mitlib-post/data/group_55101c53c2d37.json index 3faa0943..7e342ae5 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_55101c53c2d37.json +++ b/web/app/mu-plugins/mitlib-post/data/group_55101c53c2d37.json @@ -1,210 +1,208 @@ -[ - { - "key": "group_55101c53c2d37", - "title": "Event fields", - "fields": [ - { - "key": "field_53ecc2067d32f", - "label": "Is event", - "name": "is_event", - "type": "true_false", - "instructions": "Check the box to mark this post as an event.", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "message": "", - "default_value": 0, - "ui": 0, - "ui_on_text": "", - "ui_off_text": "" +{ + "key": "group_55101c53c2d37", + "title": "Event fields", + "fields": [ + { + "key": "field_53ecc2067d32f", + "label": "Is event", + "name": "is_event", + "type": "true_false", + "instructions": "Check the box to mark this post as an event.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" }, - { - "key": "field_53ecc21c7d330", - "label": "Event date", - "name": "event_date", - "type": "date_picker", - "instructions": "Select the event date.", - "required": 0, - "conditional_logic": [ - [ - { - "field": "field_53ecc2067d32f", - "operator": "==", - "value": "1" - } - ] - ], - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "first_day": 1, - "return_format": "Ymd", - "display_format": "F d" + "message": "", + "default_value": 0, + "ui": 0, + "ui_on_text": "", + "ui_off_text": "" + }, + { + "key": "field_53ecc21c7d330", + "label": "Event date", + "name": "event_date", + "type": "date_picker", + "instructions": "Select the event date.", + "required": 0, + "conditional_logic": [ + [ + { + "field": "field_53ecc2067d32f", + "operator": "==", + "value": "1" + } + ] + ], + "wrapper": { + "width": "", + "class": "", + "id": "" }, - { - "key": "field_53ecc24f7d331", - "label": "Event Start Time", - "name": "event_start_time", - "type": "text", - "instructions": "Enter the event start time. This field is not required.", - "required": 0, - "conditional_logic": [ - [ - { - "field": "field_53ecc2067d32f", - "operator": "==", - "value": "1" - } - ] - ], - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "12pm", - "prepend": "", - "append": "", - "maxlength": 8 + "first_day": 1, + "return_format": "Ymd", + "display_format": "F d" + }, + { + "key": "field_53ecc24f7d331", + "label": "Event Start Time", + "name": "event_start_time", + "type": "text", + "instructions": "Enter the event start time. This field is not required.", + "required": 0, + "conditional_logic": [ + [ + { + "field": "field_53ecc2067d32f", + "operator": "==", + "value": "1" + } + ] + ], + "wrapper": { + "width": "", + "class": "", + "id": "" }, - { - "key": "field_53ecc2667d332", - "label": "Event end time", - "name": "event_end_time", - "type": "text", - "instructions": "Enter the event end time. This field is not required.", - "required": 0, - "conditional_logic": [ - [ - { - "field": "field_53ecc2067d32f", - "operator": "==", - "value": "1" - } - ] - ], - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "3pm", - "prepend": "", - "append": "", - "maxlength": 8 + "default_value": "", + "placeholder": "12pm", + "prepend": "", + "append": "", + "maxlength": 8 + }, + { + "key": "field_53ecc2667d332", + "label": "Event end time", + "name": "event_end_time", + "type": "text", + "instructions": "Enter the event end time. This field is not required.", + "required": 0, + "conditional_logic": [ + [ + { + "field": "field_53ecc2067d32f", + "operator": "==", + "value": "1" + } + ] + ], + "wrapper": { + "width": "", + "class": "", + "id": "" }, - { - "key": "field_5a2a9ca90a81c", - "label": "Calendar URL", - "name": "calendar_url", - "type": "text", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "maxlength": "" + "default_value": "", + "placeholder": "3pm", + "prepend": "", + "append": "", + "maxlength": 8 + }, + { + "key": "field_5a2a9ca90a81c", + "label": "Calendar URL", + "name": "calendar_url", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "maxlength": "" + }, + { + "key": "field_5a2a9cd20a81d", + "label": "Calendar ID", + "name": "calendar_id", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "maxlength": "" + }, + { + "key": "field_5a2a9ce50a81e", + "label": "Calendar Image", + "name": "calendar_image", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "maxlength": "" + } + ], + "location": [ + [ { - "key": "field_5a2a9cd20a81d", - "label": "Calendar ID", - "name": "calendar_id", - "type": "text", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "maxlength": "" + "param": "current_user_role", + "operator": "==", + "value": "super_admin" }, { - "key": "field_5a2a9ce50a81e", - "label": "Calendar Image", - "name": "calendar_image", - "type": "text", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "maxlength": "" + "param": "post_type", + "operator": "==", + "value": "post" } ], - "location": [ - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "contributor" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ] + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } ], - "menu_order": 2, - "position": "acf_after_title", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": "", - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + [ + { + "param": "current_user_role", + "operator": "==", + "value": "contributor" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ] + ], + "menu_order": 2, + "position": "acf_after_title", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "News site: Add a cluster of fields to allow a Post record to function as an event - visible to Contributors, Admins, and Super Admins", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json b/web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json index 2ace82cd..fb79ad19 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json +++ b/web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json @@ -1,113 +1,111 @@ -[ - { - "key": "group_55101c54091f3", - "title": "Homepage fields", - "fields": [ +{ + "key": "group_55101c54091f3", + "title": "Homepage title", + "fields": [ + { + "key": "field_53ecc2b9abf15", + "label": "Homepage post title", + "name": "homepage_post_title", + "type": "text", + "instructions": "Enter the title of the post as it should appear on the homepage.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "none", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ { - "key": "field_53ecc2b9abf15", - "label": "Homepage post title", - "name": "homepage_post_title", - "type": "text", - "instructions": "Enter the title of the post as it should appear on the homepage.", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "formatting": "none", - "maxlength": "", - "readonly": 0, - "disabled": 0 + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" } ], - "location": [ - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ] + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + } ], - "menu_order": 11, - "position": "normal", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": "", - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ] + ], + "menu_order": 11, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "News site: Add a variation of the title field on Post, Spotlight, and Bibliotech records for use on the parent site homepage - visible only to admins and above", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_55c25be764027.json b/web/app/mu-plugins/mitlib-post/data/group_55c25be764027.json index b08267c5..ea75c3dc 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_55c25be764027.json +++ b/web/app/mu-plugins/mitlib-post/data/group_55c25be764027.json @@ -1,79 +1,77 @@ -[ - { - "key": "group_55c25be764027", - "title": "Post Author", - "fields": [ +{ + "key": "group_55c25be764027", + "title": "Post Author", + "fields": [ + { + "key": "field_55c25bebd5a82", + "label": "Post Author", + "name": "pauthor", + "type": "text", + "instructions": "This field will be displayed as the author if it is filled out, if it is left blank then the author will be the logged in user that is creating the post.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ { - "key": "field_55c25bebd5a82", - "label": "Post Author", - "name": "pauthor", - "type": "text", - "instructions": "This field will be displayed as the author if it is filled out, if it is left blank then the author will be the logged in user that is creating the post.", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "placeholder": "", - "prepend": "", - "append": "", - "maxlength": "", - "readonly": 0, - "disabled": 0 + "param": "post_type", + "operator": "==", + "value": "post" } ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "current_user_role", - "operator": "==", - "value": "contributor" - } - ] - ], - "menu_order": 3, - "position": "normal", - "style": "seamless", - "label_placement": "top", - "instruction_placement": "label", - "hide_on_screen": [ - "permalink", - "the_content", - "excerpt", - "custom_fields", - "discussion", - "comments", - "revisions", - "slug", - "author", - "format", - "featured_image", - "categories", - "tags", - "send-trackbacks" - ], - "active": true, - "description": "", - "show_in_rest": false - } -] \ No newline at end of file + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "contributor" + } + ] + ], + "menu_order": 3, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "the_content", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "categories", + "tags", + "send-trackbacks" + ], + "active": true, + "description": "News site: Add a separate author field (a string) when the built-in author (a user reference) should not be shown - visible to contributors, admins, and super admins", + "show_in_rest": false +} From acb5befc7d1061dbce0bbe135c309c678bba3719 Mon Sep 17 00:00:00 2001 From: Matt Bernhardt Date: Wed, 22 Mar 2023 16:28:45 -0400 Subject: [PATCH 5/5] Refactor ACF field storage and MITlib Post plugin ** Why are these changes being introduced: * We realized that the current "all fields stored in the same folder" approach to storing fields and field groups produced a bug, in which unwanted fields would be implemented in certain circumstances (such as when multiple posts or sites extended the same built-in post types in different ways, or when a site wanted to implement only one post type but leave the built-in types unaffected). ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/lm-150 ** How does this address that need: * This refactors the load_point and save_point methods in the MITLib Post plugin, so that when called those methods first determine which descendant class has called the method. This is used to load only a specific sub-directory of the data folder, preventing field leakage that was not intended by site builders. * This also creates two additional site-specific plugins for extending build-in post types, for the News site and Parent site specifically. Dealing with the Parent site is needed now because the previous bullet point meant that some existing field groups needed a home, or they would disappear during this work. Creating this site-specific plugin gives those fields a home. * The prior approach to grouping field definitions by function, so that a single JSON file would add a batch of fields to multiple post types, has been abandoned. Those JSON files which did this have been split apart, so that - for example, the file group_54dd062c84904.json in the data folder is now group_54dd062c84904-1.json under the sitenews folder (for adding the flag to the Post record), group_54dd062c84904-2 in the bibliotech folder (for adding the flag to the Bibliotech record), and group_54dd062c84904-3.json under the spotlight folder (for adding the flag to the Spotlight post type). ** Document any side effects to this change: * Some existing field leakage which is already visible will now be resolved. For an example, note that in the Live tier right now, if you create a Post record under the Exhibits site, you will have an option to make that record an Alert - which should not be the case. --- .gitignore | 2 + .../group_54dd062c123b5-2.json} | 13 +- .../{ => bibliotech}/group_54dd062c4f33d.json | 0 .../bibliotech/group_54dd062c59653-2.json | 127 ++++++++++++++++++ .../group_54dd062c84904-2.json} | 54 +------- .../group_55101c54091f3-2.json} | 54 +------- .../{ => event}/group_5668669a86e5c-2.json | 0 .../{ => exhibit}/group_566849b5bf143-2.json | 0 .../{ => expert}/group_58e229319dfff.json | 0 .../{ => location}/group_58e22931ab9f5.json | 0 .../{ => sitenews}/group_54dd062bee0d5.json | 0 .../data/sitenews/group_54dd062c123b5-1.json | 58 ++++++++ .../data/sitenews/group_54dd062c31627-1.json | 57 ++++++++ .../data/sitenews/group_54dd062c453cb-1.json | 49 +++++++ .../group_54dd062c59653-1.json} | 30 +---- .../data/sitenews/group_54dd062c84904-1.json | 65 +++++++++ .../{ => sitenews}/group_55096c358857e.json | 0 .../{ => sitenews}/group_55101c53c2d37.json | 0 .../data/sitenews/group_55101c54091f3-1.json | 63 +++++++++ .../{ => sitenews}/group_55c25be764027.json | 0 .../{ => siteparent}/group_58e229318a751.json | 0 .../{ => siteparent}/group_58e22931f3f43.json | 0 .../{ => spotlight}/group_54dd062c086fd.json | 0 .../{ => spotlight}/group_54dd062c26afa.json | 0 .../group_54dd062c31627-2.json} | 11 +- .../group_54dd062c453cb-2.json} | 13 +- .../data/spotlight/group_54dd062c84904-3.json | 65 +++++++++ .../data/spotlight/group_55101c54091f3-3.json | 63 +++++++++ .../mu-plugins/mitlib-post/src/class-base.php | 34 ++++- .../mitlib-post-site-news.php | 25 ++++ .../src/class-sitenews.php | 17 +++ .../mitlib-post-site-parent.php | 25 ++++ .../src/class-siteparent.php | 17 +++ 33 files changed, 679 insertions(+), 163 deletions(-) rename web/app/mu-plugins/mitlib-post/data/{group_54dd062c123b5.json => bibliotech/group_54dd062c123b5-2.json} (81%) rename web/app/mu-plugins/mitlib-post/data/{ => bibliotech}/group_54dd062c4f33d.json (100%) create mode 100644 web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c59653-2.json rename web/app/mu-plugins/mitlib-post/data/{group_54dd062c84904.json => bibliotech/group_54dd062c84904-2.json} (54%) rename web/app/mu-plugins/mitlib-post/data/{group_55101c54091f3.json => bibliotech/group_55101c54091f3-2.json} (51%) rename web/app/mu-plugins/mitlib-post/data/{ => event}/group_5668669a86e5c-2.json (100%) rename web/app/mu-plugins/mitlib-post/data/{ => exhibit}/group_566849b5bf143-2.json (100%) rename web/app/mu-plugins/mitlib-post/data/{ => expert}/group_58e229319dfff.json (100%) rename web/app/mu-plugins/mitlib-post/data/{ => location}/group_58e22931ab9f5.json (100%) rename web/app/mu-plugins/mitlib-post/data/{ => sitenews}/group_54dd062bee0d5.json (100%) create mode 100644 web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c123b5-1.json create mode 100644 web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c31627-1.json create mode 100644 web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c453cb-1.json rename web/app/mu-plugins/mitlib-post/data/{group_54dd062c59653.json => sitenews/group_54dd062c59653-1.json} (82%) create mode 100644 web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c84904-1.json rename web/app/mu-plugins/mitlib-post/data/{ => sitenews}/group_55096c358857e.json (100%) rename web/app/mu-plugins/mitlib-post/data/{ => sitenews}/group_55101c53c2d37.json (100%) create mode 100644 web/app/mu-plugins/mitlib-post/data/sitenews/group_55101c54091f3-1.json rename web/app/mu-plugins/mitlib-post/data/{ => sitenews}/group_55c25be764027.json (100%) rename web/app/mu-plugins/mitlib-post/data/{ => siteparent}/group_58e229318a751.json (100%) rename web/app/mu-plugins/mitlib-post/data/{ => siteparent}/group_58e22931f3f43.json (100%) rename web/app/mu-plugins/mitlib-post/data/{ => spotlight}/group_54dd062c086fd.json (100%) rename web/app/mu-plugins/mitlib-post/data/{ => spotlight}/group_54dd062c26afa.json (100%) rename web/app/mu-plugins/mitlib-post/data/{group_54dd062c31627.json => spotlight/group_54dd062c31627-2.json} (82%) rename web/app/mu-plugins/mitlib-post/data/{group_54dd062c453cb.json => spotlight/group_54dd062c453cb-2.json} (80%) create mode 100644 web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c84904-3.json create mode 100644 web/app/mu-plugins/mitlib-post/data/spotlight/group_55101c54091f3-3.json create mode 100644 web/app/plugins/mitlib-post-site-news/mitlib-post-site-news.php create mode 100644 web/app/plugins/mitlib-post-site-news/src/class-sitenews.php create mode 100644 web/app/plugins/mitlib-post-site-parent/mitlib-post-site-parent.php create mode 100644 web/app/plugins/mitlib-post-site-parent/src/class-siteparent.php diff --git a/.gitignore b/.gitignore index db05c093..1bbc9cb4 100644 --- a/.gitignore +++ b/.gitignore @@ -83,6 +83,8 @@ web/app/plugins/* !web/app/plugins/mitlib-post-exhibits !web/app/plugins/mitlib-post-experts !web/app/plugins/mitlib-post-locations +!web/app/plugins/mitlib-post-site-news +!web/app/plugins/mitlib-post-site-parent !web/app/plugins/mitlib-post-spotlights !web/app/plugins/mitlib-pull-events !web/app/plugins/mitlib-pull-hours diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c123b5-2.json similarity index 81% rename from web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json rename to web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c123b5-2.json index 7c36fd3e..66d4f4c5 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c123b5.json +++ b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c123b5-2.json @@ -1,6 +1,6 @@ { - "key": "group_54dd062c123b5", - "title": "Subtitle", + "key": "group_54dd062c123b5-2", + "title": "Subtitle (Bibliotech)", "fields": [ { "key": "field_54b54d9262fa8", @@ -26,13 +26,6 @@ } ], "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], [ { "param": "post_type", @@ -60,6 +53,6 @@ "send-trackbacks" ], "active": true, - "description": "News site: Add a subtitle to Post and Bibliotech records", + "description": "Add a subtitle to Bibliotech records", "show_in_rest": false } \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c4f33d.json b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c4f33d.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_54dd062c4f33d.json rename to web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c4f33d.json diff --git a/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c59653-2.json b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c59653-2.json new file mode 100644 index 00000000..e015b75a --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c59653-2.json @@ -0,0 +1,127 @@ +{ + "key": "group_54dd062c59653-2", + "title": "Surrogate images (Bibliotech)", + "fields": [ + { + "key": "field_549485f7cbb49", + "label": "Grid view long top image", + "name": "featuredListImg", + "type": "image_crop", + "instructions": "This image is for the homepage and should be the exact dimensions 662px width by 256px height", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "crop_type": "hard", + "target_size": "news-feature", + "width": "662px", + "height": "256px", + "preview_size": "full", + "force_crop": "yes", + "save_in_media_library": "yes", + "retina_mode": "no", + "save_format": "url", + "library": "all" + }, + { + "key": "field_549489d7cbb4b", + "label": "Libraries homepage image", + "name": "homeImg", + "type": "image_crop", + "instructions": "This image is for the homepage and should be the exact dimensions 113px width by 206px height", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "crop_type": "hard", + "target_size": "news-home", + "width": "", + "height": "", + "preview_size": "full", + "force_crop": "yes", + "save_in_media_library": "yes", + "retina_mode": "no", + "save_format": "url", + "library": "all" + }, + { + "key": "field_54cfa8ab5b6f2", + "label": "Grid view regular box image", + "name": "listImg", + "type": "image_crop", + "instructions": "This image is for the news homepage and should be the exact dimensions 323px width by 111px height", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "crop_type": "hard", + "target_size": "news-listing", + "width": "", + "height": "", + "preview_size": "full", + "force_crop": "yes", + "save_in_media_library": "yes", + "retina_mode": "no", + "save_format": "url", + "library": "all" + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + } + ], + [ + { + "param": "post_type", + "operator": "==", + "value": "bibliotech" + }, + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + } + ], + ], + "menu_order": 7, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "categories", + "tags", + "send-trackbacks" + ], + "active": true, + "description": "Add fields for specifically-sized images when Bibliotech records are promoted - visible only to admins and above", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c84904-2.json similarity index 54% rename from web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json rename to web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c84904-2.json index 412cac61..1a320975 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c84904.json +++ b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_54dd062c84904-2.json @@ -1,6 +1,6 @@ { - "key": "group_54dd062c84904", - "title": "Featured Article flag", + "key": "group_54dd062c84904-2", + "title": "Featured Article flag (Bibliotech)", "fields": [ { "key": "field_5474bef390af8", @@ -28,30 +28,6 @@ } ], "location": [ - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ], [ { "param": "current_user_role", @@ -64,30 +40,6 @@ "value": "bibliotech" } ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ], [ { "param": "current_user_role", @@ -108,6 +60,6 @@ "instruction_placement": "label", "hide_on_screen": "", "active": true, - "description": "News site: Add a flag to promote news site content (Posts, Bibliotech, Spotlights) to parent site front page - visible only to admins and above", + "description": "Add a flag to promote news site content (Bibliotech) to parent site front page - visible only to admins and above", "show_in_rest": false } diff --git a/web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_55101c54091f3-2.json similarity index 51% rename from web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json rename to web/app/mu-plugins/mitlib-post/data/bibliotech/group_55101c54091f3-2.json index fb79ad19..62b7e194 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_55101c54091f3.json +++ b/web/app/mu-plugins/mitlib-post/data/bibliotech/group_55101c54091f3-2.json @@ -1,6 +1,6 @@ { - "key": "group_55101c54091f3", - "title": "Homepage title", + "key": "group_55101c54091f3-2", + "title": "Homepage title (Bibliotech)", "fields": [ { "key": "field_53ecc2b9abf15", @@ -26,30 +26,6 @@ } ], "location": [ - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], [ { "param": "current_user_role", @@ -73,30 +49,6 @@ "operator": "==", "value": "bibliotech" } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - }, - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } - ], - [ - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - }, - { - "param": "post_type", - "operator": "==", - "value": "spotlights" - } ] ], "menu_order": 11, @@ -106,6 +58,6 @@ "instruction_placement": "label", "hide_on_screen": "", "active": true, - "description": "News site: Add a variation of the title field on Post, Spotlight, and Bibliotech records for use on the parent site homepage - visible only to admins and above", + "description": "Add a variation of the title field on Bibliotech records for use on the parent site homepage - visible only to admins and above", "show_in_rest": false } diff --git a/web/app/mu-plugins/mitlib-post/data/group_5668669a86e5c-2.json b/web/app/mu-plugins/mitlib-post/data/event/group_5668669a86e5c-2.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_5668669a86e5c-2.json rename to web/app/mu-plugins/mitlib-post/data/event/group_5668669a86e5c-2.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_566849b5bf143-2.json b/web/app/mu-plugins/mitlib-post/data/exhibit/group_566849b5bf143-2.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_566849b5bf143-2.json rename to web/app/mu-plugins/mitlib-post/data/exhibit/group_566849b5bf143-2.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_58e229319dfff.json b/web/app/mu-plugins/mitlib-post/data/expert/group_58e229319dfff.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_58e229319dfff.json rename to web/app/mu-plugins/mitlib-post/data/expert/group_58e229319dfff.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_58e22931ab9f5.json b/web/app/mu-plugins/mitlib-post/data/location/group_58e22931ab9f5.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_58e22931ab9f5.json rename to web/app/mu-plugins/mitlib-post/data/location/group_58e22931ab9f5.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062bee0d5.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062bee0d5.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_54dd062bee0d5.json rename to web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062bee0d5.json diff --git a/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c123b5-1.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c123b5-1.json new file mode 100644 index 00000000..9b5f64d1 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c123b5-1.json @@ -0,0 +1,58 @@ +{ + "key": "group_54dd062c123b5-1", + "title": "Subtitle (Post)", + "fields": [ + { + "key": "field_54b54d9262fa8", + "label": "Subtitle", + "name": "subtitle", + "type": "text", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "html", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ] + ], + "menu_order": 1, + "position": "acf_after_title", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "send-trackbacks" + ], + "active": true, + "description": "Add a subtitle to Post records", + "show_in_rest": false +} \ No newline at end of file diff --git a/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c31627-1.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c31627-1.json new file mode 100644 index 00000000..81605b45 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c31627-1.json @@ -0,0 +1,57 @@ +{ + "key": "group_54dd062c31627", + "title": "Urgency flag (Post)", + "fields": [ + { + "key": "field_543699593ef84", + "label": "Urgent", + "name": "urgent", + "type": "true_false", + "instructions": "", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "message": "This post is urgent.", + "default_value": 0, + "ui": 0, + "ui_on_text": "", + "ui_off_text": "" + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ] + ], + "menu_order": 3, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "permalink", + "excerpt", + "custom_fields", + "discussion", + "comments", + "revisions", + "slug", + "author", + "format", + "featured_image", + "categories", + "tags", + "send-trackbacks" + ], + "active": true, + "description": "Add a flag for urgent review to Post records", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c453cb-1.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c453cb-1.json new file mode 100644 index 00000000..38e18ac7 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c453cb-1.json @@ -0,0 +1,49 @@ +{ + "key": "group_54dd062c453cb-1", + "title": "Notes for admins (Post)", + "fields": [ + { + "key": "field_549476bac49d2", + "label": "Notes for editorial team", + "name": "notes", + "type": "textarea", + "instructions": "Please use this area to communicate with the editorial team. For news\/event posts - if you cannot find an image, let us know what you are looking for and we will try to help. Reminder, spotlights do not need images.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "maxlength": "", + "rows": "", + "new_lines": "br", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ] + ], + "menu_order": 5, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": [ + "the_content", + "excerpt", + "featured_image" + ], + "active": true, + "description": "Add a notes field for admin review to Post records", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c59653-1.json similarity index 82% rename from web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json rename to web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c59653-1.json index 7510daaa..12a35896 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c59653.json +++ b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c59653-1.json @@ -1,6 +1,6 @@ { - "key": "group_54dd062c59653", - "title": "Surrogate images", + "key": "group_54dd062c59653-1", + "title": "Surrogate images (Post)", "fields": [ { "key": "field_549485f7cbb49", @@ -88,30 +88,6 @@ "value": "super_admin" } ], - [ - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - }, - { - "param": "current_user_role", - "operator": "==", - "value": "super_admin" - } - ], - [ - { - "param": "post_type", - "operator": "==", - "value": "bibliotech" - }, - { - "param": "current_user_role", - "operator": "==", - "value": "administrator" - } - ], [ { "param": "post_type", @@ -146,6 +122,6 @@ "send-trackbacks" ], "active": true, - "description": "News site: Add fields for specifically-sized images when Post and Bibliotech records are promoted - visible only to admins and above", + "description": "News site: Add fields for specifically-sized images when Post records are promoted - visible only to admins and above", "show_in_rest": false } diff --git a/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c84904-1.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c84904-1.json new file mode 100644 index 00000000..71cd3bbf --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/sitenews/group_54dd062c84904-1.json @@ -0,0 +1,65 @@ +{ + "key": "group_54dd062c84904-1", + "title": "Featured Article flag (Post)", + "fields": [ + { + "key": "field_5474bef390af8", + "label": "Featured Article on News Page", + "name": "featuredArticle", + "type": "radio", + "instructions": "Should this be featured on the front page of the news?", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "choices": { + "false": "Should not display on homepage", + "True": "Feature on homepage" + }, + "other_choice": 0, + "save_other_choice": 0, + "default_value": "false : Should not display on homepage", + "layout": "vertical", + "allow_null": 0, + "return_format": "value" + } + ], + "location": [ + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ] + ], + "menu_order": 2000, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "Add a flag to promote news site content (Posts) to parent site front page - visible only to admins and above", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_55096c358857e.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_55096c358857e.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_55096c358857e.json rename to web/app/mu-plugins/mitlib-post/data/sitenews/group_55096c358857e.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_55101c53c2d37.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_55101c53c2d37.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_55101c53c2d37.json rename to web/app/mu-plugins/mitlib-post/data/sitenews/group_55101c53c2d37.json diff --git a/web/app/mu-plugins/mitlib-post/data/sitenews/group_55101c54091f3-1.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_55101c54091f3-1.json new file mode 100644 index 00000000..427a0f02 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/sitenews/group_55101c54091f3-1.json @@ -0,0 +1,63 @@ +{ + "key": "group_55101c54091f3-1", + "title": "Homepage title (Post)", + "fields": [ + { + "key": "field_53ecc2b9abf15", + "label": "Homepage post title", + "name": "homepage_post_title", + "type": "text", + "instructions": "Enter the title of the post as it should appear on the homepage.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "none", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "post" + } + ] + ], + "menu_order": 11, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "Add a variation of the title field on Post records for use on the parent site homepage - visible only to admins and above", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/group_55c25be764027.json b/web/app/mu-plugins/mitlib-post/data/sitenews/group_55c25be764027.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_55c25be764027.json rename to web/app/mu-plugins/mitlib-post/data/sitenews/group_55c25be764027.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_58e229318a751.json b/web/app/mu-plugins/mitlib-post/data/siteparent/group_58e229318a751.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_58e229318a751.json rename to web/app/mu-plugins/mitlib-post/data/siteparent/group_58e229318a751.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_58e22931f3f43.json b/web/app/mu-plugins/mitlib-post/data/siteparent/group_58e22931f3f43.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_58e22931f3f43.json rename to web/app/mu-plugins/mitlib-post/data/siteparent/group_58e22931f3f43.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c086fd.json b/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c086fd.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_54dd062c086fd.json rename to web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c086fd.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c26afa.json b/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c26afa.json similarity index 100% rename from web/app/mu-plugins/mitlib-post/data/group_54dd062c26afa.json rename to web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c26afa.json diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json b/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c31627-2.json similarity index 82% rename from web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json rename to web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c31627-2.json index 781a5ae7..7963e7f8 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c31627.json +++ b/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c31627-2.json @@ -1,6 +1,6 @@ { "key": "group_54dd062c31627", - "title": "Urgency flag", + "title": "Urgency flag (Spotlights)", "fields": [ { "key": "field_543699593ef84", @@ -23,13 +23,6 @@ } ], "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "post" - } - ], [ { "param": "post_type", @@ -59,6 +52,6 @@ "send-trackbacks" ], "active": true, - "description": "News site: Add a flag for urgent review to Post and Spotlight records", + "description": "Add a flag for urgent review to Spotlight records", "show_in_rest": false } diff --git a/web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json b/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c453cb-2.json similarity index 80% rename from web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json rename to web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c453cb-2.json index 364de29f..7c9d43ec 100644 --- a/web/app/mu-plugins/mitlib-post/data/group_54dd062c453cb.json +++ b/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c453cb-2.json @@ -1,6 +1,6 @@ { - "key": "group_54dd062c453cb", - "title": "Notes for admins", + "key": "group_54dd062c453cb-2", + "title": "Notes for admins (Spotlights)", "fields": [ { "key": "field_549476bac49d2", @@ -31,13 +31,6 @@ "operator": "==", "value": "spotlights" } - ], - [ - { - "param": "post_type", - "operator": "==", - "value": "post" - } ] ], "menu_order": 5, @@ -51,6 +44,6 @@ "featured_image" ], "active": true, - "description": "News site: Add a notes field for admin review to Post and Spotlight records", + "description": "Add a notes field for admin review to Spotlight records", "show_in_rest": false } diff --git a/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c84904-3.json b/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c84904-3.json new file mode 100644 index 00000000..e48f2100 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/spotlight/group_54dd062c84904-3.json @@ -0,0 +1,65 @@ +{ + "key": "group_54dd062c84904-3", + "title": "Featured Article flag (Spotlights)", + "fields": [ + { + "key": "field_5474bef390af8", + "label": "Featured Article on News Page", + "name": "featuredArticle", + "type": "radio", + "instructions": "Should this be featured on the front page of the news?", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "choices": { + "false": "Should not display on homepage", + "True": "Feature on homepage" + }, + "other_choice": 0, + "save_other_choice": 0, + "default_value": "false : Should not display on homepage", + "layout": "vertical", + "allow_null": 0, + "return_format": "value" + } + ], + "location": [ + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ] + ], + "menu_order": 2000, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "Add a flag to promote news site content (Spotlights) to parent site front page - visible only to admins and above", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/data/spotlight/group_55101c54091f3-3.json b/web/app/mu-plugins/mitlib-post/data/spotlight/group_55101c54091f3-3.json new file mode 100644 index 00000000..33026420 --- /dev/null +++ b/web/app/mu-plugins/mitlib-post/data/spotlight/group_55101c54091f3-3.json @@ -0,0 +1,63 @@ +{ + "key": "group_55101c54091f3-3", + "title": "Homepage title (Spotlights)", + "fields": [ + { + "key": "field_53ecc2b9abf15", + "label": "Homepage post title", + "name": "homepage_post_title", + "type": "text", + "instructions": "Enter the title of the post as it should appear on the homepage.", + "required": 0, + "conditional_logic": 0, + "wrapper": { + "width": "", + "class": "", + "id": "" + }, + "default_value": "", + "placeholder": "", + "prepend": "", + "append": "", + "formatting": "none", + "maxlength": "", + "readonly": 0, + "disabled": 0 + } + ], + "location": [ + [ + { + "param": "current_user_role", + "operator": "==", + "value": "super_admin" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ], + [ + { + "param": "current_user_role", + "operator": "==", + "value": "administrator" + }, + { + "param": "post_type", + "operator": "==", + "value": "spotlights" + } + ] + ], + "menu_order": 11, + "position": "normal", + "style": "seamless", + "label_placement": "top", + "instruction_placement": "label", + "hide_on_screen": "", + "active": true, + "description": "Add a variation of the title field on Spotlight records for use on the parent site homepage - visible only to admins and above", + "show_in_rest": false +} diff --git a/web/app/mu-plugins/mitlib-post/src/class-base.php b/web/app/mu-plugins/mitlib-post/src/class-base.php index 82437a4f..16c8dfb1 100644 --- a/web/app/mu-plugins/mitlib-post/src/class-base.php +++ b/web/app/mu-plugins/mitlib-post/src/class-base.php @@ -12,29 +12,53 @@ * Defines the Base class for custom post types. */ class Base { + + /** + * This determines the appropriate subfolder to load based on which child + * class is being called. + * + * For example, the Mitlib\PostTypes\Exhibit class would end up loading the + * files located in data\exhibit, while Mitlib\PostTypes\Location would load + * from data\location. + */ + public static function identify_subfolder() { + $class = get_called_class(); + $arr_class = explode( '\\', $class ); + $last_class = end( $arr_class ); + return strtolower( $last_class ); + } + /** - * Called during acf/settings/load_json + * Called during acf/settings/load_json. This attempts to load field groups + * defined within a subfolder named after the class name which called this + * method. * * @param Array $paths An array of paths where JSON files describing field * information can be loaded. */ public static function load_point( $paths ) { + // Identify, from context, which subfolder needs to be loaded. + $subfolder = self::identify_subfolder(); + // Remove any previously-set paths (could be removed). unset( $paths[0] ); - // Append the desired location to the array. - $paths[] = plugin_dir_path( __FILE__ ) . '../data'; + // Append the desired location to the array of searched paths. + $paths[] = plugin_dir_path( __FILE__ ) . "../data/{$subfolder}"; // Return the array. return $paths; } /** - * Called during acf?settings/save_json + * Called during acf/settings/save_json * * @param String $path A local path where field information will be saved. */ public static function save_point( $path ) { - return plugin_dir_path( __FILE__ ) . '../data'; + // Identify, from context, which subfolder needs to be loaded. + $subfolder = self::identify_subfolder(); + + return plugin_dir_path( __FILE__ ) . "../data/{$subfolder}"; } } diff --git a/web/app/plugins/mitlib-post-site-news/mitlib-post-site-news.php b/web/app/plugins/mitlib-post-site-news/mitlib-post-site-news.php new file mode 100644 index 00000000..16c8a012 --- /dev/null +++ b/web/app/plugins/mitlib-post-site-news/mitlib-post-site-news.php @@ -0,0 +1,25 @@ +