Liquid error: new_comment form must be given an article

Hi,

When trying to add a contact form to my website, I get this error: “Liquid error: new_comment form must be given an article”

Here is my code on page.contact.liquid:


  

    

      

        # {{ page.title }}
      

      {% if page.content.size > 0 %}
        
          {{ page.content }}
        

      {% endif %}

      
        {%- assign formId = ‘ContactForm’ -%}
        {% form ‘contact’, id: formId %}
          {% include ‘form-status’, form_id: formId %}

            

                

                    
                    
                

                
                    
                    
                    {%- if form.errors contains ’email’ -%}
                    
                        {{ ‘general.accessibility.error’ | t }} 
                        {% include ‘icon-error’ %}
                        {{ form.errors.translated_fields[’email’] | capitalize }} {{ form.errors.messages[’email’] }}.
                    
                    {%- endif -%}
                

            

            
            

            
            

            
            

            

        {% endform %}
      

    

  

I tried building my form based on this article: https://www.abetterlemonadestand.com/how-to-add-a-contact-form/#:~:text=If%20your%20Shopify%20theme%20doesn%E2%80%99t%20already%20have%20a,your%20own%20simple%20contact%20form%20right%20in%20Shopify.

Does anyone know how I can get my form to show up and remove the error message?

Any help is much appreciated!

Hey just figured it out. Just remove any class or id from the form tags.

like this.

{% form ‘contact’ %}

Put quotes around the id value OR class value

from this {% form ‘contact’, id: formId %}

To this {% form ‘contact’, id: ’ formId ’ %}

Then it will work.