• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Add-on Reddit-esque Spoiler Tagging

JABRONI

Well-known member
#1
I'm looking to get an add-on that allows for spoilering like the site, Reddit.com uses. Willing to pay. Being able to spoiler the titles of threads would be the biggest part I'd need. Here is an example of what I need,

Screen Shot 2013-03-11 at 10.05.33 AM.png

Screen Shot 2013-03-11 at 10.05.57 AM.png
 

JABRONI

Well-known member
#3
Why not use a spoiler Bb Code?
I run a wrestling site & using the regular big spoiler code isn't practical when writing in paragraphs. We just need to spoiler out small tidbits like the name of the winner or anything like that.

Being able to spoiler the titles of threads would be the biggest part I'd need.

i.e

Last night at TNA's big pay-per-view, Lockdown, we saw
win his match against
& we had one of the biggest reveals in the history of the company. The outcome of that match really sets the tone for TNA going forward. I think a lot of people saw it coming, but were still surprised. I, personally, was very surprised at the amount of beer bottles & cans thrown into the ring after the reveal. It was an absolutely incredible moment for TNA, and for the fans that have been supporting TNA in the past year.
 

Brogan

XenForo moderator
Staff member
#4
A quick workaround would be to colour the text the same as the background - members can do this manually or you could create a BB Code tag to do it.

Of course, if you have more than one style with different background colours that won't work.

Although if you use an @style_property in the BB Code tag it might - I haven't tested whether that would work.
 

cclaerhout

Well-known member
#5
Of course, if you have more than one style with different background colours that won't work.
No it will, your solution is the good one. Jabroni just needs a basic spoiler bbcode wrapped inside a span tag to avoid line breaks and use the xen property @contentBackground both on the background & on the text color on the normal state, then on the hover state, use the @contentText property on the text.
 

Brogan

XenForo moderator
Staff member
#6
I had a similar BB Code in the past but I also used characters so members were aware there was hidden text - like so: > hidden text <
 

JABRONI

Well-known member
#7
No it will, your solution is the good one. Jabroni just needs a basic spoiler bbcode wrapped inside a span tag to avoid line breaks and use the xen property @contentBackground both on the background & on the text color on the normal state, then on the hover state, use the @contentText property on the text.
This will work on thread titles also?
 

cclaerhout

Well-known member
#11
I'm not going to create an addon for this, so here are the steps to create what you need:

1) create a template called bbcode_mini_spoiler
Copy this code in it:
Code:
<xen:require css="bbcode_mini_spoiler.css" />
 
<span class="bb_mini_spoiler">{xen:raw $content}</span>
Save

2) create a template called bbcode_mini_spoiler.css
Copy this code in it:
Code:
.bb_mini_spoiler{
    padding:1px;
    border:1px dotted @contentText;
    background-color: @contentBackground;
    color: @contentBackground;
    cursor: pointer;
}
 
.bb_mini_spoiler:hover{
    color:@contentText;
}
Save

3) Create a Custom Bb Code with the Bbcm (use this version to be able to use templates)
First page
Title: Mini spoiler
Description:This is a mini spoiler
Tag:minispoiler
Example: The killer is [minispoiler]Jason[/minispoiler]

Second page (parser methods)
Template Method: enable
Template Name:bbcode_mini_spoiler
Save

It's done.
 

Attachments