User:AngelHerraez/Sandbox1: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| AngelHerraez (talk | contribs)  (test the new version of Jmol_general) | AngelHerraez (talk | contribs)  m (note about template Jmol_general2 deleted) | ||
| (3 intermediate revisions by the same user not shown) | |||
| Line 23: | Line 23: | ||
|   <nowiki>{{Jmol_general|File.etc|Caption}}</nowiki> |   <nowiki>{{Jmol_general|File.etc|Caption}}</nowiki> | ||
| Let's try that: | But that was failing to work due to the parameter inserted inside the Jmol markup. | ||
|   <nowiki>{{Jmol_general2|Water.pdb|A model of water}}</nowiki> | |||
| I have found a method to circumvent that using the <nowiki>#tag</nowiki> syntax. Let's try that: | |||
|   <nowiki>{{Jmol_general2|Water.pdb|A model of water}} | |||
| {{Jmol_general2|Ethylene_glycol.pdb|Ethylene glycol is a common antifreeze product}}</nowiki> | |||
| {{Jmol_general2|Water.pdb|A model of water}} | {{Jmol_general2|Water.pdb|A model of water}} | ||
| {{Jmol_general2|Ethylene_glycol.pdb|Ethylene glycol is a common antifreeze product}} (this template is now obsolete and has been deleted) | |||
| <div style="clear:both"> | |||
| The fix is now included in the standard template, <nowiki>{{Jmol_general}}/nowiki>: | |||
|  <nowiki>{{Jmol_general|Water.pdb|A model of water}}</nowiki> | |||
| {{Jmol_general|Water.pdb|A model of water}} | |||
| </div> | |||
Latest revision as of 10:50, 26 May 2009
This is the method currently used at SklogWiki to insert a JmolApplet:
<jmol>
  <jmolApplet>
  <script>set spin X 10; spin on</script>
  <size>200</size>
  <color>lightgrey</color>
    <wikiPageContents>Water.pdb</wikiPageContents>
 </jmolApplet>
</jmol>
<jmol>
<jmolApplet> <script>set spin X 10; spin on</script> <size>200</size> <color>lightgrey</color> <wikiPageContents>Water.pdb</wikiPageContents> </jmolApplet>
</jmol>
That is OK, but is a little hard on the users, who need to know the markup and insert it properly into the page.
A better solution is to have a template that inserts the code and uses a more friendly format like
{{Jmol_general|File.etc|Caption}}
But that was failing to work due to the parameter inserted inside the Jmol markup.
I have found a method to circumvent that using the #tag syntax. Let's try that:
{{Jmol_general2|Water.pdb|A model of water}}
{{Jmol_general2|Ethylene_glycol.pdb|Ethylene glycol is a common antifreeze product}}
Template:Jmol general2 Template:Jmol general2 (this template is now obsolete and has been deleted)
The fix is now included in the standard template, {{Jmol_general}}/nowiki>: <nowiki>{{Jmol_general|Water.pdb|A model of water}}
| <jmol> <jmolApplet> <script>set spin X 10; spin on</script> <size>200</size> <color>lightgrey</color> <wikiPageContents>Water.pdb</wikiPageContents> </jmolApplet></jmol> |