I know this is probably not the place to submit this really since its a patch against TextPattern's Textile class. Perhaps someone trying to integrate Lightbox2 with Textile might find this helpful. I REALLY wanted Textile to work with Lightbox without having to mix raw html <a> and <img> into my textile-formatted pages. This patch basically adds support for the rel attribute for text links and image links.
The attached patch works against the current release (2.0) of classTextile.php (svn) found in the most recent release of textpattern 4.0.8.
The work here is based on a thread in textpattern forums started by Victor Hugo a LONG time ago. AFAIK no one had been able to get !imageurl! style to work with the rel attribute. This patch enables both text-based AND image-based lightbox links:
Image-based lightbox link
!url_image_thumb(Some title text)<lightbox>!:url_image
gets turned into:
<a href="url_image" rel="lightbox" title="Some title text"><img src="url_image_thumb" alt="Some Title Text" title="Some title text" /></a>
Text-based lightbox link
"A Regular Text Link(Some title text)<lightbox>":url_image
gets turned into:
<a href="url_image" rel="lightbox">A Regular Text Link</a>
You can also do an undocumented usage of !imageurl! inside a textile pattern link with: "!image_thumb_url!<lightbox>":url_image. Note that adding a "(Some title text)" wont work.
If your interested in using this, there are a couple steps to get it working. You need to
- follow the instructions for installing the Textile module,
- download the classTextile.php from TextPattern project
- download and apply the patch file attached to this entry
- install the Lightbox2 module,
- setup a new Input Filter, being sure to check both the Textile and Lightbox filter(s)
- rearange the filter order to have Textile BEFORE Lightbox filters
Your comments are welcome.
| Comment | File | Size | Author |
|---|---|---|---|
| classTextile.php_rel_attribute_support.patch | 4.17 KB | jwilson3 |
Comments
Comment #1
Anonymous (not verified) commentedThe class Textile is not part of the module.