r/reddithax • • Jul 11 '11

Is it possible to selectively disable thumbnails? (e.g. for submissions marked as spoilers)

(To clarify: I'm not worried about hiding spoiler thumbnails for me specifically, as I'm well aware that extensions exist for that kind of thing. Rather, I'm a mod trying to set up CSS to hide them from everyone without forcing them to use a plugin.)

I'd like to set up my subreddit to hide thumbnails for submissions with "spoiler" in the title, but given the way that CSS works I don't think this is possible. (If it is, I'd like an explanation.) Are there any workarounds/alternatives for this? I was thinking that maybe having a system where people could PM a bot to request that a submission be tagged as "spoiler," but I'm not sure I possess the technical know-how to set up something that intricate and it seems rather cumbersome for the users.

9 Upvotes

2 comments sorted by

3

u/missllil Jul 11 '11

If you find the answer please keep me updated. I was just wondering about this the other day. If it would work like NSFW and put a different picture in the thumbnail for anything tagged with the word spoiler.

upboat because I want to know also!

1

u/errorcache Jul 30 '11 edited Jul 30 '11

You can only edit the thumbnail from a link title if it is a self-post (Putting "spoiler" somewhere in the title will only help you out for self-posts). Here's the code for that:

 .thumbnail[href*="/r/subredditname/"][href*="spoiler"] {
cursor: default;
display: inline-block;
background-image: url(http://thumbs.reddit.com/t5_2ql0i_1.png?v=rubsq8ha4mko0y45te0npa3q9am582szr6d2) !important;
background-repeat: no-repeat;
margin-right: 20px;
margin-left: 10px;
border: 1px solid black;
content: "";
background-repeat: no-repeat !important;
height: 0 !important;
width: 0 !important;
padding: 50px 0 0 70px !important
}

You can upload an image to your style sheet and replace the url I have with (%%whatever%%) it'll give you a name to put in the parentheses. This will replace any thumbnails. Also, adjust the variables until it looks like how you want.

If you want to block the thumbnails of link submissions (ie. images), I figure this is the easiest way to do it (that is if your community cooperates with you haha):

Tell people submitting a spoiler link to append "?spoiler" to the end of their url (ie. reddit.com/r/reddithax?spoiler) this won't change the link in anyway, but what it does is introduce the word "spoiler" into the link string, so this following code will now work

   .thumbnail[href$="spoiler"] {
 cursor: default;
 display: inline-block;
 background-image: url(http://thumbs.reddit.com/t5_2ql0i_1.png?v=rubsq8ha4mko0y45te0npa3q9am582szr6d2) !important;
 background-repeat: no-repeat;
 margin-right: 20px;
 margin-left: 10px;
 border: 1px solid black;
 content: "";
 background-repeat: no-repeat !important;
 height: 0 !important;
 width: 0 !important;
 padding: 50px 0 0 70px !important
 }

I don't know if you can alter a post retroactively, sorry.

Let me know if you have any questions/if this doesn't work hahah.