Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2006-10-30 13:47:31

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: hak_article_image

Hey Patrick,
I’m using this and love it as is, but I am trying to figure out if I can saw on this to get the article caption to be used as the title atribute. I’m Using some .js box goodness, but right now there is no way to use the caption or a title in it’s current form. Any suggestions so i can love it even more :)

Jamie

Offline

#74 2006-10-30 15:10:32

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

It will insert the caption as the title automagically in 4.0.4 since that’s now the default behavior for the built in image() function which hak_article_image uses to build the image tags.

It seems to be working for me. If you look at this post you will see the title for the image is “I am a caption” which is amazingly enough the caption. :)

4.0.3 does not do this however. It’s new in 4.0.4.


Shoving is the answer – pusher robot

Offline

#75 2006-10-30 19:58:46

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: hak_article_image

You know what? You’re right! I guess I need to saw some more on my javascript, because it’s not picking it up for some reason. Thanks!

Offline

#76 2006-11-01 11:32:40

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

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

#77 2006-11-01 13:57:53

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

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

#78 2006-11-01 14:15:21

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

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

#79 2006-11-01 16:41:29

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

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.

I need to play with wondertag It looks awesome.


Shoving is the answer – pusher robot

Offline

#80 2006-11-01 16:45:51

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

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

#81 2006-11-01 16:59:17

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

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

#82 2006-11-01 18:40:50

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

Hmm let me see what’s going on


Shoving is the answer – pusher robot

Offline

#83 2006-11-01 19:33:22

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

Ok I had some seriously bad variable scoping going on.

0.5.1


Shoving is the answer – pusher robot

Offline

#84 2006-11-01 19:46:47

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: hak_article_image

Squashed! Working fine now and no errors in debugging mode.

Thanks Patrick!

Offline

Board footer

Powered by FluxBB