Home › Forums › Support › Different Site-Headers for Logged in and Logged out user AND different pages
- This topic has 13 replies, 2 voices, and was last updated 3 years, 4 months ago by
Fernando.
-
AuthorPosts
-
November 10, 2022 at 11:54 pm #2410815
Patrick
Hi Support,
I try to figure out what the best solution is to create multiple Site-Headers depending on Logged-in/Logged-out/User Roles/Pages.
In the past I created Block Elements and set Display rules, somehow this is not longer possible? My site-header just broke after updating some elements? I am only able to set 1 Block Element as Site-Header?I need different headers for:
– All pages except WC cart page for logged in user roles: Administrator, Customer
– All pages except WC cart page for logged out user
– Alle pages except WC cart page for logged in user role: Vendor
– WC Cart page for logged in user roles: Customer
– WC Cart page for logged out userI appreciate your help with this, because I can’t find another topic that explains how to do this?
Thanks!
PatrickNovember 11, 2022 at 12:23 am #2410842Fernando Customer Support
Hi Patrick,
To clarify, in your Block Element, are you not seeing the option for logged-in and logged-out for users in the Display rules section? Example: https://share.getcloudapp.com/E0uZDGXR
Having two Block Element – Site Headers should still work.
What updates changed your Header? Can you provide the link to the site in question? You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
You should be able to add display rules for user roles as well. Example: https://share.getcloudapp.com/12uzGpQA
November 11, 2022 at 2:43 am #2410981Patrick
Hi Fernando,
Thanks for your fast reply.
I do see all the options and have set it up (as it worked before). But since I added a Container element and a shortcode, it seems that only one Site-Header Block could be active at the same time.
For example:
I have 2 Block Elements with type: Site Header
Restriction:1) Header 1
– Show on all pages
– Hide on page: WC Cart
– Show for logged out user only2) Header 2
– Show on all pages
– Hide on page: WC Cart
– Show for logged in user with roles: Administrator, Customer onlyIf I edit Header 1 and push update button, the header is only working correctly for logged out user. For logged in user (Admin, Customer) both header blocks are shown but without css -> check here: https://ibb.co/5Y3BkD8
If I edit Header 2 and click update, the header is shown correctly for logged in user (Admin, Customer) but not logged out user (same “error” like when I updated Header 1).
I created a staging site for you to reproduce the issue. You find the details in the private information area.
Thanks,
PatrickNovember 13, 2022 at 6:54 pm #2414231Fernando Customer Support
Hi Patrick,
I tried checking the existence of the Element when logged out, and upon my test, I was able to see it appear.
See: https://share.getcloudapp.com/Jru8dZE6
As shown, this specific Container Block is the Container Block from the Logged Out Block Element.
Can you clear the cache of your browser and retest? Check in the inspector if you’ll see this Container as well.
November 14, 2022 at 1:21 am #2414441Patrick
Hi Fernando,
Yes, I do see both logged out elements (one for mobile one for desktop). Thats my problem, sorry if I did not clarify that before. I designed different headers for mobile and desktop and used the “hide on xy” function in the element section. But it’s not working as you see. And the CSS is broken?
The exact same structure and settings do work for logged in user, because I saved logged in user element. If I save now the logged out user element, it will work for logged out user (show only desktop or mobile with correct CSS laoded) BUT then logged in user sees both headers (desktop & mobile) with broken CSS.
Thanks
PatrickNovember 14, 2022 at 1:37 am #2414457Fernando Customer Support
I see. I can’t seem to login anymore. Can you check if the credentials still work?
November 14, 2022 at 1:45 am #2414465Patrick
Your user is still active, please make sure you set the Cookie in your browser to access our staging site.
Thanks
November 14, 2022 at 5:23 pm #2415721Fernando Customer Support
Yes, it’s working. Sorry about that. Didn’t notice the cookie wasn’t stored.
I see. Yes, the CSS is broken when logged out for the Block Element. The CSS seems to be missing.
In GenerateBlocks > Settings, can you try “Regenerate CSS files”?
If that doesn’t work, try #1 here to test if a plugin is causing this: https://docs.generatepress.com/article/debugging-tips/
November 23, 2022 at 1:33 am #2428535Patrick
Hi Fernando,
Sorry for my late reply, I thought I already send it :-O.
I have deactivated all Plugins -> still same problem.
I have regenerated CSS file -> still same problem.BUT when I set CSS to “inline” instead of “external file” it works??
Any idea? Could you please investigate?
Thanks,
PatrickNovember 23, 2022 at 2:00 am #2428580Fernando Customer Support
I see. Glad you got that to work.
Sometimes, unstyled content created through GenerateBlocks can conflict with some servers/caching methods. Can you revert to “External File” setting, and then can you check with your Hosting Provider if they clear server cache? I checked and your server seems to be cached: https://share.getcloudapp.com/9ZuzGOEO
Reference: https://docs.generateblocks.com/article/unstyled-content/
November 23, 2022 at 2:06 am #2428586Patrick
I can clear the server cache myself, and I have done that – issue still exists. We have no CDN, so Server Cache is the only caching we do. I am just on to create a local dev environment from a snapshot and will deactivate caching there completely and test again.
Thanks
November 23, 2022 at 5:01 pm #2430149Fernando Customer Support
I see. Hope it goes well! You’re welcome Patrick!
December 12, 2022 at 4:44 am #2458809Patrick
Hi Fernando,
Sorry for my late reply.
I could finally test it on my local dev and the issue still exists without any caching active.
Any ideas?Thanks,
PatrickDecember 12, 2022 at 5:13 pm #2459723Fernando Customer Support
I see.
Can you try setting both Headers to draft, then for testing purposes, create two new Headers with similar Display rules but this time only include a simple Block like a GB Headline Block? Make sure to make modifications in their colors and font so that there is CSS involved.
Let’s see if the CSS will load there.
-
AuthorPosts
- You must be logged in to reply to this topic.