How can I add text before the form on my contact page?

Hi, how can i add some text in the contact page before the form.

Thanks

1 Like

@silvanadiaz - you have 2 options

1 - please go to contact page from backend pages and add text in the page or

2 - directly add text to contact template

@silvanadiaz

if possible to share code so i will add code

1 Like

This is the code

{{section.settings.heading}}

{%for block in section.blocks%}

{{block.settings.column-text-heading}}

{{block.settings.column-text-subheading}}

{%endfor%}
.section-title{ padding: 40px 12px; }

{% schema %}
{
“name”: “column Text”,
“settings”: [
{
“id”: “heading”,
“type”: “text”,
“label”: “Heading”

}

]
,

“presets”: [
{
“name”: “column Text”

}
] ,

“blocks”: [
{
“type”: “text”,
“name”: “column Text”,
“settings”: [

{
“id”: “column-text-heading”,
“type”: “text”,
“label”: “column Heading”
},
{
“id”: “column-text-subheading”,
“type”: “text”,
“label”: “column Sub Heading”
}
]
}
]
}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

Hi, this is the code, i want to add some text before de form

{{section.settings.heading}}

{%for block in section.blocks%}

{{block.settings.column-text-heading}}

{{block.settings.column-text-subheading}}

{%endfor%}
.section-title{ padding: 40px 12px; }

{% schema %}
{
“name”: “column Text”,
“settings”: [
{
“id”: “heading”,
“type”: “text”,
“label”: “Heading”

}

]
,

“presets”: [
{
“name”: “column Text”

}
] ,

“blocks”: [
{
“type”: “text”,
“name”: “column Text”,
“settings”: [

{
“id”: “column-text-heading”,
“type”: “text”,
“label”: “column Heading”
},
{
“id”: “column-text-subheading”,
“type”: “text”,
“label”: “column Sub Heading”
}
]
}
]
}
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

1 Like

@silvanadiaz

thanks for code but sorry it’s not contact page code

Sorry, this one is

{{ page.title }}

{{- page.content -}}

{%- form ‘contact’, class: ‘Form Form–spacingTight’ -%}
{%- if form.posted_successfully? -%}

{{ 'contact.form.successfully_sent' | t }}

{%- endif -%}

{%- if form.errors -%}

    {%- for field in form.errors -%} {%- if field == 'form' -%}
  • {{ form.errors.messages[field] }}
  • {%- else -%}
  • {{ form.errors.translated_fields[field] }} {{ form.errors.messages[field] }}
  • {%- endif -%} {%- endfor -%}
{%- endif -%}
{{ 'contact.form.name' | t }}
{{ 'contact.form.email' | t }}

{%- for block in section.blocks -%}
{%- assign field_title = block.settings.title -%}

{%- if field_title == blank -%}
{%- capture field_title -%}Custom field {% increment custom_field %}{%- endcapture -%}
{%- endif -%}

{%- if block.type == ‘text’ -%}

{%- if block.settings.use_long_text -%} {{ block.settings.title | escape }} {%- else -%} {{ block.settings.title | escape }} {%- endif -%}
{%- elsif block.type == 'dropdown' -%} {%- assign values = block.settings.values | split: ',' -%}

{%- if values == empty -%}
{%- continue -%}
{%- endif -%}

{%- render 'icon' with 'select-arrow' -%}
{%- endif -%} {%- endfor -%}
{{ 'contact.form.message' | t }}

{{ ‘contact.form.submit’ | t }}
{%- endform -%}

{% schema %}
{
“name”: “Contact page”,
“settings”: ,
“blocks”: [
{
“type”: “text”,
“name”: “Text field”,
“settings”: [
{
“type”: “text”,
“id”: “title”,
“label”: “Name”,
“default”: “Custom field”
},
{
“type”: “checkbox”,
“id”: “use_long_text”,
“label”: “Use long text”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “is_required”,
“label”: “Field is required”,
“default”: false
}
]
},
{
“type”: “dropdown”,
“name”: “Dropdown”,
“settings”: [
{
“type”: “text”,
“id”: “title”,
“label”: “Name”,
“default”: “Custom field”
},
{
“type”: “text”,
“id”: “values”,
“label”: “Values”,
“info”: “Separate each value by a comma.”,
“default”: “value 1, value 2, value 3”
}
]
}
],
“default”: {
“blocks”: [
{
“type”: “text”,
“settings”: {
“title”: “Your phone (optional)”
}
}
]
}
}
{% endschema %}

1 Like

@silvanadiaz

no rush thanks for code

please add code here


{{- page.content -}}

{%- form 'contact', class: 'Form Form--spacingTight' -%}
{%- if form.posted_successfully? -%}

{{ 'contact.form.successfully_sent' | t }}

{%- endif -%}

{%- if form.errors -%}

{%- for field in form.errors -%}
{%- if field == 'form' -%}
- {{ form.errors.messages[field] }}

{%- else -%}
- **{{ form.errors.translated_fields[field] }}** {{ form.errors.messages[field] }}
{%- endif -%}
{%- endfor -%}

{%- endif -%}

{%- for block in section.blocks -%}
{%- assign field_title = block.settings.title -%}

{%- if field_title == blank -%}
{%- capture field_title -%}Custom field {% increment custom_field %}{%- endcapture -%}
{%- endif -%}

{%- if block.type == 'text' -%}

{%- if block.settings.use_long_text -%}

{%- else -%}

{%- endif -%}

{%- elsif block.type == 'dropdown' -%}
{%- assign values = block.settings.values | split: ',' -%}

{%- if values == empty -%}
{%- continue -%}
{%- endif -%}

{%- render 'icon' with 'select-arrow' -%}

{%- endif -%}
{%- endfor -%}

{%- endform -%}

{% schema %}
{
"name": "Contact page",
"settings": [],
"blocks": [
{
"type": "text",
"name": "Text field",
"settings": [
{
"type": "text",
"id": "title",
"label": "Name",
"default": "Custom field"
},
{
"type": "checkbox",
"id": "use_long_text",
"label": "Use long text",
"default": false
},
{
"type": "checkbox",
"id": "is_required",
"label": "Field is required",
"default": false
}
]
},
{
"type": "dropdown",
"name": "Dropdown",
"settings": [
{
"type": "text",
"id": "title",
"label": "Name",
"default": "Custom field"
},
{
"type": "text",
"id": "values",
"label": "Values",
"info": "Separate each value by a comma.",
"default": "value 1, value 2, value 3"
}
]
}
],
"default": {
"blocks": [
{
"type": "text",
"settings": {
"title": "Your phone (optional)"
}
}
]
}
}
{% endschema %}
2 Likes

@KetanKumar I tried adding that code to my Contact back page, but I received an error message. I would like for the text to be above the fields because my text is white and background is black, but I can change this page because other pages will be messed up. I tried adding it under page.contact.liquid. Can you assist?

Thanks!

@WillyWill

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community! :blush:
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

https://creations-at-will.myshopify.com/

@KetanKumar

Here is my link: https://creations-at-will.myshopify.com/

Can you also tell me why some of my products have the PayPal button on the same page as Add to Cart and some do not?

Thanks!

1 Like

@WillyWill

sorry your store password protect

Hello,

This inquiry doesn’t belong to me, please verify the email account.

Thanks