Re: adding social media icons to a section on a page

Solved

adding social media icons to a section on a page

TBS2023
Shopify Partner
152 1 9

Hello

I am creating a landing page for an event and would like to add 2 icons for social media in a "Follow Us' section

Please advise how to proceed with the DAWN theme

Thanks

Accepted Solution (1)

oscprofessional
Shopify Partner
16115 2409 3121

This is an accepted solution.

Hello @TBS2023 ,

Go to your Shopify admin panel.

Just Easy installation, Follow given steps
Click on "Online Store" and then "Themes."
Find the theme you want to edit, click on "Actions," and then select "Edit Code."

Add File in section folder (section/social-section.liquid) file:
- Just Add (Copy or Paste) this code

Here is the code:

 

<div class="socialContainer">
  <h2 style="font-size:{{ section.settings.size }}px;">{{ section.settings.sectionTitle }}</h2>
  <div class="socialIcons">
  {% for block in section.blocks %}
      <div class="socialIcons">
          <a class="socialButton" href="{{ block.settings.social_url }}">
            <img src="{{ block.settings.social_image | img_url: 'Master' }}" alt="{{ block.settings.social_image.alt }}" loading="lazy" height="{{ block.settings.social_image.height }}" width="{{ block.settings.social_image.width }}">  
          </a>
      </div>
  {% endfor %}
  </div>
</div>

<style>
.socialContainer{text-align:center;margin:40px 0}.socialContainer h2{margin-bottom:20px}.socialIcons{display:flex;justify-content:center;gap:20px}.socialIcons a img{width:40px;height:40px;transition:transform .3s}
</style>

{% schema %}
    {
        "name": "Social Icons Section",
        "settings": [
          {
            "type": "text",
            "id": "sectionTitle",
            "label": "Section Heading",
            "default": "Follow Us on social media"
          },
          {
            "type": "text",
            "id": "size",
            "label": "title size",
            "default": "16"
          }
        ],
        "blocks": [{
            "name": "Icons",
            "type": "Text",
            "settings": [
                {
                    "type": "url",
                    "id": "social_url",
                    "label": "Add Your PDF's"
                },
                {
                    "type": "image_picker",
                    "id": "social_image",
                    "label": "Add Social Icon"
                }
            ]
        }
            
        ],
    "presets": [
            {
                "name": "Add Social Icons"
            }
        ]
    }
{% endschema %}

 

Features:

- Add Icons as per choice

- Add Urls of social media

Additional

- Added a feature for change section title font size

 

Here is the screen shot below for configuration:

oscprofessional_0-1721221443502.png

oscprofessional_1-1721221451847.pngoscprofessional_2-1721221457989.png

I hope this solution meets our needs.
Thank you 🙂 !!

 

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free

View solution in original post

Replies 4 (4)

Rahul_dhiman
Shopify Partner
441 89 89

Hello @TBS2023 
Check the screeenshot and follow.
2.png

3.png


If this was helpful, hit the like button and mark the job as completed.
Thanks

Was I helpful?

Buy me a coffee



Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -rahul@prowebcoder.com - Skype: live:dhiman.639
Checkout Some Free Sections Here
Mobile:- +91 62390-46167
TBS2023
Shopify Partner
152 1 9

Thanks but my page is a json not liquid

how do i add the snippet

Sweans
Shopify Partner
396 76 117

Hi @TBS2023 ,

Step-1: Open the Edit Code section from the “customize” section.
Screenshot 2024-07-17 171114.png
Step-2: In the “edit code” section, search for the section you need to edit or choose from the “sections” directory.

Sweans_0-1721219823979.png

 


Step-3: In the code of the section, go to the {% schema %} section and add URL fields in the settings. So, you can add links to the social media links dynamically from the “customize” section.

{
"type": "URL",
"id": "facebook_link",
"label": "Facebook link"
},
{
"type": "URL",
"id": "instagram_link",
"label": "Instagram link"
},

 

Sweans_1-1721219858099.png

 


Step-4: Dawn Theme has icons for Facebook, Twitter(X) and Instagram. If you require any other social media icons, you can provide SVG codes directly or can create a new icon snippet in the snippet directory and paste the SVG code for the icon in the snippet (As shown in the screenshot).

Sweans_2-1721219877667.png

 


Step-5: Then add the HTML code for displaying the links in your desired part of the section code, as shown in the screenshot:
<div class="social-media-links">

<h3>Follow Us:</h3>
<div class="facebook-link">
<a href="{{ section.settings.facebook_link }}">{% render 'icon-facebook' %}</a>
</div>
<div class="instagram-link">
<a href="{{ section.settings.instagram_link }}">{% render 'icon-instagram' %}</a>
</div>
</div>


Call the links added from the customize section as:

{{ section.settings.your_field_id }}


Call the snippet files to render as:

{% render 'icon-facebook'


Style your elements following your desired design.

Sweans_3-1721219901817.png

 


Note: You can also directly add social media link in "href", if you do not prefer setting up a field to dynamically add URLs
Step-6: Once you set the HTML code, go to the “customize” section add your social media URLs in the corresponding fields as shown in the screenshot and save.

Sweans_4-1721219935173.png

 



Sweans_5-1721219960493.png

 


Note: If you can provide a preview link or access to the page, it will make it easier for us to diagnose and provide an accurate solution.

I hope this helps! If it does, please like it and mark it as a solution!

Regards,
Sweans

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at info@sweans.com regarding any help.
- To know more about me check out www.sweans.com

oscprofessional
Shopify Partner
16115 2409 3121

This is an accepted solution.

Hello @TBS2023 ,

Go to your Shopify admin panel.

Just Easy installation, Follow given steps
Click on "Online Store" and then "Themes."
Find the theme you want to edit, click on "Actions," and then select "Edit Code."

Add File in section folder (section/social-section.liquid) file:
- Just Add (Copy or Paste) this code

Here is the code:

 

<div class="socialContainer">
  <h2 style="font-size:{{ section.settings.size }}px;">{{ section.settings.sectionTitle }}</h2>
  <div class="socialIcons">
  {% for block in section.blocks %}
      <div class="socialIcons">
          <a class="socialButton" href="{{ block.settings.social_url }}">
            <img src="{{ block.settings.social_image | img_url: 'Master' }}" alt="{{ block.settings.social_image.alt }}" loading="lazy" height="{{ block.settings.social_image.height }}" width="{{ block.settings.social_image.width }}">  
          </a>
      </div>
  {% endfor %}
  </div>
</div>

<style>
.socialContainer{text-align:center;margin:40px 0}.socialContainer h2{margin-bottom:20px}.socialIcons{display:flex;justify-content:center;gap:20px}.socialIcons a img{width:40px;height:40px;transition:transform .3s}
</style>

{% schema %}
    {
        "name": "Social Icons Section",
        "settings": [
          {
            "type": "text",
            "id": "sectionTitle",
            "label": "Section Heading",
            "default": "Follow Us on social media"
          },
          {
            "type": "text",
            "id": "size",
            "label": "title size",
            "default": "16"
          }
        ],
        "blocks": [{
            "name": "Icons",
            "type": "Text",
            "settings": [
                {
                    "type": "url",
                    "id": "social_url",
                    "label": "Add Your PDF's"
                },
                {
                    "type": "image_picker",
                    "id": "social_image",
                    "label": "Add Social Icon"
                }
            ]
        }
            
        ],
    "presets": [
            {
                "name": "Add Social Icons"
            }
        ]
    }
{% endschema %}

 

Features:

- Add Icons as per choice

- Add Urls of social media

Additional

- Added a feature for change section title font size

 

Here is the screen shot below for configuration:

oscprofessional_0-1721221443502.png

oscprofessional_1-1721221451847.pngoscprofessional_2-1721221457989.png

I hope this solution meets our needs.
Thank you 🙂 !!

 

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free