Skip to content

feat: use CMS-provided title template - #3104

Merged
lemagnetic merged 4 commits into
feat/multilanguagefrom
chore/seo-title-template-from-hcms
Nov 17, 2025
Merged

lemagnetic merged 4 commits into
feat/multilanguagefrom
chore/seo-title-template-from-hcms

Conversation

@lemagnetic

@lemagnetic lemagnetic commented Nov 7, 2025 •

Copy link
Copy Markdown
Contributor

What's the purpose of this pull request?

Replace storeConfig.seo.titleTemplate usage with values provided by the hCMS so page titles remain configurable via content, while keeping discovery.config.js as fallback to avoid breaking changes.

How it works?

  • Reads titleTemplate directly from settings.seo (hCMS) on Home and Landing pages.
  • Keeps a fallback to the page title when the template is not present.
  • Exposes the titleTemplate field in the hCMS schema and updates PageContentType.

How to test it?

  • Publish or edit a page in hCMS setting settings.seo.titleTemplate.
  • Open the corresponding page and confirm the rendered title follows the configured template.
Captura de Tela 2025-11-12 às 17 39 05 Captura de Tela 2025-11-12 às 17 44 29

Starters Deploy Preview

URL Preview: https://brandless-cma5xay4001f6dn4xjwato8b4-7wpvceise.b.vtex.app/

References

Jira task

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

codesandbox-ci Bot commented Nov 7, 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 marked this pull request as ready for review November 10, 2025 13:56
@lemagnetic
lemagnetic requested a review from a team as a code owner November 10, 2025 13:56
@lemagnetic
lemagnetic requested review from emersonlaurentino and hellofanny and removed request for a team November 10, 2025 13:56

@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.

questions:

  1. There are also titleTemplate for pages like PLP, Search and PDP -- shouldn't those cases be handled through hCMS also?
  2. What do you think of removing those configs from discovery.config? Since it'll be made through hCMS now

@hellofanny hellofanny 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.

Nice! 🚀
image
image

note: Can you also remove the author: 'Store Framework' from the discovery.config.default.js since we are not using it. Thanks

@lemagnetic
lemagnetic merged commit ff87468 into feat/multilanguage Nov 17, 2025
@lemagnetic
lemagnetic deleted the chore/seo-title-template-from-hcms branch November 17, 2025 15:55
lemagnetic added a commit that referenced this pull request Nov 20, 2025
## What's the purpose of this pull request?

Replace `storeConfig.seo.titleTemplate` usage with values provided by
the hCMS so page titles remain configurable via content, while keeping
`discovery.config.js` as fallback to avoid breaking changes.

## How it works?

- Reads `titleTemplate` directly from `settings.seo` (hCMS) on Home and
Landing pages.
- Keeps a fallback to the page title when the template is not present.
- Exposes the `titleTemplate` field in the hCMS schema and updates
`PageContentType`.

## How to test it?

- Publish or edit a page in hCMS setting `settings.seo.titleTemplate`.
- Open the corresponding page and confirm the rendered title follows the
configured template.
<img width="563" height="360" alt="Captura de Tela 2025-11-12 às 17 39
05"
src="https://github.com/user-attachments/assets/39ae34c8-def5-48ed-94b3-320367e31d08"
/>
<img width="489" height="412" alt="Captura de Tela 2025-11-12 às 17 44
29"
src="https://github.com/user-attachments/assets/c4eb64f5-7d28-417e-992d-ccd20dc4a159"
/>



### Starters Deploy Preview
URL Preview:
https://brandless-cma5xay4001f6dn4xjwato8b4-7wpvceise.b.vtex.app/

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

Replace `storeConfig.seo.titleTemplate` usage with values provided by
the hCMS so page titles remain configurable via content, while keeping
`discovery.config.js` as fallback to avoid breaking changes.

## How it works?

- Reads `titleTemplate` directly from `settings.seo` (hCMS) on Home and
Landing pages.
- Keeps a fallback to the page title when the template is not present.
- Exposes the `titleTemplate` field in the hCMS schema and updates
`PageContentType`.

## How to test it?

- Publish or edit a page in hCMS setting `settings.seo.titleTemplate`.
- Open the corresponding page and confirm the rendered title follows the
configured template.
<img width="563" height="360" alt="Captura de Tela 2025-11-12 às 17 39
05"
src="https://github.com/user-attachments/assets/39ae34c8-def5-48ed-94b3-320367e31d08"
/>
<img width="489" height="412" alt="Captura de Tela 2025-11-12 às 17 44
29"
src="https://github.com/user-attachments/assets/c4eb64f5-7d28-417e-992d-ccd20dc4a159"
/>



### Starters Deploy Preview
URL Preview:
https://brandless-cma5xay4001f6dn4xjwato8b4-7wpvceise.b.vtex.app/

## References
[Jira
task](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-2920)
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.

3 participants