Skip to content

Commit

Permalink
feat(@dpc-sdp/ripple-tide-search): ✨ use content managed page features
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingallday committed Jul 19, 2023
1 parent b5d57d7 commit a597880
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions packages/ripple-tide-search/components/TideSearchListingPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ const { data: site } = useFetch('/api/tide/site', {
}
})
const { data: contentPage } = useFetch('/api/tide/page', {
baseURL: config.API_URL || '',
params: {
path: route.path
}
})
const {
isBusy,
searchError,
Expand Down Expand Up @@ -177,12 +184,24 @@ const handlePageChange = (newPage: number) => {
</script>

<template>
<TideBaseLayout :site="site">
<template #aboveBody>
<TideBaseLayout
:site="site"
:page="contentPage"
:siteSection="contentPage.siteSection"
:background="contentPage.background"
:pageTitle="contentPage.title"
:pageLanguage="contentPage.lang"
:updatedDate="contentPage.changed || contentPage.created"
:showContentRating="contentPage.showContentRating"
>
<template #breadcrumbs>
<slot name="breadcrumbs"></slot>
</template>
<template #aboveBody="{ hasBreadcrumbs }">
<RplHeroHeader
:title="title"
:behind-nav="true"
:breadcrumbs="true"
:breadcrumbs="hasBreadcrumbs"
:full-width="true"
:corner-top="true"
:corner-bottom="false"
Expand Down Expand Up @@ -258,9 +277,9 @@ const handlePageChange = (newPage: number) => {

<slot name="results" :results="results">
<component
:is="resultsLayout.component"
v-if="results && results.length > 0"
:key="`TideSearchListingResultsLayout${resultsLayout.component}`"
:is="resultsLayout.component"
v-bind="resultsLayout.props"
:results="results"
/>
Expand Down

0 comments on commit a597880

Please sign in to comment.