Combine Proteopedia scenes with inline JSmol scripting: Difference between revisions
m tag code better |
mNo edit summary |
||
Line 5: | Line 5: | ||
Let’s assume that the green link to your scene is <code><nowiki><scene name='41/413146/start_view/1'>Starting view</scene></nowiki></code>. You need to add <nowiki>load /wiki/scripts/</nowiki> before the name and <code><nowiki>.spt</nowiki></code> after it, as follows: | Let’s assume that the green link to your scene is <code><nowiki><scene name='41/413146/start_view/1'>Starting view</scene></nowiki></code>. You need to add <nowiki>load /wiki/scripts/</nowiki> before the name and <code><nowiki>.spt</nowiki></code> after it, as follows: | ||
<code> | |||
<nowiki> | |||
<jmol><jmolLink> | |||
<script> | |||
load /wiki/scripts/41/413146/Space_fill/1.spt | |||
… <additional JSmol scripted steps> … | |||
</script> | |||
<text>text to be the green scene link text</text> | |||
</jmolLink> | |||
</jmol> | |||
</nowiki> | |||
</code> |
Revision as of 01:21, 30 December 2020
Advanced users may wish to call up a scene saved via Proteopedia from within inline JSmol scripts placed in a page. For example, this can be useful for some pages that use multiple structures to call up a certain scene at the start of JSmol script be sure the user has the structure or scene open that you wish the inline JSmol script to build upon.
To do this, you need the scene name as provided by the Scene Authoring Tools.
Then to load that scene from within any script follow these instructions:
Let’s assume that the green link to your scene is <scene name='41/413146/start_view/1'>Starting view</scene>
. You need to add load /wiki/scripts/ before the name and .spt
after it, as follows:
<jmol><jmolLink>
<script>
load /wiki/scripts/41/413146/Space_fill/1.spt
… <additional JSmol scripted steps> …
</script>
<text>text to be the green scene link text</text>
</jmolLink>
</jmol>