Template:Jmol general: Difference between revisions

From SklogWiki
Jump to navigation Jump to search
(New page: {|name="userboxes" id="userboxes" style="margin-left: 1em; margin-bottom: 0.5em; width: 170px; border: {{{bordercolor|#99B3FF}}} solid 1px; background-color: {{{backgroundcolor|#FFFFFF}}};...)
 
m (Reverted edits by Carl McBride (talk) to last revision by AngelHerraez)
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
Useage:<nowiki> {{Jmol_general|File.etc|Caption}}</nowiki>
<s>THIS TEMPLATE DOES NOT WORK</s>.
I do not know how to (or even if it is possible) to pass template arguments to <wikiPageContents>.
I.e. 1 is not substituted in the <wikiPageContents>{{{1}}}</wikiPageContents> container.
wikiPageContents takes {{{1}}} literally. Not sure how to change this, perhaps a small rewriting in Jmol.body.php? --[[User:Carl McBride | <b><FONT COLOR="#8B3A3A">Carl McBride</FONT></b>]] ([[User_talk:Carl_McBride |talk]]) 13:28, 28 August 2008 (CEST)
: '''SOLVED'''. Wikitext inside the Jmol Extension markup was not being interpreted. The fix is to use <code><nowiki>#tag</nowiki></code> syntax, available since MediaWiki 1.12:
:: substitute <code><nowiki><jmol></nowiki></code> by <code><nowiki>{{#tag:jmol|</nowiki></code>
:: substitute <code><nowiki></jmol></nowiki></code> by <code><nowiki>}}</nowiki></code>
:--[[User:AngelHerraez|AngelHerraez]] 12:24, 25 May 2009 (CEST)
Note that in this template page the JmolApplet will display an error (because it has no proper content loaded into it), but it will work in any page that inserts the template.
</noinclude>
{|name="userboxes" id="userboxes" style="margin-left: 1em; margin-bottom: 0.5em; width: 170px; border: {{{bordercolor|#99B3FF}}} solid 1px; background-color: {{{backgroundcolor|#FFFFFF}}}; {{{extra-css|}}}" align="right"
{|name="userboxes" id="userboxes" style="margin-left: 1em; margin-bottom: 0.5em; width: 170px; border: {{{bordercolor|#99B3FF}}} solid 1px; background-color: {{{backgroundcolor|#FFFFFF}}}; {{{extra-css|}}}" align="right"
|-
|-
|<center>
|<center>
<jmol>
{{#tag:jmol|
   <jmolApplet>
   <jmolApplet>
   <script>set spin X 10; spin on</script>
   <script>set spin X 10; spin on</script>
   <size>200</size>
   <size>200</size>
   <color>lightgrey</color>
   <color>lightgrey</color>
     <wikiPageContents>{{1}}.pdb</wikiPageContents>
     <wikiPageContents>{{{1}}}</wikiPageContents>
  </jmolApplet>
  </jmolApplet>
</jmol></center>  
}}</center>  
|-
|-
| <center>{{1}}</center>
| <center>{{{2}}}</center>
|-
|-
|}
|}
<noinclude>[[category: Template]]</noinclude>

Latest revision as of 19:50, 6 February 2015

Useage: {{Jmol_general|File.etc|Caption}}


THIS TEMPLATE DOES NOT WORK. I do not know how to (or even if it is possible) to pass template arguments to <wikiPageContents>. I.e. 1 is not substituted in the <wikiPageContents>{{{1}}}</wikiPageContents> container. wikiPageContents takes {{{1}}} literally. Not sure how to change this, perhaps a small rewriting in Jmol.body.php? -- Carl McBride (talk) 13:28, 28 August 2008 (CEST)

SOLVED. Wikitext inside the Jmol Extension markup was not being interpreted. The fix is to use #tag syntax, available since MediaWiki 1.12:
substitute <jmol> by {{#tag:jmol|
substitute </jmol> by }}
--AngelHerraez 12:24, 25 May 2009 (CEST)

Note that in this template page the JmolApplet will display an error (because it has no proper content loaded into it), but it will work in any page that inserts the template.


<jmol>

 <jmolApplet>
 <script>set spin X 10; spin on</script>
 <size>200</size>
 <color>lightgrey</color>
   <wikiPageContents>{{{1}}}</wikiPageContents>
</jmolApplet>
</jmol>
{{{2}}}