Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2004-09-02 17:16:16

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

[archived] glx_image

Notice: This thread is archived, this plugin is no longer available but the latest version can be found here.

**********************************************************

This plugins helps you control how to display a image element inspired by dunstans image tag he explains here

Attributes:

id
Id of image to display
src
src of external image
link

  • Url (with http://)
  • <code>large</code> in that case the plugin choose the thumbnail for the given id and place a link to the large version of that image.
  • <code>pop</code> If you have Deans dca_pop installed the large image is opend in a popup.

linktitle
Title of the link
caption
Caption to display under the image, enter <code>standard</code> to use the one that is stored in the database
alt
alt text for the image, if no alt is given it uses the one that is stored in the database, the one you entered when the image was uploaded.
class
Class to control how to display the image element <code>left</code>, <code>right</code>, <code>center</code> or <code>standalone</code>

CSS example is included with the plugins documentation.

Download

edit: New version 0.7

Last edited by osei (2005-05-16 07:31:19)


Johan Nilsson

Offline

#2 2004-09-16 07:20:02

Cantide
Member
From: Wellington, New Zealand
Registered: 2004-03-03
Posts: 27
Website

Re: [archived] glx_image

Could you please give a example of your plugin’s usage?

Offline

#3 2004-09-16 12:25:40

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

Re: [archived] glx_image

You can find a example here but it is in swedish, but i think you can understand the usage of it or else i could explain it in more detail here if you want.

Last edited by osei (2004-09-16 12:59:24)


Johan Nilsson

Offline

#4 2004-09-17 09:55:34

Cantide
Member
From: Wellington, New Zealand
Registered: 2004-03-03
Posts: 27
Website

Re: [archived] glx_image

Thanks, that’s great :)

Offline

#5 2004-09-17 10:28:56

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

Re: [archived] glx_image

good to hear, let me know if there is anything “missing” in the plugin, then i will try to add it.

Here is a better css than the one in the plugins documentation, i add it to the documentation later.

<code>

div.image-element div.caption { padding: 0; text-align: left; font-size: x-small; border-style: none; text-align: center; margin: 0 0 20px 0;
}

.right {float: right; position: relative; margin: 0.2em 0.5em 0.5em 1.5em}
.left {float: left; position: relative; margin: 0.5em 1.5em 0.5em 0.5em}
.standalone { width: auto; }
.center { text-align: center;}

</code>


Johan Nilsson

Offline

#6 2004-09-17 17:47:38

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

Re: [archived] glx_image

does this replace <txp:image /> or <txp:article_image />?


Listen to Kenneth

Offline

#7 2004-09-17 18:21:58

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

Re: [archived] glx_image

Its a replace for <code> <txp:image /> </code> But to make it work full you have to use the css i posted above.

for example

<code><txp:glx_image id=“46” class=“center” link=“large” caption=“standard” /></code>

becomes

<code>
<div class=“image-element center”>
<a href=”/images/46.jpg” title=“Se en större version av denna bild.”>
<img src=”/images/46t.jpg” alt=“En bild på bark” />
</a>
<div class=“caption”>Bark på ett träd</div>
</div>
</code>

It helps you align the picture (center, left, right or standalone), make a link from the thumbnail to the bigger one, or a link to elsewhere.


Johan Nilsson

Offline

#8 2004-11-01 20:43:44

ChrisJ
Member
From: Vienna, Austria
Registered: 2004-03-30
Posts: 54
Website

Re: [archived] glx_image

Johan,
how to add the ability to open the full-sized image in a pop-up window? I’ve tried to add
onclick=\"","window.open(this.href, 'popupwindow', 'width=",$w,",height=",$h,",resizable'); return false;\" from Dean’s dca_pop plugin to the $linkStart line, but somehow it won’t work.

Last edited by ChrisJ (2004-11-01 20:44:46)

Offline

#9 2004-11-01 21:24:59

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

Re: [archived] glx_image

ChrisJ

This is untested but try to replace the flollowing code
<code>
$out = “<div class=\“image-element”.$class.”\”>”.n;
$out .= $linkStart.n;
$out .= “<img src=\”“.$pfr.$img_dir.”/”.$image.$row[“ext”].”\” alt=\”“.$alt.”\” />”.n;
$out .= $linkEnd.n;
$out .= $captionTag.n;
$out .= “</div>”.n;
</code>

With this:
<code>
$out = “<div class=\“image-element”.$class.”\”>”.n;
$out .= “<txp:dca_pop id=\”“ . $id . “\”>”;
$out .= “<img src=\”“.$pfr.$img_dir.”/”.$image.$row[“ext”].”\” alt=\”“.$alt.”\” />”
$out .= “</txp:dca_pop>”.n;
$out .= $captionTag.n;
$out .= “</div>”.n;
</code>

And have Deans dca_pop plugin installed too.

Last edited by osei (2004-11-01 21:25:41)


Johan Nilsson

Offline

#10 2004-11-01 23:33:06

ChrisJ
Member
From: Vienna, Austria
Registered: 2004-03-30
Posts: 54
Website

Re: [archived] glx_image

Thank you!

That made the trick. However
  1. you forgot a semicolon after $alt."\" />" in the third line (otherwise there is only a blank page you get)
  2. this method produces links to full-size images even from themselves, not only from thumbnail images

Offline

Board footer

Powered by FluxBB