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

[FEATURE] Support for Meta Descriptions and Title #1739

Closed
2 tasks
PaulSchumacher opened this issue Nov 29, 2021 · 2 comments · Fixed by #1842
Closed
2 tasks

[FEATURE] Support for Meta Descriptions and Title #1739

PaulSchumacher opened this issue Nov 29, 2021 · 2 comments · Fixed by #1842

Comments

@PaulSchumacher
Copy link

Description

The SEO data from the categories should be used in the PWA.

Acceptance criteria

  • Meta Description should be set depending on the category
  • Title should be set depending on the SEO-Title of the category
@mkucmus mkucmus self-assigned this Nov 30, 2021
@mkucmus
Copy link
Collaborator

mkucmus commented Dec 1, 2021

Hi @PaulSchumacher, currently we are facused on other parts of the application.
To achieve support for meta descriptions and title, you would have to:

  1. override the _.vue page (inherited from https://github.com/vuestorefront/shopware-pwa/blob/master/packages/theme-base/dist/pages/_.vue) - copy it into your theme, in pages/ subdir.
  2. add config into the page's definition like head() {} section that returns title and other stuff you want to bind dynamically
  head() {
      return {
        title: this.metaTitle,  
      }
    },
  1. in the setup function, export computed property that depends on the page from useCms
...
return {
      metaTitle: computed(() => staticPage.value?.category?.translated?.metaTitle ||  staticPage.value?.category?.translated.name),
...

example above uses category as a source of metaTitle, but it can be also a product object if it's a product PDP response.

@meeshoogendoorn
Copy link
Contributor

@mkucmus am i correct that there is no support for landing pages yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants