Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Tutorial : Create spoilers in Blogger

views
     
TSIcedNyior
post May 18 2008, 08:44 AM, updated 18y ago

Regular
******
Senior Member
1,768 posts

Joined: Feb 2008


This is for you folks who host your blogs on blogger and have blogspot.com in your blog URL. It requires a little more work and is a bit complicated so listen up.

Part 1 :Editing the Theme

First of all, go to your Dashboard >> Template >> Edit HTML

Then look for this line: ]]></b:skin> and </head> . There are two parts of codes.

First part, insert this code BEFORE ]]></b:skin>
CODE

   .commenthidden {display:none;}
   .commentshown {display:inline;}


Then add this code AFTER ]]></b:skin> and BEFORE </head>
CODE

<script type="text/Javascript">

function togglecomments (postid) {

var whichpost = document.getElementById(postid);

if (whichpost.className=="commentshown") { whichpost.className="commenthidden"; } else { whichpost.className="commentshown"; }

} </script>


Your HTML coding should now look like this. Don't worry about the difference in the symbol " and " because it means the same thing. Example:
user posted image

Save settings. Thats one part done. Phew!

Part 2 : Creating spoilers in blog post

To add spoilers to your blog post, click Create A Post and click Edit Html (its on the top right next to �Compose�). Then add this bit of code:
CODE

<a aiotitle="click to expand" href="javascript:togglecomments('SPOILER_NAME')">Click me to read spoilers</a>

<div class="commenthidden" id="SPOILER_NAME">put your hidden text here</div>


You can change SPOILER_NAME to anything you want but make sure that they are both EXACTLY the same. The <a aiotitle> and <div> dont have to be close to each other, as long as they are in the same post and have the exact same name. It will work.

Good luck and I hope this tutorial helps!

EDIT:I changed the javascript code because there were some errors when you save the HTML. Make sure when you write your post its in EDIT HTML mode and not Compose mode
.

~~~~~~~~~~~~~~~
Adapted from my blog post : Create spoilers in Blogger and Wordpress

Read my other tutorial on LYN> Tutorial : Hide/Encrypt posts in Blogger (+pics)


This post has been edited by IcedNyior: Aug 13 2008, 07:25 AM
ali_boulala
post May 18 2008, 09:40 AM

Lets put a smile on that face
*****
Senior Member
764 posts

Joined: Mar 2007
From: ur HDD (im the latest virus)


icednyior dah wat tutorial skrg laugh.gif
orenzai
post May 18 2008, 01:28 PM

Look at all my stars!!
*******
Senior Member
3,114 posts

Joined: Dec 2006


can i have a sample of how it looks like? thank you

djzen
post May 18 2008, 03:18 PM

Startup life!
*******
Senior Member
2,873 posts

Joined: Nov 2005


its in the blog.
TSIcedNyior
post May 18 2008, 10:10 PM

Regular
******
Senior Member
1,768 posts

Joined: Feb 2008


wait ah..i seem to hv problem with the code. It worked 2 mths ago :|

got it. changed the javascript code. MAke sure when you write your post its in EDIT HTML mode and not Visual mode


Added on May 18, 2008, 10:28 pm
QUOTE(orenzai @ May 18 2008, 01:28 PM)
can i have a sample of how it looks like? thank you
*
This is what it looks like when you write a post in EDIT HTML mode
user posted image

This is how it looks like in COMPOSE mode
user posted image

This is how the actual post looks like before you expand it
user posted image

After expanding
user posted image


This post has been edited by IcedNyior: May 18 2008, 10:28 PM
orenzai
post May 18 2008, 10:57 PM

Look at all my stars!!
*******
Senior Member
3,114 posts

Joined: Dec 2006


brilliant!! thats what i have been looking for...thanks
Nation of Sensation
post May 19 2008, 12:20 AM

On my way
****
Senior Member
554 posts

Joined: Nov 2006
From: 127.0.0.1
Any idea on how to make a spoiler such as the same one that this board uses for Wordpress?.....

» Click to show Spoiler - click again to hide... «

TSIcedNyior
post May 19 2008, 12:43 AM

Regular
******
Senior Member
1,768 posts

Joined: Feb 2008


Im not so sure but I think you can create a new class in your CSS then specify things like the box and the "Spoiler > Click Me" graphic
orenzai
post May 27 2008, 10:01 PM

Look at all my stars!!
*******
Senior Member
3,114 posts

Joined: Dec 2006


how come when i click on the spoiler it says error 404 not found?
TSIcedNyior
post May 28 2008, 12:11 AM

Regular
******
Senior Member
1,768 posts

Joined: Feb 2008


I recently edited the code on 18 may to put into your template coz hte previous ones had probs.

Put this before ]]></b:skin>
CODE
.commenthidden {
display:none;
}
.commentshown {
display:inline;
}


And this after ]]></b:skin>
CODE

<script type='text/Javascript'>

function togglecomments (postid) {

var whichpost = document.getElementById(postid);

if (whichpost.className==&quot;commentshown&quot;) { whichpost.className=&quot;commenthidden&quot;; } else { whichpost.className=&quot;commentshown&quot;; }

} </script>


its still functioning on my blog. Here's the example

http://spoilers-in-blogger.blogspot.com/

This post has been edited by IcedNyior: Aug 29 2008, 04:40 AM
Pmc
post Jun 16 2008, 12:28 PM

(╯°□°)╯︵ ┻━┻
******
Senior Member
1,182 posts

Joined: Oct 2007
From: Asgard


nice guide!

This post has been edited by Pmc: Jun 16 2008, 12:28 PM
selinix
post Aug 13 2008, 01:54 AM

Look at all my stars!!
*******
Senior Member
7,343 posts

Joined: May 2005

seems like it is not functioning anymore..
TSIcedNyior
post Aug 13 2008, 02:34 AM

Regular
******
Senior Member
1,768 posts

Joined: Feb 2008


i'll test it tomorrow and try to find a solution k?
eXPeri3nc3
post Aug 13 2008, 02:53 AM

It's coming! 3ɔu3ıɹǝdxǝ ♥
*******
Senior Member
9,257 posts

Joined: Aug 2005
From: Not so sure myself Status: 1+3+3=7



QUOTE(IcedNyior @ Aug 13 2008, 02:34 AM)
i'll test it tomorrow and try to find a solution k?
*
Lol it's the same concept for what I'm testing over in my blogspot. Just that I'm using it for navigations... I believe I can do it for posts as well.
selinix
post Aug 13 2008, 05:22 AM

Look at all my stars!!
*******
Senior Member
7,343 posts

Joined: May 2005

QUOTE(eXPeri3nc3 @ Aug 13 2008, 02:53 AM)
Lol it's the same concept for what I'm testing over in my blogspot. Just that I'm using it for navigations... I believe I can do it for posts as well.
*
Is it working then ?? If yes hope you can share the method with me ... smile.gif
cracksys
post Aug 13 2008, 05:39 AM

I'm a Vault Dweller!!
*******
Senior Member
3,668 posts

Joined: Jun 2006
From: Bikini Abyss


is it like this ?

http://wackified.blogspot.com/

» Click to show Spoiler - click again to hide... «

TSIcedNyior
post Aug 13 2008, 07:20 AM

Regular
******
Senior Member
1,768 posts

Joined: Feb 2008


just tested it out on my test blog. it still works.

link > http://spoilers-in-blogger.blogspot.com/

QUOTE(cracksys @ Aug 13 2008, 05:39 AM)
is it like this ?

http://wackified.blogspot.com/

» Click to show Spoiler - click again to hide... «

*
in your blog, you used this tip in Blogger Help for read more. This code that I gave above is for spoilers

shameless blog plugging I see tongue.gif

This post has been edited by IcedNyior: Aug 29 2008, 04:40 AM
selinix
post Aug 13 2008, 02:10 PM

Look at all my stars!!
*******
Senior Member
7,343 posts

Joined: May 2005

Yeah.. is working already .. When, I tried it yesterday and check your test blog it is not working..
lil`pumpkinz
post Aug 13 2008, 02:27 PM

私はデビッド愛
*****
Senior Member
869 posts

Joined: Jan 2008



Iced, I'm so rclxub.gif rclxub.gif
TSIcedNyior
post Aug 13 2008, 05:38 PM

Regular
******
Senior Member
1,768 posts

Joined: Feb 2008


QUOTE(selinix @ Aug 13 2008, 02:10 PM)
Yeah.. is working already .. When, I tried it yesterday and check your test blog it is not working..
*
sorry that was coz I was testing a different template at the time and didnt put the code in

QUOTE(lil`pumpkinz @ Aug 13 2008, 02:27 PM)
Iced, I'm so rclxub.gif rclxub.gif
*
Why? Do it slowly and step by step. If you need more help, do pm me biggrin.gif

2 Pages  1 2 >Top
 

Change to:
| Lo-Fi Version
0.0172sec    0.52    5 queries    GZIP Disabled
Time is now: 2nd December 2025 - 03:00 PM