Skip to content

Generate a specific page link depending of the _locale ? #30

@david-vde

Description

@david-vde

Hello

I'm trying to generate a link on a custom page (not a cmspage) to point on a cmspage.

I do this :

<a href="{{ path('orbitale_cms_page', {slugs: 'my-page-slug'}) }}">{% trans %}menu.my_page{% endtrans %}</a>

it works perfectly. But. I'm creating a multi-language website. I can't figure out how to deal with the _locale.

As in the database the slug changes depending the language, currently I have to manually, make a condition, to check the current locale and take the good slug, but, obviously this is not a good way to do.

How am I supposed to deal with that? And by the way, I can't find any way to links 2 pages records of different language.

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions