Adding your Instagram, Facebook or Twitter widget to your Shopify online store is easy. Follow these steps to create your widget.
Once you've created your widget, follow the appropriate steps below to add it to your website.
Pro Tip: SnapWidget Shoppable widgets work great with Shopify online stores and allow you to sell your items using your Instagram photos.
To setup your widget for Shoppable, see https://snapwidget.help/creating-a-new-widget/pro-widget-advanced-settings/how-do-i-make-my-photos-shoppable
Please Note - In Shopify, Custom HTML is added by means of a Custom content section containing a Custom HTML block. By default the justification setting for any content inside the Custom content section is left-justified. This means your widget will also be displayed left-justified on the page. If this is how you want it, skip the next steps.
If you want to center justify your widget you will have to add some CSS code to your snippet. This can also be done by modifying the theme.css file (under Assets) using the Code editor. We prefer adding the code to the snippet, thus not making any changes to the Shopify base files.
Add the following CSS code (marked in yellow) to your snippet (Grid or SlideShow widget), just below the first line.
A. Edit the Shopify Template
Log in to Shopify and go to your Admin page.
Select Online Store > Themes.
This will display a small preview of your online store as well as the theme used. For this tutorial we are using the Debut theme; other theme setups are similar.
Select Customize to customize your online store (on the far right of the screen).
In the theme editor, select Add section to add a new section where we can place the code snippet.
Choose Custom Content to add the new section.
Modify the Custom Content heading as required (for this part we are inserting the Grid Widget, so we have called it âGrid Widgetâ, in the next part we will call it âSlideShow Widgetâ).
In the Custom content editor, choose Add block and then select the Custom HTML option.
Paste the entire code snippet into the HTML section (on the right sidebar), remember to add the extra CSS code for justification purposes.
Set the Custom HTML Container width for the widget as required â suggested width to use is at least 75% or 100%. You can use a combination of the widget width and the Custom HTML width. Just remember if you make it too small you wonât be able to click on it to display it in a Lightbox and your Social media buttons wonât be clickable.
You can also check to see how your widget will display on a mobile device by selecting the monitor icon.
You can re-order the position where you want the widget to be displayed (within the Custom Content section). To do this, go back to the editor and drag the Section into position.
Click on Save to update your Shopify store page.
Your widget will now be displayed as follows on your page.
Clicking on any of the images in the grid will display it in a Lightbox display.
The above was for inserting your Grid Widget. Adding your SlideShow Widget is basically the same, there are just a few subtle differences.
2. SlideShow Widget
If you added your responsive Slideshow snippet to your page it will be displayed as follows on your webpage.
The width of the responsive Slideshow widget as well as the justification cannot be changed. If this is what you wanted then you should skip the next part.
To enable us to change the width (and height to keep it at a 1:1 ratio) we will have to make some changes to our widget.
Create a non-responsive widget on your SnapWidget dashboard. The width and height are not important, you can set them to 200px each.
We are now going to add some HTML and CSS code to our snippet to create an area where the snippet will be displayed. The area will be basically as follows:
This gives us control over the width, height and the justification of the widget. It also causes the non-responsive widget to become responsive.
The standard non-responsive widget snippet contains the following:
Make the following changes to this snippet.
Add 2 <div> blocks with the following styles (the ids are just for explanatory purposes for this tutorial, they are not used for any other purpose so you actually leave them out).
<div id=âWrapperâ style=âwidth: 45%; margin: 0 auto;â>
.This sets the wrapper to 45% of available width and center-justified. With this width setting we can change the width of the widget to any width we require.
Please Note - As with the Grid display, if you make the width too small, you will have difficulty to click on the item to display it in a lightbox. Your Social Media buttons will also not be displayed properly. For Shopify using this setting for the Slideshow display the minimum width is 45%.
<div id="container" style="top: 0; height: 0; width: 100%; padding-bottom: 100%; overflow: hidden; position: relative; margin: 0 auto;">
This sets the area used to display the iframe to 100% of the wrapper width as well as height = 100% of the width.
Remove the width and height attributes of the style part of the iframe and replace them with the indicated attributes (
left:0; width:100%; height:100%; position:absolute;
)
This will then display the widget as follows:
Clicking on any of the images in the grid will display it in a Lightbox display.
The widget is also responsive.