Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-08-01 23:28:02

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

[plugin] [ORPHAN] zem_article_image

<txp:zem_article_image /> is similar to txp:article_image, except it supports multiple images per article. The article image field must contain one or more numeric image IDs separated by commas.

<txp:zem_article_thumb /> displays the image thumbnail(s); it is otherwise identical to zem_article_image.

Both tags support the standard “break” and “wraptag” attributes.

Examples:

  • <txp:zem_article_image /> – Display only the first article image, same as txp:article_image
  • <txp:zem_article_image limit=5 /> – Display a list of article images, up to a limit of 5
  • <txp:zem_article_thumb /> – Display the first article thumbnail
  • <txp:zem_article_thumb limit=5 wraptag="ul" break="li" /> -Display up to 5 article thumbnails as an unordered list

Download:

http://vigilant.tv/documents/tp/zem_article_image-0.1.txt

I’m planning on adding a few new features to this (captions, image links), but thought I’d release it in its present form to see if there’s any feedback.


Alex

Offline

#2 2004-08-01 23:31:45

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_article_image

Here’s a simplified version of the article form code I’m using to display the mini gallery layout used in this article -

<code>
<txp:excerpt />
<txp:if_article_list> <txp:permlink> <txp:zem_article_thumb limit=5 /> </txp:permlink>
</txp:if_article_list>
<txp:if_individual_article> <txp:zem_article_image limit=5 />
</txp:if_individual_article>
<txp:body />
</code>


Alex

Offline

#3 2004-08-04 21:08:33

kennethlove666
Member
From: arkansas
Registered: 2004-04-27
Posts: 107
Website

Re: [plugin] [ORPHAN] zem_article_image

I forgot yo at home, and my code is here at work, so here’s what I was going to send you:

<code>
function article_image_caption($atts) { global $thisarticle,$pfr,$img_dir; if (is_array($atts)) extract($atts); $theimage = ($thisarticle[‘article_image’]) ? $thisarticle[‘article_image’] : ‘’;

$rs = safe_row(“*”,‘txp_image’,“id=’$theimage’ limit 1”); if ($rs) { extract($rs); $out = array( ‘<img’, ‘src=”’.$pfr.$img_dir.’/’.$id.$ext.’”’, ‘height=”’.$h.’” width=”’.$w.’” alt=”’.$alt.’”’, (!empty($style)) ? ‘style=”’.$style.’”’ : ‘’, (!empty($align)) ? ‘align=”’.$align.’”’ : ‘’, ‘/>’, ‘<p class=“cutline”>’.htmlspecialchars($caption).’</p>’ ); return join(’ ‘,$out); }
}
</code>

Hope that helps.


Listen to Kenneth

Offline

#4 2004-08-18 01:33:12

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: [plugin] [ORPHAN] zem_article_image

I would really like to see an offset attribute to this tag since I plan on having the different images on different places of the code.

I’ll look into the code, read hack away ;), later today.

Note: The offset should ofcourse not display an image if there was only one and the offset is set to, for instance, 2.

Last edited by obeewan (2004-08-18 01:34:02)


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#5 2004-10-06 12:55:01

Boby Dimitrov
Member
From: Sofia, Bulgaria
Registered: 2004-09-27
Posts: 76
Website

Re: [plugin] [ORPHAN] zem_article_image

Is there any chance zem to modify the plugin to output links to full size images? For example:
<pre>
<txp:zem_article_image_link> <txp:zem_article_thumb />
</txp:zem_article_image_link>
</pre>

Or something similar… And the links should include the Alt text and Caption…

Last edited by Boby Dimitrov (2004-10-06 12:55:15)

Offline

#6 2004-10-06 13:10:18

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: [plugin] [ORPHAN] zem_article_image

Boby,

<code><a href=”<txp:zem_article_image />”><txp:zem_article_thumb /></a></code>

No idea for captions though.


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#7 2004-10-06 13:28:07

Boby Dimitrov
Member
From: Sofia, Bulgaria
Registered: 2004-09-27
Posts: 76
Website

Re: [plugin] [ORPHAN] zem_article_image

Heh, already tried that, but it outputs an img tag inside the href so it won’t do…

Offline

#8 2004-10-06 22:08:11

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_article_image

I’m considering releasing an updated version. Waiting to see whether the next Txp release includes any new image features first.


Alex

Offline

#9 2004-10-24 23:30:00

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] zem_article_image

Where does this plugin find the thumbnail? I thought it would just use the thumbnail as uploaded with the image, but I can’t get it to show.

In my form I have:

<code><p><txp:zem_link title=’%s’><txp:zem_article_thumb /> <txp:title /></txp:zem_link></p></code>

and it doesn’t show a thumbnail. (doesn’t work with txp:permlink either)

What am I doing wrong?

Last edited by doggiez (2004-10-24 23:31:26)

Offline

#10 2004-10-25 08:03:52

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: [plugin] [ORPHAN] zem_article_image

That should work. What if you change it to zem_article_image, as a test?


Alex

Offline

#11 2004-10-25 12:19:53

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] zem_article_image

That doesn’t show the image either. In the ‘article image’ field I have /images/6.jpg and I tried changing that in a couple of ways, but txp:article_image does work, so I assume that’s not the problem.
I’m developing this site locally, but can’t see that that has anything to do with it, since everything else works fine.

Edit: and yes, the plugin is active ;-)

Last edited by doggiez (2004-10-25 12:26:04)

Offline

#12 2004-10-25 13:44:51

mamash
Member
From: Prague
Registered: 2004-02-21
Posts: 127
Website

Re: [plugin] [ORPHAN] zem_article_image

AFAIK you should only provide the image ID, not the whole path, when using this plugin.


Who’s gonna textdrive you home tonight?

Offline

Board footer

Powered by FluxBB