Does Magento 2 have such handle as customer_logged_in? If yes how can I use it?
I tried to create
../view/frontend/layout/customer_logged_in.xml
and added there <referenceBlock name="content" remove="true" />
But content block wasn't removed. I renamed handle file to default and block was successfully removed.
What am I doing wrong?
Best Answer
Answer to your question is definitely no, there is no
customer_logged_in
handle anymore, I've digged into the code and could not find any layout handle that could do the trick.On top of that under
\dev\tests\static\testsuite\Magento\Test\Legacy\LayoutTest.php
you can find the following code:Which to me, clearly tells us that the
customer_logged_in
layout handle is obsolete now.See Fabian's answer for explanations about how it is done now in Magento 2.