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

How to sort blocks in sections #113

Closed
ambroisemaupate opened this issue Feb 2, 2018 · 3 comments
Closed

How to sort blocks in sections #113

ambroisemaupate opened this issue Feb 2, 2018 · 3 comments

Comments

@ambroisemaupate
Copy link

I use sections to create a kind of block collection (for carousels) but I need them to be sorted using a dedicated position field.

For example, create a homepage-carousel section then add many BlockImage into it. How do you sort them?

{{ render(path('bitbag_sylius_cms_plugin_shop_block_index_by_section_code', {
    'sectionCode' : 'home-carousel', 
    'template' : '@SyliusShop/Homepage/_carousel.html.twig',
    'sort': { 'position': 'ASC' }
})) }}

Is it possible to extend Block entity to add position and Gedmo Sortable behaviour ?

@bitbager
Copy link
Member

bitbager commented Feb 2, 2018

Yes, just upgrade to the dev-master version and customize the Block entity like it's done in http://docs.sylius.org/en/latest/customization/model.html. Don't forget to customize the repository and grid as well.

@ambroisemaupate
Copy link
Author

Awesome, I was not on dev-master branch so resource overriding was not working using annotations.

Thanks for you really quick answer.

@bitbager
Copy link
Member

bitbager commented Feb 2, 2018

No problem. I will tag a new release as soon as I find a minute. This feature is a definitely must on a stable branch.

@bitbager bitbager closed this as completed Feb 2, 2018
bitbager pushed a commit that referenced this issue Jul 16, 2018
Keep predefined directories in "web" in test application
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