From 94fddf9ad0f9d384875e8eca8e63e2aae0f083b1 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Thu, 7 Nov 2024 08:15:17 -0800 Subject: [PATCH 1/4] D8CORE-7194 Embed codes with captions respect 100% widths on iframes --- themes/stanford_basic/dist/js/behaviors.js | 10 ++++++++++ .../stanford_basic/src/js/stanford_basic.behavior.js | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/themes/stanford_basic/dist/js/behaviors.js b/themes/stanford_basic/dist/js/behaviors.js index b92b171f..a9752c21 100644 --- a/themes/stanford_basic/dist/js/behaviors.js +++ b/themes/stanford_basic/dist/js/behaviors.js @@ -51,6 +51,16 @@ window.Drupal.behaviors.stanford_basic = { // Attach Drupal Behavior. attach: function attach(context, settings) { (function ($, once) { + // If some embed code contains a caption, make sure the figure respects + // the iframe width of 100%. + $('figure', context).each(function () { + var $iframeWithin = $('iframe', this); + var iframeWidth = $iframeWithin.attr('width'); + if ($iframeWithin.length && (!iframeWidth || iframeWidth === '100%')) { + $(this).css('width', '100%'); + } + }); + // Validate there is a skip link anchor for the main content. If not, // default to #page-content. var $title = $('h1', context); diff --git a/themes/stanford_basic/src/js/stanford_basic.behavior.js b/themes/stanford_basic/src/js/stanford_basic.behavior.js index d63737ee..cefd0e98 100644 --- a/themes/stanford_basic/src/js/stanford_basic.behavior.js +++ b/themes/stanford_basic/src/js/stanford_basic.behavior.js @@ -12,6 +12,17 @@ export default { // Attach Drupal Behavior. attach(context, settings) { (function ($, once) { + + // If some embed code contains a caption, make sure the figure respects + // the iframe width of 100%. + $('figure', context).each(function() { + const $iframeWithin = $('iframe', this); + const iframeWidth = $iframeWithin.attr('width'); + if ($iframeWithin.length && (!iframeWidth || iframeWidth === '100%')) { + $(this).css('width', '100%'); + } + }) + // Validate there is a skip link anchor for the main content. If not, // default to #page-content. const $title = $('h1', context); From 7ab757b16607374761d061647b1d451d6d75a5af Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Thu, 7 Nov 2024 10:20:31 -0800 Subject: [PATCH 2/4] Exposed opportunity in graphql --- config/sync/graphql_compose.settings.yml | 56 +++++++++++++++++-- .../sync/node.type.stanford_opportunity.yml | 17 +++++- 2 files changed, 66 insertions(+), 7 deletions(-) diff --git a/config/sync/graphql_compose.settings.yml b/config/sync/graphql_compose.settings.yml index d887cd63..6205b6c2 100644 --- a/config/sync/graphql_compose.settings.yml +++ b/config/sync/graphql_compose.settings.yml @@ -193,7 +193,10 @@ entity_config: edges_enabled: true routes_enabled: true stanford_opportunity: - enabled: false + enabled: true + query_load_enabled: true + edges_enabled: true + routes_enabled: true stanford_page: enabled: true query_load_enabled: true @@ -277,11 +280,11 @@ entity_config: media_tags: enabled: false opportunity_sponsor: - enabled: false + enabled: true opportunity_tag_filters: - enabled: false + enabled: true opportunity_type: - enabled: false + enabled: true site_owner_orgs: enabled: false stanford_event_groups: @@ -658,6 +661,51 @@ field_config: enabled: true su_news_topics: enabled: true + stanford_opportunity: + body: + enabled: true + layout_builder__layout: + enabled: true + su_opp_application_deadline: + enabled: true + su_opp_components: + enabled: true + su_opp_contact_email: + enabled: true + su_opp_contact_name: + enabled: true + su_opp_contact_phone: + enabled: true + su_opp_contact_url: + enabled: true + su_opp_course_code: + enabled: true + su_opp_cta_url: + enabled: true + su_opp_eligibility: + enabled: true + su_opp_image: + enabled: true + su_opp_learn_more: + enabled: true + su_opp_open_date: + enabled: true + su_opp_prerequisites: + enabled: true + su_opp_source: + enabled: true + su_opp_sponsor: + enabled: true + su_opp_start_date: + enabled: true + su_opp_status: + enabled: true + su_opp_summary: + enabled: true + su_opp_tags: + enabled: true + su_opp_type: + enabled: true stanford_page: layout_selection: enabled: true diff --git a/config/sync/node.type.stanford_opportunity.yml b/config/sync/node.type.stanford_opportunity.yml index 34806b8a..ed4c3f7b 100644 --- a/config/sync/node.type.stanford_opportunity.yml +++ b/config/sync/node.type.stanford_opportunity.yml @@ -8,14 +8,25 @@ dependencies: - scheduler third_party_settings: menu_ui: - available_menus: - - main - parent: 'main:' + available_menus: { } + parent: '' node_revision_delete: amount: status: true settings: amount: 5 + created: + status: false + settings: + age: 1 + drafts: + status: false + settings: + age: 1 + only_drafts: + status: false + settings: + age: 0 scheduler: expand_fieldset: when_required fields_display_mode: vertical_tab From c6d449566c1ce851bf22abe7a31882eb032d33a1 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Thu, 7 Nov 2024 10:57:21 -0800 Subject: [PATCH 3/4] Updated metatag module config --- config/sync/metatag.settings.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/sync/metatag.settings.yml b/config/sync/metatag.settings.yml index 436880dd..f3fd7f0f 100644 --- a/config/sync/metatag.settings.yml +++ b/config/sync/metatag.settings.yml @@ -12,3 +12,4 @@ tag_trim_maxlength: metatag_maxlength_twitter_cards_label2: null metatag_maxlength_twitter_cards_title: null tag_scroll_max_height: '' +tag_trim_end: '|.,-:;/+&([{"''' From 1d0e25b0c3840c566ffc2d0d69b8092d7e2174e6 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Fri, 8 Nov 2024 09:41:51 -0800 Subject: [PATCH 4/4] Updated metadata image sizes --- config/sync/metatag.metatag_defaults.front.yml | 6 +++--- config/sync/metatag.metatag_defaults.node.yml | 6 +++--- .../sync/metatag.metatag_defaults.node__stanford_news.yml | 8 ++++---- .../metatag.metatag_defaults.node__stanford_person.yml | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config/sync/metatag.metatag_defaults.front.yml b/config/sync/metatag.metatag_defaults.front.yml index 215d9de3..ad66f40b 100644 --- a/config/sync/metatag.metatag_defaults.front.yml +++ b/config/sync/metatag.metatag_defaults.front.yml @@ -9,9 +9,9 @@ label: 'Front page' tags: canonical_url: '[site:url]' description: '[node:su_page_description|node:summary]' - og_image: '[node:su_page_image:entity:field_media_image:large|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:large]' + og_image: '[node:su_page_image:entity:field_media_image:card_1192x596|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:card_1192x596]' og_image_alt: '[node:su_page_image:entity:field_media_image:alt|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:alt]' - og_image_url: '[node:su_page_image:entity:field_media_image:large|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:large]' + og_image_url: '[node:su_page_image:entity:field_media_image:card_1192x596|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:card_1192x596]' og_site_name: '[site:name]' og_title: '[site:name]' og_type: website @@ -19,7 +19,7 @@ tags: shortlink: '[site:url]' title: '[site:name]' twitter_cards_description: '[node:su_page_description|node:summary]' - twitter_cards_image: '[node:su_page_image:entity:field_media_image:large|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:large]' + twitter_cards_image: '[node:su_page_image:entity:field_media_image:card_1192x596|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:card_1192x596]' twitter_cards_image_alt: '[node:su_page_image:entity:field_media_image:alt|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:alt]' twitter_cards_title: '[site:name]' twitter_cards_type: summary_large_image diff --git a/config/sync/metatag.metatag_defaults.node.yml b/config/sync/metatag.metatag_defaults.node.yml index 76e86249..823d9f1e 100644 --- a/config/sync/metatag.metatag_defaults.node.yml +++ b/config/sync/metatag.metatag_defaults.node.yml @@ -9,16 +9,16 @@ label: Content tags: canonical_url: '[node:url]' description: '[node:su_page_description|node:summary]' - og_image: '[node:su_page_image:entity:field_media_image:large|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:large]' + og_image: '[node:su_page_image:entity:field_media_image:card_1192x596|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:card_1192x596]' og_image_alt: '[node:su_page_image:entity:field_media_image:alt|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:alt]' - og_image_url: '[node:su_page_image:entity:field_media_image:large|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:large]' + og_image_url: '[node:su_page_image:entity:field_media_image:card_1192x596|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:card_1192x596]' og_site_name: '[site:name]' og_title: '[node:title]' og_type: website og_url: '[current-page:url:absolute]' title: '[node:title] | [site:name]' twitter_cards_description: '[node:su_page_description|node:summary]' - twitter_cards_image: '[node:su_page_image:entity:field_media_image:large|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:large]' + twitter_cards_image: '[node:su_page_image:entity:field_media_image:card_1192x596|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:card_1192x596]' twitter_cards_image_alt: '[node:su_page_image:entity:field_media_image:alt|node:su_page_banner:entity:su_banner_image:0:entity:field_media_image:alt]' twitter_cards_title: '[node:title]' twitter_cards_type: summary_large_image diff --git a/config/sync/metatag.metatag_defaults.node__stanford_news.yml b/config/sync/metatag.metatag_defaults.node__stanford_news.yml index 57be2f65..6afec1e8 100644 --- a/config/sync/metatag.metatag_defaults.node__stanford_news.yml +++ b/config/sync/metatag.metatag_defaults.node__stanford_news.yml @@ -9,13 +9,13 @@ tags: article_tag: '[node:su_news_topics]' canonical_url: '[node:su_news_source:uri]' description: '[node:su_news_dek|node:su_news_byline]' - image_src: '[node:su_news_featured_media:entity:field_media_image:large|node:su_news_banner:entity:field_media_image:large]' - og_image: '[node:su_news_featured_media:entity:field_media_image:large|node:su_news_banner:entity:field_media_image:large]' + image_src: '[node:su_news_featured_media:entity:field_media_image:card_1192x596|node:su_news_banner:entity:field_media_image:card_1192x596]' + og_image: '[node:su_news_featured_media:entity:field_media_image:card_1192x596|node:su_news_banner:entity:field_media_image:card_1192x596]' og_image_alt: '[node:su_news_featured_media:entity:field_media_image:alt|node:su_news_banner:entity:field_media_image:alt]' - og_image_url: '[node:su_news_featured_media:entity:field_media_image:large|node:su_news_banner:entity:field_media_image:large]' + og_image_url: '[node:su_news_featured_media:entity:field_media_image:card_1192x596|node:su_news_banner:entity:field_media_image:card_1192x596]' og_type: article twitter_cards_description: '[node:su_news_dek|node:su_news_byline|node:summary]' - twitter_cards_image: '[node:su_news_featured_media:entity:field_media_image:large|node:su_news_banner:entity:field_media_image:large]' + twitter_cards_image: '[node:su_news_featured_media:entity:field_media_image:card_1192x596|node:su_news_banner:entity:field_media_image:card_1192x596]' twitter_cards_image_alt: '[node:su_news_featured_media:entity:field_media_image:alt|node:su_news_banner:entity:field_media_image:alt]' twitter_cards_title: '[node:title]' twitter_cards_type: summary_large_image diff --git a/config/sync/metatag.metatag_defaults.node__stanford_person.yml b/config/sync/metatag.metatag_defaults.node__stanford_person.yml index 53a5bdcc..6d85957c 100644 --- a/config/sync/metatag.metatag_defaults.node__stanford_person.yml +++ b/config/sync/metatag.metatag_defaults.node__stanford_person.yml @@ -7,18 +7,18 @@ label: 'Content: Person' tags: canonical_url: '[node:su_person_profile_link:uri]' description: '[node:su_person_full_title|node:su_person_short_title|node:summary]' - image_src: '[node:su_person_photo:entity:field_media_image:large]' + image_src: '[node:su_person_photo:entity:field_media_image:card_1192x596]' keywords: '[node:su_person_type]' og_description: '[node:su_person_full_title|node:su_person_short_title]' - og_image: '[node:su_person_photo:entity:field_media_image:large]' + og_image: '[node:su_person_photo:entity:field_media_image:card_1192x596]' og_image_alt: '[node:su_person_photo:entity:field_media_image:alt|node:title]' - og_image_url: '[node:su_person_photo:entity:field_media_image:large]' + og_image_url: '[node:su_person_photo:entity:field_media_image:card_1192x596]' og_type: profile profile_first_name: '[node:su_person_first_name]' profile_last_name: '[node:su_person_last_name]' title: '[node:title] | [site:name]' twitter_cards_description: '[node:su_person_full_title|node:su_person_short_title|node:summary]' - twitter_cards_image: '[node:su_person_photo:entity:field_media_image:large]' + twitter_cards_image: '[node:su_person_photo:entity:field_media_image:card_1192x596]' twitter_cards_image_alt: '[node:su_person_photo:entity:field_media_image:alt]' twitter_cards_title: '[node:title]' twitter_cards_type: summary_large_image