Tuesday, July 23, 2013

Storenvy: Opening social links in new window

**UPDATE: This tutorial was made pre-Cooper theme update.**


By default, the Social links in the footer of your page with redirect the user to those sites in the same window, causing them to leave your site. If you'd like those links to open in a new window, this tutorial will show your how. It looks like a lot of code, but we'll only be adding target="_blank" to existing code. My navigation looks like the image below. You can see the entire page at Bean Sprout Boutique.


STEP 1: Edit your HTML

1. To find your HTML codes, go to Store Admin>Design>HTML Pages>Layout>Using Custom HTML
2. Look for:  <div id="footer"> Scroll down and you'll see the code for the Social navigation.
It will look like this:

<li>
{% if store.places != blank  %}
  <span class="footer-large">SOCIAL</span><br/>
  <ul>
  {% if store.twitter_url %}<li><a href="{{store.twitter_url}}" class="footer-social-link twitter"></a></li>{% endif %}
  {% if store.facebook_url %}<li><a href="{{store.facebook_url}}" class="footer-social-link facebook"></a></li>{% endif %}
  {% if store.tumblr_url %}<li><a href="{{store.tumblr_url}}" class="footer-social-link tumblr"></a></li>{% endif %}
  </ul>
{% endif %}
</li>


3. Copy the following code and paste it inside the <a> tag.

    target="_blank"

4. Your code should look like this:

<li>
{% if store.places != blank  %}
    <span class="footer-large">SOCIAL</span><br/>
   <ul>
   {% if store.twitter_url %}<li><a href="{{store.twitter_url}}" class="footer-social-link twitter"
target="_blank"></a></li>{% endif %}
   {% if store.facebook_url %}<li><a href="{{store.facebook_url}}" class="footer-social-link facebook" 
target="_blank"></a></li>{% endif %}
   {% if store.tumblr_url %}<li><a href="{{store.tumblr_url}}" class="footer-social-link tumblr" 
target="_blank"></a></li>{% endif %}
   </ul>
 {% endif %}
 </li>


5. Save changes and preview your store.

--------

STEP 2: Add your other Social media links

Storenvy uses an image for the Twitter, Facebook, and Tumblr links. Someday, I may create and host my own icons for Pinterest, Instagram and Blogger to use in the Social links, but for now, I just have text.

1. To find your HTML codes, go to Store Admin>Design>HTML Pages>Layout>Using Custom HTML
2. Look for:  <div id="footer"> Scroll down and you'll see the code for the Social navigation. It will look like this:

<li>
{% if store.places != blank  %}
   <span class="footer-large">SOCIAL</span><br/>
   <ul>
   {% if store.twitter_url %}<li><a href="{{store.twitter_url}}" class="footer-social-link twitter" target="_blank"></a></li>{% endif %}
   {% if store.facebook_url %}<li><a href="{{store.facebook_url}}" class="footer-social-link facebook" target="_blank"></a></li>{% endif %}
   {% if store.tumblr_url %}<li><a href="{{store.tumblr_url}}" class="footer-social-link tumblr" target="_blank"></a></li>{% endif %}
   </ul>
 {% endif %}
</li>


3. Add <br /> after the last Tumblr link. Copy the following code and paste it after your Tumblr link.

<li><a href="http://pinterest.com/yourname" target="_blank">Pinterest</a> </li><br />
<li><a href="instagram.com/yourname" target="_blank">Instagram</a> </li><br />
<li><a href="http://yourname.blogspot.com/" target="_blank">Blogger</a> </li>


4. Your finished code should look like this:

 <li>
{% if store.places != blank  %}
   <span class="footer-large">SOCIAL</span><br/>
   <ul>
   {% if store.twitter_url %}<li><a href="{{store.twitter_url}}" class="footer-social-link twitter" target="_blank"></a></li>{% endif %}
   {% if store.facebook_url %}<li><a href="{{store.facebook_url}}" class="footer-social-link facebook" target="_blank"></a></li>{% endif %}
   {% if store.tumblr_url %}<li><a href="{{store.tumblr_url}}" class="footer-social-link tumblr" target="_blank"></a></li>{% endif %}
<br />
   <li><a href="http://pinterest.com/yourname" target="_blank">Pinterest</a> </li><br />
   <li><a href="instagram.com/yourname" target="_blank">Instagram</a> </li><br />
   <li><a href="http://yourname.blogspot.com/" target="_blank">Blogger</a> </li>
   </ul>

{% endif %}
</li>


5. Save changes and preview your store.

*TIP: Your links may look different depending on the social media sites you use.

Here is what my finished footer looks like. You can see the entire page at Bean Sprout Boutique.





No comments:

Post a Comment