diff --git a/apps/vue-storybook/.storybook/preview.ts b/apps/vue-storybook/.storybook/preview.ts index fc205dde..211a9f7b 100644 --- a/apps/vue-storybook/.storybook/preview.ts +++ b/apps/vue-storybook/.storybook/preview.ts @@ -190,7 +190,23 @@ const preview: Preview = { 'Mixins', ['Overview'], 'Templates', - ['WWW', 'EDU', 'PageContent'] + [ + 'WWW', + 'EDU', + [ + 'PageContent', + 'PageEduNewsDetail', + 'PageEduEventDetail', + 'PageEduCollectionsDetail', + 'PageEduExplainerArticle', + 'PageEduLesson', + 'PageEduStudentProject', + 'PageEduTeachableMoment', + 'PageEduMultimediaDetail', + '*' + ], + 'PageContent' + ] ] } } diff --git a/packages/vue/src/components/HeroMedia/HeroMedia.vue b/packages/vue/src/components/HeroMedia/HeroMedia.vue index a3f274a0..f4451fbb 100644 --- a/packages/vue/src/components/HeroMedia/HeroMedia.vue +++ b/packages/vue/src/components/HeroMedia/HeroMedia.vue @@ -109,7 +109,7 @@ export default defineComponent({ computed: { ...mapStores(useThemeStore), theImageCaption(): string | undefined { - if (this.image && this.caption && this.caption.length > 2 && this.displayCaption) { + if (this.displayCaption && this.image && this.caption && this.caption.length > 2) { return this.caption } else if ( this.image && @@ -135,10 +135,12 @@ export default defineComponent({ }, // to handle captions for videos customCaption(): Partial | undefined { - if ((this.caption && this.caption.length > 2) || this.credit) { - return { - caption: this.caption, - credit: this.credit + if (this.displayCaption) { + if ((this.caption && this.caption.length > 2) || this.credit) { + return { + caption: this.caption, + credit: this.credit + } } } return undefined diff --git a/packages/vue/src/interfaces.ts b/packages/vue/src/interfaces.ts index 7fc3cdaa..e7416ad0 100644 --- a/packages/vue/src/interfaces.ts +++ b/packages/vue/src/interfaces.ts @@ -38,6 +38,7 @@ export interface StreamfieldBlockData extends BlockData { caption?: string credit?: string imageInline?: ImageObject + heroSummary?: string } export interface ImageSrcObject { diff --git a/packages/vue/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.stories.js b/packages/vue/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.stories.js index 3dd4359d..7deb8908 100644 --- a/packages/vue/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.stories.js +++ b/packages/vue/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.stories.js @@ -109,6 +109,22 @@ export const BaseStory = { } } } + +export const HeroTitle = { + args: { + data: { + ...BaseStory.args.data, + hero: [ + { + ...HeroMediaData, + heroSummary: 'Text appears below the title', + blockType: 'HeroTitleBlock' + } + ] + } + } +} + export const InlineHero = { args: { data: { diff --git a/packages/vue/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.vue b/packages/vue/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.vue index e46964d2..92013269 100644 --- a/packages/vue/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.vue +++ b/packages/vue/src/templates/edu/PageEduExplainerArticle/PageEduExplainerArticle.vue @@ -1,6 +1,7 @@