I want to show different header and footer for the guest users and default one for the logged-in users.

What is the right way to do so ?

AND using the custom module to achieve this.


1 Answer 1


Here is my suggestion:

1/ In your block, need to add Customer Group identifier to cache key.

2/ layout_load_before observer event. Put this event under frontend scope. In your observer, add your layout handle with your conditions.

$layout = $observer->getEvent()->getLayout();
  • so this will not affect full page cache..right ? as i don't want to mess up with the caching.
    – Cv Gandhi
    May 24 at 12:19
  • Thanks for the suggestion :) it worked :)
    – Cv Gandhi
    May 24 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.