WE MADE IT TO THE FINALS! NOW WE NEED YOUR VOTES MORE THAN EVER!!!Encyclopedia Dramatica is in contention for the 2nd Annual Mashable Open Web Awards for the wiki category. With your help, we can beat the Wikipedia menace! Plz vote for ED by going here; you can vote once per day, per email address, ballot stuffing encouraged! Just don't forget to confirm the vote via e-mail. VOTE OR DIE!!!
Encyclopedia Dramatica:Collapsing Objects
From Encyclopedia Dramatica
You now have the ability to create dynamically collapsing and expanding objects, tables, images, bridges, etc. It's more customizable and ultimately better than the collapsing tables those communists use. See {{gaming}} for an example. There are two ways to do this.
Contents |
[edit] More Customizable: Insert Tags Yourself
By inserting the tags yourself, you can completely customize the style and position of the click-to-collapse link and the object that collapses and expands.
Place the following code where you want the toggle link to appear. Replace uniqueName with a unique name. You're writing HTML code, you should be smart enough to figure something out there. PROTIP: Because of the way MediaWiki generates content, it can't be the same as any of the section names in the article.
<span id="uniqueNameLink" class="toggleLink"></span> <span id="uniqueNameCollapseText" style="display: none;">[Click to Collapse]</span> <span id="uniqueNameExpandText" style="display: none;">[Click to Expand]</span> <span id="uniqueNameInitialState" style="display: none;">0</span>
- The "xLink" span is where the automatically generated link will be created. Don't put anything between the span tags.
- The "xCollapseText" span contains the text to be displayed on the collapse link that hides the object; in this case, "[Click to Collapse]".
- The "xExpandText" span contains the text to be displayed on the expand link that displays the object; in this case, "[Click to Expand]".
- The "xInitialState" span contains a value that indicates the initial state. 0 is collapsed. Anything else is expanded. The default is collapsed, for blank or unrecognized characters, but the script assumes something is there so don't leave it blank.
Place the following id tag in the object that will be appearing and disappearing:
... id="uniqueName" ...
For example,
<span id="exampleLink" class="toggleLink"></span> <span id="exampleCollapseText" style="display: none;">[Click to Collapse Example]</span> <span id="exampleExpandText" style="display: none;">[Click to Expand Example]</span> <span id="exampleInitialState" style="display: none;">0</span> <div id="example" style="padding: 5px; border: 1px solid black;">Here's some stuff.</div>
gives you:
That's it, have fun.
[edit] Less Customizable: Use a Template
By using a template, you don't have to write any code yourself, you just have to come up with a unique name and fill in the blanks. If you're having trouble doing that, just roll your face on the keyboard when you get to the unique name field.
The syntax for {{co}} is:
{{co|A|B|C|D|E|F}}
A: Unique name to the page, no spaces.
B: The text to be displayed on the collapse link.
C: The text to be displayed on the expand lnk.
D: The initial state. 0 = collapsed, anything else = expanded.
E: The content to collapse and expand.
F: Style information for the collapsing content.
For instance,
{{co|qwerty|[Collapse Me]|[Expand Me]|1|Here's some stuff.|color: red; background-color: black; padding: 5px;}}
gives you:
[edit] Collapsing Sections
For ungainly large articles, it can help readability to collapse some of the larger sections. You can use the {{cs}} and {{cs2}} templates to accomplish this. {{cs}} is for the large size headers that mark article sections. {{cs2}} is for smaller headers that act as sub-sections.
Syntax:
{{cs|A|B|C|D}}
{{cs2|A|B|C|D}}
A: Unique name to the page, no spaces. Hint: The section name with no spaces works.
B: The section name.
C: The section content. May contain nested collapsable sections.
D: The initial state. 0 = collapsed, anything else = expanded.
For instance,
{{cs|testSectionOne|Test Section One|Here's some sample content under a large header.|0}}
{{cs2|testSectionTwo|Test Section Two|Here's some sample content under a small header.|0}}
gives you:
[edit] Test Section One
[edit] Test Section Two
[edit] Collapsing Galleries
While use of the {{cs}} template to hide especially large galleries has become popular, the preferred method of collapsing galleries is to use the {{cg}} template which clearly marks the section as a collapsing gallery and gives a preview of the gallery images. PROTIP: Make sure there aren't any spaces before or after the pipes in the template to ensure that this looks the same on every browser.
Syntax:
{{cg|A|B|C|D|E}}
A: Gallery title to be displayed in the black box
B: Unique name to the page. Hint: The gallery title with no spaces works fine.
C: Horizontal alignment of gallery on page. "left", "right", or "center".
D: Teaser gallery images. Must be enclosed in <gallery></gallery> tags and should be a multiple of four images.
E: Remaining gallery images. Must be enclosed in <gallery></galley> tags.
For instance,
{{cg|Galleria de Furfaggotry|furryGallery|center|<gallery>
Image:Sickfuckfurryhumor1.jpg|Typical furry's daily comic strip
Image:Lolanimalsex.jpg|Furries like sex with animals, as drawn by [[Arania]]
Image:Yiffinhellfurfag.jpg|Pro-yiffer propaganda disguised as harmless kiddie comics. WAKE UP AMERICA
Image:Judge Doom M 03.jpg|Scientists are currently thinking of ways to exterminate furfags.
</gallery>|<gallery>
Image:Furrybarf.jpg|Neutered furry without spaceballs?
Image:Times Travelled.jpg
Image:FurrySuck.jpg|Suck the furry's [[cock|rod]], [[bitch]]!
Image:Wheregodfurry.jpg|Where is your [[God]] now?
...
</gallery>}}
gives you:
| Galleria de Furfaggotry | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
