Hi Carl
If you use the Thickbox plugin, it should do all the "magic" for you.
Just install and enable the plugin and then view the help to see how
to use it (hint: just add class="thickbox" to the image link).
If you want to implement your own code into the head, you need to
modify your theme to include the relevant code. This can be done in
two ways:
1. Directly in the header.php:
Just add the necessary code into the <head> section in this file as
you normally would. Here you can generally just copy and paste the
code supplied by the creators of your Lightbox code.
2. Using Habari's Stack::add() method.
This is a little more complicated, but does have the advantage in that
it has built in dependency checking (if you want to use it).
To use this method, add the lines you need to the add_template_vars()
function in theme.php
If you look at the thickbox plugin code, you'll see it uses the
following lines (the comments are my own):
// loads the Habari supplied jQuery
Stack::add( 'template_header_javascript',
Site::get_url('scripts') . '/jquery.js', 'jquery' );
// loads the thickbox javascript code itself. This doesn't
include the dependency checking
Stack::add( 'template_header_javascript', Site::get_url('user')
. '/plugins/thickbox/thickbox-compressed.js', 'thickbox-js' );
// loads the thickbox stylesheet
Stack::add( 'template_stylesheet', array( Site::get_url('user')
. '/plugins/thickbox/thickbox.css', 'screen,projector'),
'thickbox-css' );
You'll need to modify the paths to suit your needs.
Then you just need to ensure your theme's header.php calls "<?php
$theme->header(); ?>"
You may want to take a look at the Themes documentation at
http://wiki.habariproject.org/en/Themes to get a better idea of how
Habari themes work.
HTH
Colin
On Fri, Apr 30, 2010 at 4:31 PM, CarlM <[email protected]> wrote:
> For some images, I want a Modal window. Lightbox kinda thing.
> The trouble is, they all require that you inset a bit of code in the
> <head> of the pages you want it on (as in html,head,body, not as in
> header and footer).
> As far as I can tell, Habari generates these somewhere automatically.
> So, where can I put lines for the <head> section? I can access all the
> files on my server, can it be put in the theme CSS or something?
>
> I've found the Thickbox plugin for Habari, but there's no
> documentation on how to set it up.
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/habari-users
--
Colin Seymour
Blog: http://colinseymour.co.uk
Tech Stuff: http://www.lildude.co.uk
Barefoot Running: http://barefootrunner.co.uk
IRC: lildude #habari
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/habari-users