0 like 0 dislike
7 views
asked in Sections Anywhere by (42 points)

Please log in or register to answer this question.

1 Answer

0 like 0 dislike
answered by (42 points)
edited by

For advanced developers familiar with Liquid, you can develop your own Section template files and place them into your theme's Snippets folder, prefixed by "atb." (so your file would look like atb.myawesomesection.liquid), and they will instantly be available in Sections Anywhere. While you're at it, why not submit your new Section to the Section Store and make some extra cash!

Custom Sections must follow the proper format. Below is an example of the contents of a Section file:

                
                
                <!-- Section / Block Type: Text -->

                {% comment %}
                    ATB-SCHEMA{
                    "name":"Text",
                    "id":"text",
                    "price": 0,
                    "banner":"//i.imgur.com/3xH5C0o.png",
                    "icon": "//i.imgur.com/JBPe0Qi.png",
                    "screenshots" : [
                        "//i.imgur.com/OcChZrR.png",
                        "//i.imgur.com/OcChZrR.png",
                        "//i.imgur.com/OcChZrR.png"
                    ],
                    "tags": "text,html,wysiwyg,universal",
                    "description": "Add any content to any page using a robust Wysiwyg text editor. You can add images, format your text, even add your own html.",
                    "settings":[
                        { 
                            "id" : "title",
                            "label" : "Title",
                            "info" : "Include a title",
                            "type" : "text"
                        },
                        { 
                            "id" : "description",
                            "label" : "Description",
                            "info" : "You can add text or html here",
                            "type" : "html"
                        },
                        { 
                            "id" : "text_align",
                            "label" : "Text align",
                            "info" : "Choose the alignment of the text",
                            "default" : "center",
                            "type" : "select",
                            "options": [
                                {
                                    "label": "Left",
                                    "value": "left"
                                },
                                {
                                    "label": "Center",
                                    "value": "center"
                                },
                                {
                                    "label": "Right",
                                    "value": "right"
                                }
                            ]
                        }
                    ]
                }ATB-SCHEMA
                {% endcomment %}

                {% include 'atb-render' field:'title' %}
                {% assign title = val %}
                {% include 'atb-render' field:'description' %}
                {% assign description = val %}
                {% include 'atb-render' field:'text_align' %}
                {% assign text_align = val %}

                <section class="atb--type__text">
                    <div style="text-align: {{ text_align }};">
                        {% if title != blank %}
                        <h2>{{ title }}</h2>
                        {% endif %}
                        {{ description }}
                    </div>
                </section>
        

Ask questions and receive answers from our expert developers and other members of the community.
...