Can templates include non-wiki codes? I am trying to add a link calling a javascript function. It works fine when added to the article itself, but template does not seem to work. Thanks!
-- details: wiki: <html><a href="javascript:function('ID')">LINK</a> <div id="ID">TEXT</div></html>
template try: <html><nowiki><a href=javascript:showhide('{{{ID}}}')">{{{LINK}}}</a> <div id="{{{ID}}}">{{{TEXT}}}</div></nowiki></html>
wiki using template: {{TEMPLATE_NAME|ID=someid |LINK=somelink |TEXT=sometext}}
Try subst:ing in your test template and see if you have any syntax errors. ----- Original Message ----- From: "Liz Kim" lizkim270@gmail.com To: "Wikimedia developers" wikitech-l@wikimedia.org Sent: Friday, October 27, 2006 2:40 PM Subject: [Wikitech-l] templates: javascript+html?
Can templates include non-wiki codes? I am trying to add a link calling a javascript function. It works fine when added to the article itself, but template does not seem to work. Thanks!
-- details: wiki:
<html><a href="javascript:function('ID')">LINK</a> <div id="ID">TEXT</div></html>
template try:
<html><nowiki><a href=javascript:showhide('{{{ID}}}')">{{{LINK}}}</a> <div id="{{{ID}}}">{{{TEXT}}}</div></nowiki></html>
wiki using template: {{TEMPLATE_NAME|ID=someid |LINK=somelink |TEXT=sometext}} _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
On 10/27/06, Liz Kim lizkim270@gmail.com wrote:
template try:
<html><nowiki><a href=javascript:showhide('{{{ID}}}')">{{{LINK}}}</a> <div id="{{{ID}}}">{{{TEXT}}}</div></nowiki></html>
Try <html><nowiki><a href=javascript:showhide('</html>{{{ID}}}<html>')"></html>{{{LINK}}}<html></a> <div id="</html>{{{ID}}}<html>"></html>{{{TEXT}}}<html></div></nowiki></html> (untested).
Regards, - Dan Li
Nope.. that did not work out either. I wonder if there is a variable I need to enable in Localsettings?
On 10/27/06, Dan Li dto@dev.java.net wrote:
On 10/27/06, Liz Kim lizkim270@gmail.com wrote:
template try:
<html><nowiki><a href=javascript:showhide('{{{ID}}}')">{{{LINK}}}</a> <div id="{{{ID}}}">{{{TEXT}}}</div></nowiki></html>
Try <html><nowiki><a
href=javascript:showhide('</html>{{{ID}}}<html>')"></html>{{{LINK}}}<html></a>
<div id="</html>{{{ID}}}<html>"></html>{{{TEXT}}}<html></div></nowiki></html> (untested).
Regards,
- Dan Li
Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org