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

Enable a different og:image per language #994

Open
5 tasks
lucpretti opened this issue Oct 11, 2023 · 2 comments
Open
5 tasks

Enable a different og:image per language #994

lucpretti opened this issue Oct 11, 2023 · 2 comments
Assignees

Comments

@lucpretti
Copy link
Contributor

lucpretti commented Oct 11, 2023

When a page is translated into a different language, it's possible to edit all of its settings except the og:image attribute. This is currently managed through the Sidebar option in the Page menu. The problem is that a new page in another language automatically inherits the image uploaded to the sidebar.

So each page (including each translation) needs to have its own og:image.

It's relevant in cases such as:
https://okfn.org/en/projects/digital-public-infrastructure-for-electoral-processes/
https://okfn.org/es/proyectos/infraestructura-publica-digital-para-procesos-electorales/

Both links above currently have the following og:image:

thumb-DPI

But clearly the Spanish version should have the following:

thumb-DPI-es

Next steps

  • Make a clear list of what meta depends on language: image, description, title, etc
  • Clean no longer needed SideBarExtension
  • Create a new TitleMetaTags extension to implement all the tags that are gonna be dependent on the language
  • We will need to migrate all the current images to this one (probably manually)
  • Create a new PageMegaTags extension to implement all the tags that are not dependent on the language
@pdelboca
Copy link
Member

pdelboca commented Nov 6, 2023

@lucpretti this ticket will require some work (a couple of days) to properly implement it given that now we are not doing things in a good way.

Context

django-cms provides a couple of tools to this with this scenarios:

  • PageExtension: use to add fields that should have the same values for the different language versions of a page - for example, an icon.
  • TitleExtension: use to add fields that should have language-specific values for different language versions of a page - for example, keywords.
  • ExtensionToolbar: to add a menu item in the django-cms UI.

So, all meta tags that do not change with the language needs to be implemented using PageExtension. Those that do change with the language, using TitleExtension.

More info: https://docs.django-cms.org/en/latest/how_to/extending_page_title.html?highlight=ExtensionToolbar

Current implementation

Currently we are using an old obsolete SideBarExtension(PageExtension) to implement the image tag. This should have been done by cleaning the obsolete extension, and implementing a new one.

@lucpretti
Copy link
Contributor Author

Thank you for the research @amercader @pdelboca!

I'm ok with your approach and with any changes in obsolete/new plugins. Just wanted to make sure you know this is not a super priority - I'd rather implement #995 before.

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

No branches or pull requests

2 participants