skip to Main Content

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.

2

Answers


  1. Chosen as BEST ANSWER

    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>
    

    `


  2. if you are working on Shopify template with liquid code. you can use:

    {% unless template contains '404' %}
    {% include 'footer' %}
    {% endunless %}
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search