0

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.

2

1 Answer 1

2

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();
$layout->getUpdate()->addHandle('your_custom_handle_layout');
2
  • so this will not affect full page cache..right ? as i don't want to mess up with the caching.
    – Cv Gandhi
    Commented May 24, 2023 at 12:19
  • Thanks for the suggestion :) it worked :)
    – Cv Gandhi
    Commented May 24, 2023 at 14:06

Your Answer

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

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