Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#85 2006-11-01 21:10:30

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

Re: hak_article_image

0.5.2

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

#87 2006-12-08 16:19:33

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

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

#89 2007-02-16 16:44:41

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

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

#90 2007-02-16 16:52:41

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

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

Board footer

Powered by FluxBB