How to create a stylish template demo or live preview page on Blogger
Most theme sharing sites have a demo or live preview page where users can preview the demo of the template they are interested in buying.
If your template sharing site is on Blogger, you may be thinking of how to create a stylish demo page like the one we have here.
Today, we are going to show you how to create a stylish template demo or live preview page on Blogger. And what's good about this template demo or live preview page is that, just like the case with many sites, it's got a download button and option to remove the frame.
Features of this Blogger widget
- Responsive
- Light-weight code
- Direct template download button on the demo page
- Remove or close the frame button
- Site logo.
- Stylish
Creating the demo or live preview page
Create the demo page
Adding the CSS code to your template
- After creating the new page, publish it and then from your Blogger Dashboard, go to theme > Edit HTML
- Next, search for the tag ]]></b:skin> and paste the following CSS code just above (BEFORE) it.
/* Blogger demo page*/
#view {
padding: 0;
margin: 0;
border: 0;
position: fixed;
top: 50px;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 93%;
background:url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqO3UvbtnnOTNjHcLXpayH-aRVpG2EaEc66d_YoyuXXtGyn_64dKoTGZJY7qiO0d6LhjS1VKGg65Ck8Xp9UAk8_2cfmfNZpdVuN_vRQyYgkCU5fe3JfbZrHT4kddc2TRyyLMLXqbZ1ip8/s1600/hourglass.gif)no-repeat center center;
transition:all .4s ease-out;
}
#tab-demo {
width:100%;
height:50px;
top:0;
left: 0;
background:#222;
color:white;
font:normal 13px Arial, sans-serif;
z-index:99999;
position:fixed;
}
.closebutton {
background:#BCFF8B url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp3Wu4zDX6P2d7wT7zQAvGe3JDDmHWEqqce75UuRhDktu0EZIYaxrueZGzAG6gGPiB6bT7cBgAv_J_c8pOfxeoqTFyC2cKb2EyAReT-4DFVplQvNWa43Nhvro9rnzKhmAPlbIr2Eb0Emw/s1600/close.png)no-repeat 15px 50%;
text-align:center;
height:50px;
padding:0px 20px 0px 50px;
position:fixed;
top:0;
right:0;
line-height:50px;
cursor:default;
color:white;
}
a.closebutton {color:white;text-decoration:none;}
.closebutton:hover {background:#FF0000 url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp3Wu4zDX6P2d7wT7zQAvGe3JDDmHWEqqce75UuRhDktu0EZIYaxrueZGzAG6gGPiB6bT7cBgAv_J_c8pOfxeoqTFyC2cKb2EyAReT-4DFVplQvNWa43Nhvro9rnzKhmAPlbIr2Eb0Emw/s1600/close.png)no-repeat 15px 50%}
.dlbutton:hover {background:#579c26 url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifubclo3xBl62JDmqJkqr3HbAjysJgbjLlegnMKQEm7OP6IhvLuz1N2nWqtPkCWUDj9HBjs6UvpaOgPijpcpfNyW19zlcYbtlmEu0O8kVC_zErxZLYltHHRNVVoMsqVT9fgNjzUjSbaA4/s1600/download.png)no-repeat 15px 50%}
.dlbutton, a.dlbutton {
background:#66af33 url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifubclo3xBl62JDmqJkqr3HbAjysJgbjLlegnMKQEm7OP6IhvLuz1N2nWqtPkCWUDj9HBjs6UvpaOgPijpcpfNyW19zlcYbtlmEu0O8kVC_zErxZLYltHHRNVVoMsqVT9fgNjzUjSbaA4/s1600/download.png)no-repeat 15px 50%;
text-align:center;
height:50px;
padding:0px 20px 0px 55px;
position:fixed;
top:0;
right:158px;
line-height:50px;
cursor:default;
color:white;
text-decoration:none;
}
.demologo, a.demologo {
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXxA573Trdqr-fSOnob-CEZ053nAoRqTRzAe5D84nbuFrzRdfrFPArh2jYk52Kpr39YU5LgpH9coyEMrto1JIky-jzq8-MNUgziuWr8WXiunDwf3TqwVVRmcETAevJNOU5zTwrqgRccVfw/s50/photo_2020-07-09_01-45-24.jpg)no-repeat left center;
padding-left:55px;
font-size:17px;
font-weight:normal;
font-family:Oswald, Arial, Sans-serif;
text-transform:uppercase;
line-height:50px;
left:15px;
position:fixed;
color:white;
cursor:default;
text-decoration:none;
}
- After pasting the above code, proceed to the next step.
Adding HTML & JavaScript code for the demo or preview page
- Start by searching for the opening body tag <body
- Now just after the opening body tag, paste this line of code. You will have to change the link (in green) to that of you demo page you created earlier
<b:if cond='data:blog.url != "https://www.bloggercustomiz.com/p/demo.html"'>
- Next, we will have to close the conditional tag code we just pasted below the opening body tag. Search for the closing body tag </body> and paste this code just above it.
</b:if>
- And finally, adding this line of code again just before the closing body tag
<b:if cond='data:blog.url == "https://www.bloggercustomiz.com/p/demo.html"'>
<script type='text/javascript'>
//<![CDATA[
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return (false);
}
window.onload = function() {
var url = getQueryVariable("url");
var download = getQueryVariable("download")
document.getElementById('view').src = url;
document.getElementById('dl').href = download;
};
//]]>
</script>
<div id='tab-demo'>
<a class='demologo' href='https://www.bloggercustomiz.com'>Blogger Customiz</a>
<a class='dlbutton' href='' id='dl'>Download</a>
<a class='closebutton' href='javascript:void(0)' onclick='document.getElementById('tab-demo').style.display='none';document.getElementById('view').style.top='0';document.getElementById('view').style.height='100%''>Remove Frame</a>
</div>
<iframe id='view'/>
<style>
body {
background:white;
}
</style>
</b:if>
- Change the demo page link in green to that of your demo page you created earlier
- Also, change the blog link in red to that of your blog
- and finally the blog Title in Orange
Creating a demo link for templates
https://www.bloggercustomiz.com/p/demo.html?url='Demo_Site_Link'&download='template_download_link'
template_download_link = Downoad ink for the templatehttps://www.bloggercustomiz.com/p/demo.html: Replace with your demo page linkDemo_Site_Link = Link of demo iste to be previewed.
https://www.bloggercustomiz.com/p/demo.html?url=https://appbusiness-goomsite.blogspot.com&download=https://bit.ly/35NQ8T4



Comments
Post a Comment