You may already know how to manage social icons in OpenCart 2.x template. In this video tutorial we are going to show you how to make social icons open in new tab.
Social icons links are opened in the same window by default. But you can make them open in new a tab if needed. To do that you will need to do the following code change:
Please, connect to your server using FTP access or use the hosting cPanel FileManager tool.
Open the catalog\view\theme\theme649\template\module folder to see a tm_social_list.tpl file.
Locate the HTML code for your social icon:
<li><a class="<?php echo $social['css']; ?>" href="<?php echo $social['link']; ?>" data-toggle="tooltip" title="<?php echo $social['name']; ?>"></a></li>
Change this code to:
<li><a class="<?php echo $social['css']; ?>" href="<?php echo $social['link']; ?>" target="_blank" data-toggle="tooltip" title="<?php echo $social['name']; ?>"></a></li>
You may notice that we added target="_blank" attribute. It allows you to open link in a new tab. It can also take the following values:
_self loads page in the same frame as it was clicked
_parent loads it in the parent frame-set.
_top loads link in the full body of the window
framename is used to load link in a named frame
Feel free to check the detailed video tutorial below:OpenCart 2.x. How to make footer social icons open in new tab
Also, view the collection of our premium OpenCart Templates to choose the best for your online store!.