Skip to content

feat: make ScrollToTopButton text editable via hCMS - #3103

Merged
lemagnetic merged 1 commit into
feat/multilanguagefrom
chore/scrollto-top-button-text-cms
Nov 12, 2025
Merged

lemagnetic merged 1 commit into
feat/multilanguagefrom
chore/scrollto-top-button-text-cms

Conversation

@lemagnetic

@lemagnetic lemagnetic commented Nov 5, 2025 •

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

Make ScrollToTopButton text editable through hCMS by converting it from a hardcoded component to a CMS-managed section.

⚠️ Breaking Change: The ScrollToTopButton has been removed from the PLP template and must now be manually added via hCMS to PLPs.

Print PLP without ScrollToTopButton hardcoded and no setup in hCMS
image

How it works?

Removed hardcoded ScrollToTopButton from ProductListing. It is now rendered dynamically via hCMS with configurable text and icon position.

CMS
Captura de Tela 2025-11-06 às 15 26 49

Captura de Tela 2025-11-06 às 15 27 11 Captura de Tela 2025-11-06 às 16 20 41

How to test it?

In a Search page or PLP, observe the Scroll to Top Button. It should have the text and icon position configured through the Headless CMS.

References

Jira task

@lemagnetic lemagnetic added the enhancement New feature or request label Nov 5, 2025
@codesandbox-ci

codesandbox-ci Bot commented Nov 5, 2025

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@lemagnetic lemagnetic changed the title chore: sections.json add new section ScrollToTopButton feat: make ScrollToTopButton text editable via hCMS Nov 6, 2025
@lemagnetic
lemagnetic marked this pull request as ready for review November 6, 2025 14:05
@lemagnetic
lemagnetic requested a review from a team as a code owner November 6, 2025 14:05
@lemagnetic
lemagnetic requested review from lariciamota and lucasfp13 and removed request for a team November 6, 2025 14:05

@lariciamota lariciamota left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Screenshot 2025-11-11 at 10 07 35

@lemagnetic
lemagnetic merged commit a80407c into feat/multilanguage Nov 12, 2025
@lemagnetic
lemagnetic deleted the chore/scrollto-top-button-text-cms branch November 12, 2025 22:26
lemagnetic added a commit that referenced this pull request Nov 20, 2025
## What's the purpose of this pull request?

Make `ScrollToTopButton` text editable through hCMS by converting it
from a hardcoded component to a CMS-managed section.

**⚠️ Breaking Change**: The `ScrollToTopButton` has been removed from
the PLP template and must now be manually added via hCMS to PLPs.

Print PLP without ScrollToTopButton hardcoded and no setup in hCMS
<img width="1800" height="1014" alt="image"
src="https://github.com/user-attachments/assets/b547a62a-a2d1-4097-abb1-4b86a6e63f01"
/>

## How it works?

Removed hardcoded `ScrollToTopButton` from `ProductListing`. It is now
rendered dynamically via hCMS with configurable text and icon position.

CMS
<img width="680" height="281" alt="Captura de Tela 2025-11-06 às 15 26
49"
src="https://github.com/user-attachments/assets/9b64fe77-d207-4013-b5bf-a5a5305029da"
/>

<img width="1298" height="374" alt="Captura de Tela 2025-11-06 às 15 27
11"
src="https://github.com/user-attachments/assets/20e74ee9-061a-4450-94e7-176b0c0e0425"
/>
<img width="1344" height="511" alt="Captura de Tela 2025-11-06 às 16 20
41"
src="https://github.com/user-attachments/assets/1fc2ccdc-805d-4ee6-8aea-84616aefc159"
/>



## How to test it?

In a Search page or PLP, observe the Scroll to Top Button. It should
have the text and icon position configured through the Headless CMS.


## References

[Jira
task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2916)
lariciamota pushed a commit that referenced this pull request Nov 25, 2025
## What's the purpose of this pull request?

Make `ScrollToTopButton` text editable through hCMS by converting it
from a hardcoded component to a CMS-managed section.

**⚠️ Breaking Change**: The `ScrollToTopButton` has been removed from
the PLP template and must now be manually added via hCMS to PLPs.

Print PLP without ScrollToTopButton hardcoded and no setup in hCMS
<img width="1800" height="1014" alt="image"
src="https://github.com/user-attachments/assets/b547a62a-a2d1-4097-abb1-4b86a6e63f01"
/>

## How it works?

Removed hardcoded `ScrollToTopButton` from `ProductListing`. It is now
rendered dynamically via hCMS with configurable text and icon position.

CMS
<img width="680" height="281" alt="Captura de Tela 2025-11-06 às 15 26
49"
src="https://github.com/user-attachments/assets/9b64fe77-d207-4013-b5bf-a5a5305029da"
/>

<img width="1298" height="374" alt="Captura de Tela 2025-11-06 às 15 27
11"
src="https://github.com/user-attachments/assets/20e74ee9-061a-4450-94e7-176b0c0e0425"
/>
<img width="1344" height="511" alt="Captura de Tela 2025-11-06 às 16 20
41"
src="https://github.com/user-attachments/assets/1fc2ccdc-805d-4ee6-8aea-84616aefc159"
/>



## How to test it?

In a Search page or PLP, observe the Scroll to Top Button. It should
have the text and icon position configured through the Headless CMS.


## References

[Jira
task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2916)
lemagnetic added a commit that referenced this pull request Mar 5, 2026
## What's the purpose of this pull request?

Removing hardcoded labels:
- #3099
- #3102 
- #3107 
- #3104 
- #3103 
- #3125
- #3131
- #3116
- #3142
- #3192

Setting Up locales
- #3141
- #3143
- #3147
- #3156
- #3162
- #3145
- #3164
- #3169
- #3171
- #3176
- #3180
- #3169
 custom path
- #3185
- #3162
- #3156
- #3170

Components
- #3093
- #3175

Fetching content 

- #3165

Others
- #3176
- #3171
- #3181
- #3189
- #3205


## How to test locally?
- Run `pnpm I` (install all the new dependencies and needed packages)
- If you want to try localization feature, go
to`/discovery.config.default.js`:
Enable localization:
```
localization: {
  enabled: true
}
```
- Run `node packages/cli/bin/run.js generate-i18n ./packages/core` to
fetch the bindings

If the contentSource is not set to content platform yet, you will see a
message to update to it.
>   contentSource: {
>     type: 'CP',
>   },

⚠️ Note: Ensure the url is set to localhost for local testing. These
locale bindings are generated in `discovery.config` after running the
generate-i18n command.

```diff
localization: {
  enabled: true,
  defaultLocale: 'en-US',
   regions: {...},
    locales: {
      'pt-BR': {
           ...
        bindings: [
          {
            currencyCode: 'BRL',
-           url: 'https://brandless.fast.store/pt-BR',
+           url: 'http://localhost:3000/pt-BR',
            salesChannel: '2',
            isDefault: true,
            locales: [
              {
                code: 'pt-BR',
                isDefault: true,
              },
            ],
          },
        ],
      },
      'it-IT': {
        ...
        bindings: [
          {
            currencyCode: 'EUR',
-           url: 'https://brandless.fast.store/it-IT',
+           url: 'http://localhost:3000/it-IT',
            salesChannel: '3',
            isDefault: true,
            locales: [
              {
                code: 'it-IT',
                isDefault: true,
              },
            ],
          },
          {
            currencyCode: 'EUR',
-           url: 'https://brandless.fast.store/europe/it',
+           url: 'http://localhost:3000/europe/it',
            salesChannel: '3',
            isDefault: false,
            locales: [
              {
                code: 'it-IT',
                isDefault: true,
              },
            ],
          },
        ],
      },
      'en-US': {
        code: 'en-US',
        name: 'English',
        languageCode: 'en',
        languageName: 'English',
        script: 'Latn',
        textDirection: 'ltr',
        regionCode: 'US',
        bindings: [
          {
            currencyCode: 'USD',
-           url: 'https://brandless.fast.store',
+           url: 'http://localhost:3000,
            salesChannel: '1',
            isDefault: true,
            locales: [
              {
                code: 'en-US',
                isDefault: true,
              },
            ],
          },
        ],
      },
    ...
}
```

- Go to /packages/core and run `npmn dev`

---------

Co-authored-by: Larícia Mota <[email protected]>
Co-authored-by: Leandro Rodrigues <[email protected]>
Co-authored-by: Otavio Moreira Meirelles <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants