Hello friends,
How i can make the banner topic show up on the home page and only for anonymous users, and when the user moves to a topic the banner disappear ?
Thanks in advance.
The discussion revolves around displaying a banner topic on the home page, visible only to anonymous users. Jay91 initially asked for help, and awesomerobot suggested using the Banner Topic feature, which shows for all users but can be targeted to anonymous users using CSS. awesomerobot provided HTML and CSS code to display content only for anonymous users. Jay91 confirmed they only want to show the banner on the homepage for non-registered users, and awesomerobot provided the necessary CSS code. Jay91 reported success after implementing the code.
Later, Jay91 asked how to hide the banner on mobile view, and awesomerobot provided additional CSS code to achieve this. Jay91 thanked awesomerobot for their help, and confirmed the solution worked as desired.
Hello friends,
How i can make the banner topic show up on the home page and only for anonymous users, and when the user moves to a topic the banner disappear ?
Thanks in advance.
Any help on this please !!
Does the Banner Topic accomplish what you’re looking for?
The banner shows for all users — but once a logged in user dismisses it then it’s gone forever; anon users can dismiss it (but the dismissed state is only saved locally on their device).
Additionally, you can target anon users using CSS (we add the class .anon to the HTML tag).
There are also some CSS classes to target either the topic-list pages (body.navigation-topics) or category pages (body.navigation-categories).
do i need to add only this to HTML under nav bar location ?
So for example, in your customizations if you add HTML content (Admin > Customize > Themes > Edit HTML/CSS > Header/After Header/Footer):
<div class="anon-content">
<p>This is test content</p>
</div>
You can then add this to your CSS so that content only shows for anon users:
.anon-content {
display: none;
}
.anon .anon-content {
display: block;
}
If you wanted to go further and only show that content for anon users on the category page, you could use this CSS:
.anon-content {
display: none;
}
.anon .navigation-categories .anon-content {
display: block;
}
yes i only want to show banner topic on the homepage and for non registered users only.
If you’re using a banner post and you want it to only show for anon users you’d add this to your CSS:
#banner {
display: none;
}
.anon #banner {
display: block;
}
yes worked fine, sorry for the last post, i closed the browser and re-open it… its working now.
Thank you so much.
Dear Sir,
One more thing if you dont mind, the banner is showing on the mobile view, how i can hide it from mobile and keep it on desktop only?
Thanks in advance.
after the other CSS you added, add this:
.mobile-view #banner {
display: none;
}
Many thinks sir, thanks for your time, worked like charm.