HIT() originally was written to create for the CMSimple-Menu (toc()) CSS-Pop-Up’s, that will show for every menupoint a preview-image (thumbnail) for the page. That’s why this tools is named HIT() (→ Hoverimages In Toc()). HIT() can be downloaded in two versions, V.0.26 and V.0.27. The newer Version V.0.27 has more options but is more complicated.
Note:
HIT() is not as easy to implement as e.g. xtoc() or advancedtoc().
To include HIT() you need basic knowledge in HTML, CSS and PHP!
HIT() is ~7kB Code, that have to be inserted in your template.htm of your active template. If you want to use CSS-Code, HIT() must be copied inbetween <HEAD> </HEAD>, but in any cases BEFORE toc() is called.
HIT() can do much more modifications than CSS-Pop-Up’s to toc(), and can be configured by following parameters:
E.g.:
Prefix = './images/folder/pic_' Heading_subpage = 'Freestyle' Suffix = '/dokuphp/addons/hit/_thumb.jpg'
→ the images MUST be located in subfolder ./images/folder/ and MUST be named ‘pic_Freestyle_thumb.jpg’!!
Example-Array:
$pages=array('Heading1'=>array('Prefix'=>'/dokuphp/addons/hit//img/h1/index.html','Suffix'=>'/dokuphp/addons/hit/_tn.jpg'), 'Heading2:Subpage'=>array('Prefix'=>'/dokuphp/addons/hit//img/h2/index.html','Suffix'=>'/dokuphp/addons/hit/_tn.gif'));
→ Creates Pop-Up’s in Heading ‘Heading1’ and ‘Heading2:Subpage’ using different paths and different file-endings.
HIT() V.0.27 has the same options as V.0.26, but can handle something like a ‘Template’. This template is stored in an array called $template and is assigned to a heading in $pages-Array. Means, that $pages differs a bit from V.0.26.
$pages=array('Head1'=>array('Prefix'=>'/dokuphp/addons/hit//img/h1/index.html', 'Suffix'=>'/dokuphp/addons/hit/_tn.jpg', 'Template'=>'Hover'), 'Head2:SubHeading'=>array('Prefix'=>'www.google.de', 'Suffix'=>'', 'Template'=>'Link'), 'Head3:MailLink'=>array('Prefix'=>'[email protected]', 'Suffix'=>'', 'Template'=>'Mailto'));
→ Creates Pop-Up’s in Heading ‘Head1’, ‘Head2:SubHeading’ and ‘Head3:MailLink’ using different paths and different Templates.
Placeholder: {{HEADING}} = Inserts the (original) name of this heading {{PREFIX}} = Prefix, which is declared in $pages {{SUFFIX}} = Suffix, which is declared in $pages {{URI}} = CMSimple-URI of this page {{FILENAME}}= Filename (Prefix+Heading+Suffix)
Example:
$template=array('Hover'=>'<span class="hoverimg"><img src="{{FILENAME}}" alt="{{HEADING}}" title="{{HEADING}}"><br>{{HEADING}}</span>{{HEADING}}', 'Link'=>'</a><a target="_blank" href="http://{{PREFIX}}">{{HEADING}}', 'Mailto'=>'</a><a href="mailto://{{PREFIX}}">{{HEADING}}');
→ Declares three templates ‘Hover’, ‘Link’ and ‘Mailto’. The Links have to be declared in $pages→‘prefix’.
For a Demo, take a look on my Playground:
Download at:
http://www.mv-web-design.de/index.php?CMSimple:AddOn%27s:HIT%28%29
see also: advancedtoc(), xtoc()
back to addons
Discussion