I am working on a rails website with views made predominantly with liquid shopify. I customized the default rails 404 error message to something more dynamic that would display an animation and the top menu of the website. My new error pages are named not_found.html.erb and internal_server_error.html.erb. Aside the top menu that displays automatically on the new error page, the footer displays as well and i want to take it out. The top menu and the footer are liquid templates. I want to take out the liquid footer on only the two error pages i mentioned above.
I fixed it by changing the erb templates to liquid. Then i put this as the first line in the views that i changed from erb to liquid.
<style>
footer { display:none; }
</style>
`
if you are working on Shopify template with liquid code. you can use:
{% unless template contains '404' %}
{% include 'footer' %}
{% endunless %}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.