Extension talk:ToggleDisplay

From mediawiki.org
Latest comment: 13 years ago by Roberthaenel in topic Template variables within <toggledisplay>


Collapsible elements do NOT work by default in 1.18 and above for older skins. We still need this extension as there is no migration guide for older skins!!

Nice example[edit]

I've found a nice use for this extension. You can make a Preview link to view other wiki pages. Here is an example of the code. The code doesn't work on Mediawiki.org because the extension isn't installed here. A working copy can be found here

'''[[Main Page]]''' <toggledisplay showtext="Preview" hidetext="Hide Preview">
<div style="background-color:#e0e0e0; border-style: ridge; border-color: #bbb; padding:0px 15px 15px 15px;">
{{:Main Page}}

Another Use[edit]

A simple show hide box using this extension, parameters are easy to change to suit your needs, tried and works on version 1.12 and 1.13.5.

{|cellspacing="0" cellpadding="0" width=100% style="border:1px solid #b0c4de; padding:0px;"
| colspan="2" style="background:#f7f7f7; text-align:right; padding:0px; " |
<h5 style="margin:.5em; margin-top:.1em; border-bottom:0; font-weight:normal;">
'''Content Title''' <toggledisplay status=hide showtext="[show]" hidetext="[hide]" linkstyle font-size="8px"><div style="background-color:#FAFAFA; border: 1px solid transparent; padding:0px 5px 5px 5px;">
<div style="text-align:left;ltr;margin-left:1em;">


This is a very helpful example, thank you. --Robinson Weijman 14:32, 1 March 2010 (UTC)Reply[reply]

Nesting ToggleDisplay Tags[edit]

Seems to be broken. =( --J.nesta 05:33, 5 November 2009 (UTC)Reply[reply]

I found it worked like this:
hidden text 1
hidden text 2
hidden text 3

--Robinson Weijman 14:23, 1 March 2010 (UTC)Reply[reply]

show/hide all[edit]

Is there any way to show/hide all hideable divs in a page? The reason I want this is that for browsing a large page, I want everything hidden, but ctrl-f search does not find content in invisible elements, so I'd like to be able to quickly expand and then hide everything again. It's probably not too hard to write a bookmarklet that does this, but I'd prefer a javascript link. If it's not already available, can anyone give me a hint how to go about implementing it? It can't be that much work to do it, so I'll gladly try if anyone can point me in the right direction. 19:20, 17 November 2009 (UTC)Reply[reply]

Uggly Warning[edit]

I got the following warning in the wiki, if i install ToggleDisplay:

Warning: Cannot modify header information - headers already sent by (output started at [...]/mediawiki-1.15.1/extensions/ToggleDisplay/ToggleDisplay.php:102) 
in [...]/includes/WebResponse.php on line 16

After using "<toogledisplay>" the first time i see only this warning and no wikipage anymore.

Thanks for any hints how i get rid of this! --benni

Check your ToggleDisplay.php file and remove all blank linkes before the <?php and after the ?> tag. 16:42, 27 September 2010 (UTC)Reply[reply]

Icon instead of text[edit]

Hi-Thanks for the extension, perfect for FAQ's. I was wondering if there was a way to add an icon/image in place of the text to show/hide content? Thanks. --Demetelski 16:24, 23 May 2010 (UTC)Reply[reply]

Template variables within <toggledisplay>[edit]

On my test site, this template line:

List of [[Has Make::{{{Make|}}}]] [[Has Model::{{{Model|}}}]]s from [[Has Year::{{{Year|}}}]]


List of Honda Acords from 2000

when run from a particular page. But this fails

<toggledisplay showtext="Show Information" hidetext="Hide Information">
List of [[Has Make::{{{Make|}}}]] [[Has Model::{{{Model|}}}]]s from [[Has Year::{{{Year|}}}]]


Hide Information
List of s from

when expanded. Is this an understood issue, is there a mechanism to get around it, or is it a bug?

I'm using

MediaWiki  	1.15.1
PHP             5.2.10-pl0-gentoo (apache2handler)
MySQL           5.0.70-log
ToggleDisplay   Version 0.121

- skew

I think this is due to the way the MediaWiki parser handles tags. Basically, you cannot access template variables within tags (at least in 15.1). By the way, I consider this extension obsolete because NavFrame provides very similar functionality with means of MediaWiki itself. RV1971 10:03, 9 June 2010 (UTC)Reply[reply]
Thanks for the reply. I started with NavFrame, but the way I have my data formatted it doesn't do what I need it to. Too bad about ToggleDisplay, aesthetically it's one of the best solutions. - skew
Hi skew. You might want to check out Extension:ToggleDisplay2, which is an enhanced version of this extension that is able to be used in templates (MediaWiki 1.16 is required, though). --Roberthaenel 02:43, 10 December 2010 (UTC)Reply[reply]

I installed ToggleDisplay2 Robert and got an error stating I was missing argument 4 on I believe line 48 ($frame) variable. Reverted back to original ToggleDisplay after testing. Jaylepore / Compumatter 9:18, 21, January 2011

Show hide text with variables[edit]

Hi, I'd like to use the show / hide text with a variable e.g. show={{var:variableOne}}. Anyone know how? When I try it just shows literally {{var:variableOne}} instead of the value. --Robinson Weijman 13:38, 11 October 2010 (UTC)Reply[reply]