Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: hak_article_image
I figured out what the problem is, however I am still confused as to how to go about adding it. I need to get the title/caption on the anchor tag with the “rel” attribute for it to show up as the caption on the lightbox script I am using. Right now the title attribute is applied to the img only. Is there any way to echo the title to the anchor wrapping the img?
Thanks for your help Patrick.
Jamie
[EDIT: to add something I missed]
Last edited by soulship (2006-11-01 11:36:11)
Offline
Re: hak_article_image
That is totally doable. This is what I’m thinking:
1 new attribute called linktitle (since it’s for the link not the image) which will let you specify the title, however we can create 2 keywords txp:alt and txp:caption which will use the images alt or caption for the title.
That way it can be overriden if desired with something manual. I like this better then having a title attribute specifically for the caption which will inevitably lead to a request for one with the alt and one that can be specified by hand, etc etc.
How does that sound?
Shoving is the answer – pusher robot
Offline
Re: hak_article_image
That would be fantastic! This seems to be the standard way most of these lightbox clones are gathering the “caption” info, but it seems backwards to me. The relevant title should be grabbed from the image, and not the image link. But this would solve my problem and work perfect with any lightbox, ibox,thickbox, etc,etc,etc. So that would be greatly appreciated and eliminate the need for a few plugins.
This is how I am using it now…
<txp:asy_wondertag>
<txp:hak_article_image limit="15" link="1" offset="0" linktype="image" popup="0" rel="lightbox[<txp:sitename />-<txp:page_url type=“s”/>-<txp:title />]" />
</txp:asy_wondertag>
And it’s making a nice per article related “slideshow”. So once the caption is in there, this will be my final solution and I can update whatever external js without touching anything in txp the forms or deal with any other plugins.
[EDIT: I love me some “wondertag”]
Jamie
Last edited by soulship (2006-11-01 14:21:25)
Offline
Re: hak_article_image
You can now use a linktitle attribute. It can take anything or two special keywords.
- txp:caption : inserts the image’s caption.
- txp:alt : inserts the image’s alt information.
I need to play with wondertag It looks awesome.
Shoving is the answer – pusher robot
Offline
Re: hak_article_image
0.5
You can now use a linktitle attribute. It can take anything or two special keywords.
* txp:caption : inserts the image’s caption. * txp:alt : inserts the image’s alt information.
Wow! That was fast! Thanks! Testing it right now.
Offline
Re: hak_article_image
Hey patrick,
It’s trying to work…
The first image is being output correctly, but all subsiquent images are being output incorrectly:
<a href="http://localhost/txp-4.4/images/150.jpg" rel="lightbox[Organic Process Productions--Mama D: Spirit of the 7th Ward]" title="children 7th ward OLD">
<img src="http://localhost/txp-4.4/images/150.jpg" width="259" height="390" alt="children 7th ward OLD" title="Children 7th Ward" />
</a>
<a href="http://localhost/txp-4.4/images/133.jpg" rel=" rel="lightbox[Organic Process Productions--Mama D: Spirit of the 7th Ward]"" title=" title="children 7th ward OLD"">
<img src="http://localhost/txp-4.4/images/133.jpg" width="390" height="462" alt="7th ward map" title="(c) GNO Community Data Center" />
</a>
*EDIT*
It gets amplified for each sequential image: Here's the last one in this article:
<a href="http://localhost/txp-4.4/images/131.jpg" rel=" rel=" rel=" rel=" rel=" rel=" rel=" rel=" rel="lightbox[Organic Process Productions--Mama D: Spirit of the 7th Ward]""""""""" title=" title=" title=" title=" title=" title=" title=" title=" title="Children 7th Ward""""""""">
<img src="http://localhost/txp-4.4/images/131.jpg" width="278" height="208" alt="7th Ward Kids" title="7th Ward Kids" />
</a>
I think it’s something simple, but I’m looking it over now.
Last edited by soulship (2006-11-01 17:05:42)
Offline
Re: hak_article_image
Hmm let me see what’s going on
Shoving is the answer – pusher robot
Offline
Re: hak_article_image
Ok I had some seriously bad variable scoping going on.
Shoving is the answer – pusher robot
Offline
Re: hak_article_image
Squashed! Working fine now and no errors in debugging mode.
Thanks Patrick!
Offline
Re: hak_article_image
Fixes issues with the various box scripts out there
Shoving is the answer – pusher robot
Offline
#86 2006-11-11 02:38:07
- szac
- Member

- From: Detroit-ish
- Registered: 2004-09-18
- Posts: 50
Re: hak_article_image
Awesome! Thank You.
Offline
Re: hak_article_image
Best image plugin about, cheers for the update dude.
Offline
#88 2007-01-21 01:04:44
- kevin12345
- Member
- Registered: 2006-06-05
- Posts: 10
Re: hak_article_image
Is there anyway to pass a textpattern tag through the linktitle attribute? I use a custom field for my image “captions,” because I sometimes need to use different text for two articles that use that same image. I’d like to do something like this:
<txp:hak_article_thumb link=“1” linktype=“image” rel=“lightbox” linktitle=”<txp:custom_field name=“Cutline” />” />
I’m sure I might be able to hack the plugin to get this effect, but my knowledge of php is limited.
Thanks
Never mind. Just discovered asy_wondertag
Last edited by kevin12345 (2007-01-21 01:17:04)
Offline
Re: hak_article_image
Great plug-in, thanks.
Quick question: I have a photoblog up and running-ish, but wanted to add multiple images to articles which are then displayed as one large main image with the reminding images shown underneath as clickable thumbnails, which then become the main image when clicked.
I’ve installed hak_article_image and the following code into a form:
<h2><txp:title /></h2>
<txp:hak_article_image />
<txp:hak_article_thumb linktype="page" />
<txp:body />
But it not working quite right, any advice on what I need to add?
Offline
Re: hak_article_image
You need to do
<h2><txp:title /></h2>
<txp:hak_article_image urloverride=‘1’ limit='1' />
<txp:hak_article_thumb link='1' linktype="page" />
<txp:body />
you need link='1' in order to specify the linktype. The urloverride parameter tells it to use the image passed in the url. The limit tells it to only show one image. Otherwise you will get two rows with all the images. See if that does what you want.
You could also add urlhide=‘1’ to the hak_article_thumb tag which will hide the image referenced in the URL from the list of thumbnails.
Shoving is the answer – pusher robot
Offline