Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds new global sections content types #680

Closed

Conversation

eduardoformiga
Copy link
Member

What's the purpose of this pull request?

Applies changes from

Faststore related PRs

@eduardoformiga eduardoformiga requested a review from a team as a code owner February 3, 2025 23:15
Copy link

vercel bot commented Feb 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
starter ✅ Ready (Inspect) Visit Preview Feb 26, 2025 4:20pm

eduardoformiga added a commit to vtex/faststore that referenced this pull request Feb 26, 2025
🎗️ delete both content types in storeframework account after PR got
merged.
🎗️ sync FS + hCMS in vtex account.

## What's the purpose of this pull request?

This pull request handles multiple global content types. Now the global
sections are expected to have:
`globalHeaderSections` and `globalFooterSections`.

## How it works?

Added `globalHeaderSections` and `globalFooterSections`
`globalHeaderSections` - injected before the Children section from
`globalSections` content type.
`globalHeaderFooter` - injected after the Children section from
`globalSections` content type.

All the pages now are fetching these content types if they exist and
merging all global sections.

## How to test it?

with the version of this PR in the starter: 

1. login in your account `vtex switch <account>`
2. if the account didn't have the `globalHeaderSections` and
`globalFooterSections` content types, sync the hCMS with the command:
`yarn cms-sync`. you can use the dry option `yarn cms-sync -d` (just for
tests before really sync).
3. in the hCMS, add the 2 new documents with sections using the new
content types `globalHeaderSections` and `globalFooterSections`.
4. make sure the sections are shown in the expected places:
`globalHeaderSections` before the Children and `globalFooterSections`
after the children.

hCMS
<img width="400" alt="Screenshot 2025-02-04 at 12 42 17"
src="https://github.com/user-attachments/assets/b30dc7cb-f507-4109-8065-7bb5c5d6aac3"
/>

| globalHeaderSections | globalFooterSections |
|--------|--------|
| <img width="1234" alt="Screenshot 2025-02-04 at 12 18 01"
src="https://github.com/user-attachments/assets/fc9bfae8-0f7d-4a1b-aae8-5293a4007518"
/> | <img width="1241" alt="Screenshot 2025-02-04 at 12 18 14"
src="https://github.com/user-attachments/assets/1c1f5a5b-9689-4667-ae12-2c8732521b59"
/> |

### Starters Deploy Preview

- vtex-sites/starter.store#680

you can check the section in this preview
https://storeframework-cm652ufll028lmgv665a6xv0g-isf4taa08.b.vtex.app/

## References

https://vtex.slack.com/archives/C02JMH9AYR1/p1738007781146059

---------

Co-authored-by: Larícia Mota <laricia.mota@vtex.com.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant