Blogger Forums » Blogger Template Tweaks

Need a template tweak

(4 posts)
  1. some1

    new member
    Joined: Dec '11
    Posts: 4

    Hello Aneesh & the other users,

    Several months ago I found this template for video blogs
    http://www.freebloggertemplate.info/2011/10/videoblog-free-premium-blogger-template.html
    This template uses the iframe embedding for youtube videos. But what i want is to use

    endofvid[startext][endtext]
    automatic embedding option in this template. I am not a coder so it was quite impossible for me. So i tried this tutorial made by simplexdesign on how to auto embed videos in blog posts http://www.thesimplexdesign.com/2011/10/create-post-summary-for-video-post.html
    But the problem is this the tutorial is working on other templates but not on this one. I tried to contact the blogger template owner but he never replies. SO i am in a kind of stuck in the middle of nowhere..
    Anybody to help????? Thanks in advance...

    Posted 2 months ago #
  2. aneesh

    site admin
    Joined: Jul '09
    Posts: 232

    i think this trend of using these short codes started off with the Blogger Tube templates.

    It's always better to use the actual embed code rather than using short codes. These short codes will never work on your feeds.The short codes won't work if JavaScript is disabled. They need JavaScript to convert the short code into the actual embed code.

    Are you still sure that you wanna go ahead with this style of posting?

    Posted 2 months ago #
  3. some1

    new member
    Joined: Dec '11
    Posts: 4

    Hello Aneesh,
    First of all thank you for your reply. Yes this trend started with the Blogger Tube template & it is very easy to use this three codes. And yes I am sure that I want to use this style of posting. Can you help me out?

    Posted 2 months ago #
  4. aneesh

    site admin
    Joined: Jul '09
    Posts: 232

    i won't recommend using this.
    anyway here is the code.
    paste this above </head>

    <script type='text/javascript'>
    var img_thumb_width=192;
    var img_thumb_height=120;

    function createVideoThumb(pID,postlink){
    var div = document.getElementById(pID);
    if (div.innerHTML.indexOf("http://www.youtube.com/watch?v=")!=-1){
    var vidid = div.innerHTML.substring(div.innerHTML.indexOf("http://www.youtube.com/watch?v=")+31,div.innerHTML.indexOf("endofvid"));
    }else {var vidid =""};

    if (vidid ==""){var imgvid ='';
    }else{
    var imgvid ='';
    };

    div.innerHTML =imgvid;
    }

    function createVideoThumb2(pID,postlink){
    var div = document.getElementById(pID);
    var imgtag = "";
    if (div.innerHTML.indexOf("http://www.youtube.com/watch?v=")!=-1){
    var vidid = div.innerHTML.substring(div.innerHTML.indexOf("http://www.youtube.com/watch?v=")+31,div.innerHTML.indexOf("endofvid"));
    }else {var vidid =""};

    var textinside = div.innerHTML.substring(div.innerHTML.indexOf("[starttext]")+11,div.innerHTML.indexOf("[endtext]"));
    var embedvid = "";
    if (vidid!="") {
    embedvid = '<object width="654" height="393"><param name="movie" value="http://www.youtube.com/v/'+ vidid + '&hl=en&fs=1&rel=0&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+ vidid + '&hl=en&fs=1&rel=0&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="654" height="393"></embed></object>'
    }
    var summary = embedvid + '<div class="content">' + textinside + '</div>';
    div.innerHTML = summary;
    }

    </script>

    and replace <data:post.body/>
    with
    <div expr:id='"summary" + data:post.id'>
    <data:post.body/>
    </div>
    <b:if cond='data:blog.pageType == "index"'>
    <script type='text/javascript'>
    createVideoThumb("summary<data:post.id/>","<data:post.url/>");
    </script>
    <b:else/>
    <script type='text/javascript'>
    createVideoThumb2("summary<data:post.id/>","<data:post.url/>");
    </script>
    </b:if>

    Posted 2 months ago #

RSS feed for this topic

Reply

You must log in to post.