[x] Ensure you see Call To Actions and CTA Regions in the menu. If you don't, go to Plugins and Deactivate the TW Call To Actions (CTA's) plugin. Also try viewing your user's capabilities and refreshing a couple times.
[x] Go to Call To Actions and click Add New.
[x] Set up any type of CTA you want, ensuring the relevant fields are provided for the type you are creating. Publish it when ready. (Do multiple if you like.)
[x] Go to CTA Regions. and click Add New
[x] Title the region "Site Banner" and add your Call To Action posts to it.
[x] Set the CTA Region Type to "Site".
[x] Add a helpful description for the region in the Excerpt field.
fragment CtaRegionProps on CtaRegion {
id
title
slug
ctaRegionContent {
callToActions {
... CtaProps
}
}
}
fragment CtaProps on CallToAction {
ctaOptions {
ctaType
content {
heading
message
}
actions {
actionButtonLabel
actionButtonUrl
dismissButtonLabel
}
optInSettings {
optInText
}
newsletterSettings {
newsletter {
... on Newsletter {
id
title
newsletterOptions {
buttonLabel
listId
optInText
}
}
}
}
}
ctaSettings {
cookieLifespan
}
ctaTargeting {
targetCategories {
id
name
}
targetPrograms {
id
name
}
targetContent {
... on Post {
id
title
}
... on Episode {
id
title
}
}
}
}
- [x] Run the query.
- [x] Ensure the data for CTA's you added is retrieved. The query should first list the first 10 CTA's, then the CTA's in the `site-banner` region, then the regions tagged as the `site` type and it's CTA's .
- [x] Edit a term in each major taxonomy other than _CTA Region Types_ and ensure the **Landing Page** and **Taxonomy Images** field groups are shown.
Closes #10
To Review
npm run local
(ornpm run refresh
if you want a fresh database.)fragment CtaRegionProps on CtaRegion { id title slug ctaRegionContent { callToActions { ... CtaProps } } }
fragment CtaProps on CallToAction { ctaOptions { ctaType content { heading message } actions { actionButtonLabel actionButtonUrl dismissButtonLabel } optInSettings { optInText } newsletterSettings { newsletter { ... on Newsletter { id title newsletterOptions { buttonLabel listId optInText } } } } } ctaSettings { cookieLifespan } ctaTargeting { targetCategories { id name } targetPrograms { id name } targetContent { ... on Post { id title } ... on Episode { id title } } } }