Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-18 14:56:41

matt7530
Member
Registered: 2004-11-01
Posts: 23
Website

Add Next / Previous Photo Thumbnail

I’ve been looking for a way to add a preview for the next few article thumbnails or the previous few article thumbnails for photo detail pages on my photography web site focusontheclouds.com. Is anyone familiar with a way to do this or a plugin which will help with this? Thanks!

Offline

#2 2005-12-20 03:33:58

matt7530
Member
Registered: 2004-11-01
Posts: 23
Website

Re: Add Next / Previous Photo Thumbnail

Anyone have any thoughts on this?

Offline

#3 2005-12-20 03:44:17

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Add Next / Previous Photo Thumbnail

Thanks very much for waiting at least a day before bumping the topic. :)

I don’t believe there is an existing way, built-in or plugin, to do this with Textpattern. A plugin is possible though.

Offline

#4 2005-12-20 04:16:10

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Add Next / Previous Photo Thumbnail

I did hack one of Rob’s plug-ins to death to do this some while back but it requires that you have the thumbs as excerpts.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#5 2005-12-20 11:28:44

matt7530
Member
Registered: 2004-11-01
Posts: 23
Website

Re: Add Next / Previous Photo Thumbnail

Heh, I waited a day an a half.. :)

Thanks guys. I guess I’ll report in ‘plugins’ and see if I have any luck over there.

Best wishes,

Matt

Offline

#6 2006-01-01 15:00:39

matt7530
Member
Registered: 2004-11-01
Posts: 23
Website

Re: Add Next / Previous Photo Thumbnail

I could probably use the new offset attirbute of the article tag, if I could find a way to determine the current article’s offset. Anyone ideas?

Offline

#7 2006-01-01 15:44:23

matt7530
Member
Registered: 2004-11-01
Posts: 23
Website

Re: Add Next / Previous Photo Thumbnail

Okay – new thought.

Since the next article id and previous article id are available, I’d like to display an each of those articles by adding an id attribute to an article tag. This means that the final tag should look something like this:

<code><txp:article_custom listform=“frm_li_thm” id=”<txp:prev_id />” /></code><br />&nbsp;<br />

However, it appears that you can’t use a tag inside of a tag. Does anyone know the rules here or how I could accomplish this?

Last edited by matt7530 (2006-01-01 15:47:05)

Offline

#8 2006-01-01 18:08:47

matt7530
Member
Registered: 2004-11-01
Posts: 23
Website

Re: Add Next / Previous Photo Thumbnail

I found an interesting article about using tags within tags where someone added php directly into a page to get the desired result.

I’m not very familiar with php, so can anyone help me call article custom to specify listform=“frm_li_thm” and the id=“previous id”?

PHP they used:
<code><txp:php>echo article_custom(array(“form”=>“default”, “section”=> section(array())));</txp:php></code>

PHP I’d like to use:
<code><txp:php>echo article_custom(array(“listform”=>“frm_li_thm”, “limit”=>“1”, “id”=>$GLOBALS[‘pretext’][‘next_id’]));</txp:php></code>

UPDATE: The [‘pretext’][‘next_id’] bit comes from a little research I did previously. You can read more about this in my article about Global Variables (for the non-developer) in Textpattern.

Last edited by matt7530 (2006-01-01 18:19:57)

Offline

#9 2006-01-01 19:25:58

matt7530
Member
Registered: 2004-11-01
Posts: 23
Website

Re: Add Next / Previous Photo Thumbnail

I figured it out:
<code><txp:php>echo article_custom(array(“listform”=>“frm_li_thm”, “form”=>“frm_li_thm”, “limit”=>“1”, “section”=>“Photo”, “id”=>”{$GLOBALS[‘pretext’][‘next_id’]}”));</txp:php></code>

I’m using this outside of an article form, so I can’t catch if it is the first or last article. For the time being, I am limitting the list to to 1 and defining the section, so in the case of the first or the last article, it will display the most recent article. Far from ideal, but it works…

So now we can display the previous article and the next article, which will allow us to grab the thumbnail for each.

Any thoughts on how we could use this to display the next 3 thumbnails or the previous 3 thumbnails?

See this in action on a photo detail page in my photo gallery.

Last edited by matt7530 (2006-01-01 23:08:09)

Offline

#10 2006-03-01 12:26:42

dukny
Member
Registered: 2006-02-20
Posts: 14

Re: Add Next / Previous Photo Thumbnail

Thanks! matt

I’ve been looking for a way to add a preview for the next “n” article thumbnails(title) or previous the “n” article thumbnails(title) for photo detail pages on my gallery.

Like MTAgain plugin for Movable Type

Is possible?? plug-in??

help me!! plz

Last edited by dukny (2007-05-25 10:44:32)

Offline

#11 2006-03-01 12:40:54

matt7530
Member
Registered: 2004-11-01
Posts: 23
Website

Re: Add Next / Previous Photo Thumbnail

Unfortunately, I don’t know of any ways. Rest assured that if I find one – I’ll post it here.

Offline

Board footer

Powered by FluxBB