Skip to content

Commit 8d1a2d2

Browse files
committed
component and gql updates
1 parent 8069d0d commit 8d1a2d2

File tree

2 files changed

+30
-39
lines changed

2 files changed

+30
-39
lines changed

gql/queries/FTVAGeneralContentDetail.gql

+3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33

44
query FTVAGeneralContent {
55
entry(section: "ftvaGeneralContentPage") {
6+
id
7+
uri
68
title
79
formattedTitle
10+
text: ftvaHomepageDescription
811
imageCarousel {
912
...on imageCarousel_imageCarousel_BlockType {
1013
image {

pages/[...slug].vue

+27-39
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// TODO: remove when we have implemented component library as a module
44
// https://nuxt.com/docs/guide/directory-structure/components#library-authors
55
import {
6-
TwoColLayoutWStickySideBar, NavBreadcrumb, ResponsiveImage, RichText, PageAnchor, FlexibleBlocks, SectionWrapper,
6+
TwoColLayoutWStickySideBar, NavBreadcrumb, ResponsiveImage, CardMeta, RichText, PageAnchor, FlexibleBlocks, SectionWrapper,
77
} from 'ucla-library-website-components'
88
99
import { onMounted } from 'vue'
@@ -73,12 +73,11 @@ const parseParentTitle = computed(() => {
7373
return 'Home'
7474
})
7575
76-
const parsedButtonText = computed(() => {
77-
return _get(page.value, 'button[0].buttonText', '')
78-
})
79-
80-
const parsedButtonTo = computed(() => {
81-
return _get(page.value, 'button[0].buttonUrl', '')
76+
const parseTitle = computed(() => {
77+
if (page.value.formattedTitle)
78+
return page.value.formattedTitle
79+
else
80+
return page.value.title
8281
})
8382
8483
onMounted(() => {
@@ -100,44 +99,33 @@ onMounted(() => {
10099
:parent-title="parseParentTitle"
101100
/>
102101

103-
<banner-text
104-
v-if="page && (!page.heroImage || page.heroImage.length == 0)"
105-
class="banner-text"
106-
:category="page.format"
107-
:title="page.title"
108-
:text="page.summary"
109-
:button-text="parsedButtonText"
110-
:to="parsedButtonTo"
111-
/>
112-
113-
<section-wrapper class="section-banner">
114-
<code>{{ page }}</code>
115-
JEN JEN JEN
116-
<banner-header
117-
v-if="page && page.heroImage && page.heroImage.length == 1"
118-
:media="page.heroImage[0].image[0]"
119-
:category="page.format"
120-
:title="page.title"
121-
:text="page.summary"
122-
:to="parsedButtonTo"
123-
:prompt="parsedButtonText"
124-
/>
125-
</section-wrapper>
126-
127-
<section-wrapper theme="divider">
128-
<divider-way-finder class="divider-way-finder" />
129-
</section-wrapper>
102+
<TwoColLayoutWStickySideBar>
103+
<template #primaryTop>
104+
<CardMeta
105+
data-test="text-block"
106+
category="Scategory"
107+
:title="parseTitle"
108+
>
109+
<template #customDescription>
110+
<rich-text :rich-text-content="page.text" />
111+
</template>
112+
</CardMeta>
113+
114+
<DividerWayFinder class="remove-top-margin" />
115+
116+
<FlexibleBlocks
117+
class="flexible-content"
118+
:blocks="page.blocks"
119+
/>
120+
</template>
121+
<template #sidebarTop />
122+
</TwoColLayoutWStickySideBar>
130123

131124
<page-anchor
132125
v-if="h2Array.length >= 3"
133126
:section-titles="h2Array"
134127
/>
135128

136-
<flexible-blocks
137-
v-if="page"
138-
class="flexible-content"
139-
:blocks="page.blocks"
140-
/>
141129
</main>
142130
</template>
143131

0 commit comments

Comments
 (0)