Wiki Tooltips December 4, 2005
Posted by admin in : Web Tech , trackbackCool, I added some new bells and whistles to the Fever here. Using a combination of MTMacro, MTIfEmpty, and Overlib, I have created a macro which will alow me to easily add tooltips to Amazon or Wikipedia.
Here’s a tooltip for the Wikipedia entry on Wikipedia itself: Wikipedia (pronounced as [ˌwiˑkiˈpidi.ə] or [ˌwɪki-], also [-ɐ]) is a multi-lingual Web-based free-content encyclopedia. It is written collaboratively by volunteers, allowing articles to be added or changed by anyone with an internet connection. The project began on January 15, 2001 as a complement to the expert-written Nupedia, and is now operated by the non-profit Wikimedia Foundation. The English-language version of Wikipedia currently has 849,313 articles. Wikipedia has steadily risen in popularity,[1] and has spawned several sister projects, such as Wiktionary, Wikibooks, and Wikinews. Wikipedia is widely considered an alternative to commercial encyclopedias.
Here’s the macro definition that I use to set up the custom tag:
<MTMacroDefine name="wikipedia" ctag="wikipedia"> <MTIfNotEmpty expr="[MTMacroContent]"> <a onmouseover="return overlib('<MTMacroContent>',STICKY, MOUSEOFF)" onmouseout="return nd();" href="http://en.wikipedia.org/wiki/<MTMacroAttr name='item'>"><MTMacroAttr name='item'></a> </MTIfNotEmpty> <MTIfEmpty expr="[MTMacroContent]"> <a href="http://en.wikipedia.org/wiki/<MTMacroAttr name='item'>"><MTMacroAttr name='item'></a> </MTIfEmpty></MTMacroDefine>
I have that set up as a “module” (reusuable piece of Movable Type template code).
Here’s an example of what the entry would contain where I want to place the tooltip:
<wikipedia item="Julius Caesar">Some content including HTML pasted in from Wikipedia</wikipedia>
Comments»
no comments yet - be the first?