Help:Contents: Difference between revisions

From bradwiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
*[http://www.onesci.com/Help:Contents OneSci Help]
*[http://www.onesci.com/Help:Contents OneSci Help]


Line 7: Line 4:


*[http://www.mediawiki.org/wiki/Help:Magic_words Magic Words]
*[http://www.mediawiki.org/wiki/Help:Magic_words Magic Words]
*[http://www.mediawiki.org/wiki/Extension:Secure_HTML Secure HTML]




Line 38: Line 32:




==HTML Extension==
==HTML ==
*[http://www.mediawiki.org/wiki/Extension:HTML_Tags HTML Extension]


===Example===
===Example===


<nowiki>
<nowiki>
<htmltag tagname="a" href="http://en.wikipedia.org/wiki/Antarctica" class="my-links">Read about Antarctica</htmltag>
<iframe src="http://www.neuinfo.org/downloads/nif_navigator_1.2/nif_navigator.html" height="800" width="250" frameborder="0" seamless="seamless"></iframe>
</nowiki>
</nowiki>


<nowiki>
<html>
<htmltag tagname="iframe" src="http://www.neuinfo.org/downloads/nif_navigator_1.2/nif_navigator.html" height="800" width="250" seamless="seamless"></htmltag>
<iframe src="http://www.neuinfo.org/downloads/nif_navigator_1.2/nif_navigator.html" height="800" width="250" frameborder="0" seamless="seamless"></iframe>
</nowiki>
</html>
 
<htmltag tagname="iframe" src="http://www.neuinfo.org/downloads/nif_navigator_1.2/nif_navigator.html" height="800" width="250" seamless="seamless"></htmltag>


===iFrame Attributes===
===iFrame Attributes===
Line 89: Line 80:
| width || pixels || Specifies the width of an iframe
| width || pixels || Specifies the width of an iframe
|}
|}
===Local Settings===
To add an HTML tag you need to specify the allowed set of HTML tags, and the allowed set of attributes for each one, using the global variable '''$wgHTMLTagsAttributes'''. For instance, to allow the <nowiki><a></nowiki> tag, and to allow only the attributes "href" and "class" for it, you would add the following to LocalSettings.php, after the inclusion of LocalSettings.php:
$wgHTMLTagsAttributes['a'] = array( 'href', 'class' );
If you wanted to allow the tag <nowiki><fieldset></nowiki>, but without any allowed attributes, you would add the following:
$wgHTMLTagsAttributes['fieldset'] = array();
===Usage===
Once a set of allowed tags and attributes are specified, you can use <nowiki><htmltag></nowiki> to place those tags on the page. You use the attribute "tagname" to specify the actual tag, and then add the other attributes exactly as you want them to appear. The "contents" of the tag become the contents of <nowiki><htmltag></nowiki>.
For instance, if the above lines are added, and you want to add a link on some page using the <nowiki><a></nowiki> tag, you could add something to the page like:
:<nowiki><htmltag tagname="a" href="http://en.wikipedia.org/wiki/Antarctica" class="my-links">Read about Antarctica</htmltag></nowiki>
This will add the following to the page's HTML source:
:<nowiki><a href="http://en.wikipedia.org/wiki/Antarctica" class="my-links">Read about Antarctica</a></nowiki>
Calling <nowiki><htmltag></nowiki> with a tag name that is not allowed will result in an error message; calling it with an attribute that is not allowed will simply lead to the attribute being ignored.

Revision as of 00:01, 12 May 2013


Image Annoation

<div class="wpImageAnnotatorEnable">
<span class="wpImageAnnotatorPageName" style="display:none;">Connectome</span>
<span class="wpImageAnnotatorFullName" style="display:none;">Connectome</span>
<div class="wpImageAnnotatorFile">[[File:Brainatlas1.jpg|640px]]</div>
<div style="display:none;"><div><div><!--Dummy marker to have image notes inserted below this line-->{{ImageNoteEnd|id=-1}}
</div>
</div>


Livelets

To create livelets, wrap any areas of the page in the #live parser-function.

In the following example, a transclusion of the page called Template:MyVerySlowTable has been turned into a livelet:

{{#live: {{MyVerySlowTable}} }}


HTML

Example

<iframe src="http://www.neuinfo.org/downloads/nif_navigator_1.2/nif_navigator.html" height="800" width="250" frameborder="0" seamless="seamless"></iframe>

<html> <iframe src="http://www.neuinfo.org/downloads/nif_navigator_1.2/nif_navigator.html" height="800" width="250" frameborder="0" seamless="seamless"></iframe> </html>

iFrame Attributes

<iframe src="http://www.w3schools.com" name="test2" frameborder="0" height="120" width="600" scrolling="yes">You need a Frames Capable browser to view this content.</iframe>

Attribute Value Description
align left, right, top, middle, bottom Specifies the alignment of an iframe according to surrounding elements
frameborder 1, 0 Specifies whether or not to display a border around an iframe
height pixels Specifies the height of an iframe
longdesc URL Specifies a page that contains a long description of the content of an iframe
marginheight pixels Specifies the top and bottom margins of the content of an iframe
marginwidth pixels Specifies the left and right margins of the content of an iframe
name name Specifies the name of an iframe
sandbox "", allow-forms, allow-same-origin, allow-scripts, allow-top-navigation Enables a set of extra restrictions for the content in the iframe
scrolling yes, no, auto Specifies whether or not to display scrollbars in an iframe
seamless seamless Specifies that the iframe should look like it is a part of the containing document
src URL Specifies the address of the document to embed in the iframe
srcdoc HTML_code Specifies the HTML content of the page to show in the iframe
width pixels Specifies the width of an iframe