-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
I cannot move the block #7253
Comments
Well, some of the blocks are supposed to be inside other blocks or exist in layout by design. I don't think putting "if block exists" conditions everywhere is a wise idea. Only if product listing without toolbar is a real-world use case such check should be added. Why do you need to move toolbar block outside? If it's really necessary, you can just render its markup in another place in your HTML and not render a markup in original place. |
bad design I have a custom layout, why do I need. Also I cannot remove the block. How can I hide it? <referenceBlock name="product_list_toolbar" remove="true"/> |
As you can see from implementation blocks are mixed with collection model and thus some data is obtained from toolbar block and defines model state. In this (poor) implementation product list block does not make sense without toolbar block (which is not just visual representation but also a storage for some collection flags). You cannot remove block from layout without additional fixes but you can remove it from HTML markup by changing its or product list template. |
So, I have to make a crutch. |
Exactly, until product list block implementation is decoupled from toolbar you cannot just change layout structure without consequences. Since it's quite old code it does not seem to me that it's a big problem. |
I solved the problem moved my blocks inside the category.products block and now I can move the product_list_toolbar within the category.products where I want. |
@springimport thank you for your report. |
@veloraven Magento ver. 2.1.2. |
@veloraven having similar problem on Magento 2.1.2: Steps to reproduce issue:
|
@springimport How did you solve this problem? I'm facing same issue. I want to move product toolbar outside columns container like this http://prntscr.com/f6335o. |
@deepak-netwin Try to use a several wrappers for default containers. |
@springimport Could explain what you mean with adding several wrappers for default containers? We're having the same issue. |
@PieterCappelle Instead of moving toolbar, wrap toolbar with content via new blocks and remove classes and tags from toolbar block (currently not working, because m2.2 shows validation errors on this). |
@engcom-Alfa Thank you for verifying the issue. Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:
Once all required information is added, please add label |
This issue is reproduced on the fresh 2.4-develop instance Steps to reproduce:
|
✅ Confirmed by @engcom-Alfa Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Really? Can you point us to the documentation that give that information to developers? |
I don't think this is documented in detail anywhere. You'll have to look at the code yourself. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions! |
Preconditions
Magento 2.4-develop
Php v. 7.2
Steps to reproduce
(product_list_toolbar_container - my container).
Actual result
Fatal error: Uncaught Error: Call to a member function getSize() on null in \vendor\magento\module-catalog\view\frontend\templates\product\list\toolbar.phtml:26 Stack trace: ...
I think I know why the error occurs. The block cannot be found when he outside.
Expected Result
The block successfully moved
Additional information
This is a problem of the system architecture. How I can solve it?
The text was updated successfully, but these errors were encountered: