Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-16 16:32:11

fiddle
Member
Registered: 2007-10-03
Posts: 87

hak_article_image

Hi..
Im trying to use a lighbox script, and Im guessing this plugin will accomplish it for me, Im just not completely sure how..
I want an article image to show on the page, but have it link to a different image to begin the lightbox set.
1- the article image is not part of the lightbox set.
2- how can i add the links to all the images in the set without showing them on the page. If I “limit” the href only gets put in the image thats showing.
anyone do something similar?
Thanks for any help given,,..

Offline

#2 2009-03-16 16:53:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: hak_article_image

fiddle wrote:

I want an article image to show on the page, but have it link to a different image to begin the lightbox set.

I don’t know the specific capabilities of this plugin but, if nobody else can help, you might have some luck with smd_gallery instead. But before you can begin to make a gallery in this manner there is a fundamental question related to point (1) in your list:

How do you know the URL of the first image in the lightbox if the image itself is not part of the lightbox gallery? Are you going to hard code it? If you only have one gallery that’s not so bad, but it might get quite labour intensive if you have more than one gallery, or use a template.

But anyway I think smd_gallery can get round this by abusing the text attribute. This is untested, but try this:

<txp:smd_gallery category="my_images" thumblimit="1" text='<txp:article_image />'>
   {object}
</txp:smd_gallery> 

That might work. It tells the plugin to display 1 thumbnail from your category containing gallery images, but then replace that thumbnail with some text. Except, instead of rendering text there, you render the article image instead! Give it a spin; it (or something along those lines) might get you going in the direction you want to go.

Last edited by Bloke (2009-03-16 16:55:33)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2009-03-16 16:58:01

fiddle
Member
Registered: 2007-10-03
Posts: 87

Re: hak_article_image

Let me give this a try .. Thanks Bloke.

Offline

#4 2009-03-16 17:08:34

fiddle
Member
Registered: 2007-10-03
Posts: 87

Re: hak_article_image

Sorry Bloke, no good… “ thumblimit=“1” text=’<txp:article_image /> “ works, I have one thumb, which is the article image, and not part of the category im calling, but it does not link to the category images.

Offline

#5 2009-03-16 17:17:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: hak_article_image

Haha! Of course, d’oh! Can’t even use my own plugin properly. It does work if I post the correct code. Try this instead, tested this time:

<txp:smd_gallery category="my_images" thumblimit="1" text='<txp:article_image />' >
<a rel="lightbox-{category}" href="{url}" title="{caption}">
   {object}
</a>
</txp:smd_gallery>

(it assumes you’re using lightbox and not shadowbox or anything like that — you need to change the rel for shadowbox). I’m amazed it works, but it does :-)

Last edited by Bloke (2009-03-16 17:19:45)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2009-03-16 17:31:27

fiddle
Member
Registered: 2007-10-03
Posts: 87

Re: hak_article_image

Beautiful.. that works…I guess i jumped the gun instead of actually looking at the smd info to call lightbox..
So it seems to work the way I need it to.
Only one thing………… category, I want them to choose the category it displays.. I tried
- category=”<txp:custom_field name=“whatever” />”-
but dosent display anything once i do this..
If you have any ideas, they are welcome, if not ill play around. I might need asytag , or whatever the plugin is called..

Thank you very much for the help.. I really appreciate these forums!!!!!

Offline

#7 2009-03-16 17:41:43

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: hak_article_image

fiddle wrote:

I want them to choose the category it displays..

Try category="?custom_field_name"


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2009-03-16 17:54:39

fiddle
Member
Registered: 2007-10-03
Posts: 87

Re: hak_article_image

you my friend are good…… Thank you very much.. Im not really sure why ?custom_field_name works, i thought it needed the <txp: and all that. O well… Thank you again, this works perfect.

Offline

#9 2009-03-16 18:15:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,447
Website GitHub

Re: hak_article_image

fiddle wrote:

you my friend are good…… Thank you very much..

no probs.

Im not really sure why ?custom_field_name works

It’s a shortcut I build into most of my top-end plugins so you can get at stuff without having to put tags-in-tags. It was done as a convenience before the new tag parser was available (so you didn’t have to use asy_wondertag to get at custom field info) but it proved so useful I now leave it in. Some (most?) of my plugins can also read txp:variables now directly too. And stuff off the URL line using ?my_url_variable_name.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB