Modal image pop-up on the home page of Dawn version 4.0

I’m just getting into Shopify development and have been practicing in Dawn version 4.0 but am struggling to figure out the best way to display a modal image pop-up on my home page. There isn’t a liquid file for the index page and I’m not sure if it can be done using the custom liquid section. Any guidance would be greatly appreciated, thank you for reading!

Hi @Jetski

The Dawn theme uses the new Shopify 2.0 theme structure which uses the new .json files for templates.

There are two things you can do to include a section in the homepage.

If your section name is modal.liquid, you can add this just above the tag in theme.liquid

{% if template contains 'index' %}
{% section 'modal' %}
{% endif %}

Second solution is to create a template with defined presets. This makes it so that the section can be added through the theme customiser/editor. An empty section with presets defined would look something like this:

{% schema %}
  {
    "name": "Modal",
    "settings": [],
	"presets": [
    {
      "name": "Modal"
    }
  ]
  }
{% endschema %}

{% stylesheet %}
{% endstylesheet %}

{% javascript %}
{% endjavascript %}

If you do this, you will be able to add this section via the "Add section: button in the theme customiser/editor