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

Rendering Pages with bitbag_render_page_link_by_code #72

Closed
TELLO0815 opened this issue Nov 10, 2017 · 2 comments
Closed

Rendering Pages with bitbag_render_page_link_by_code #72

TELLO0815 opened this issue Nov 10, 2017 · 2 comments

Comments

@TELLO0815
Copy link

Rendering pages with slug is for multilingual pages not a good idea. Is there any prepared way how it works with the code (bitbag_render_page_link_by_code)?

THX for some code.

@TELLO0815
Copy link
Author

There was just a bug in your code:
template: BitBagCmsPlugin:Shop:Page:show.html.twig

must be

template: BitBagCmsPlugin:Shop/Page:show.html.twig

on the end also the page by code:

bitbag_shop_page_show:
    path: /page/{slug}
    methods: [GET]
    defaults:
        _controller: bitbag.controller.page:showAction
        _sylius:
            template: BitBagCmsPlugin:Shop/Page:show.html.twig
            repository:
                method: findEnabledBySlug
                arguments:
                    - $slug
                    - "expr:service('sylius.context.locale').getLocaleCode()"

bitbag_render_pages_by_section_code:
    path: /page/section/{code}
    methods: [GET]
    defaults:
        _controller: bitbag.controller.page:indexAction
        _sylius:
            template: $template
            repository:
                method: findEnabledBySectionCode
                arguments:
                    - $code

bitbag_render_pages_by_code:
    path: /page/{code}
    methods: [GET]
    defaults:
        _controller: bitbag.controller.page:showAction
        _sylius:
            template: $template
            repository:
                method: findEnabledByCode
                arguments:
                    - $code
                    - "expr:service('sylius.context.locale').getLocaleCode()"

@bitbager
Copy link
Member

Done in v1.1.0 🎉

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