Notifications
Announcements
Hi all
I have a liquid 'if' statement as seen here -
I am trying to hide a HTML button within this statement. Is this possible with liquid?
Here is my button -
How can I hide this button in the liquid statement above?
Thanks for your help.
Hi @Usernametwice23 ,
You can simply use if-else for your HTML code.
{% if isUserRegistered %}// Show html div{% else %}
//// Not Show html div{% endif %}
Regards
Mohammad
Assuming it is an out-of-the-box button
Hide it with CSS first (this is to stop screen flicker)
Then Unhide it with JQuery based on liquid if/then that checks if logged in
{% if user %}
{% else %}
<script>
$( document ).ready(function() {
$( ".target" ).show();
); });
</script>
{% endif %}
The issue is finding how to uniquely identify the correct HTML object.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Jerry-IN 71
Fubar 62 Super User 2025 Season 2
sannavajjala87 31