Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[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.
edit: New version 0.7
Last edited by osei (2005-05-16 07:31:19)
Johan Nilsson
Offline
Re: [archived] glx_image
Could you please give a example of your plugin’s usage?
Offline
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
Re: [archived] glx_image
Thanks, that’s great :)
Offline
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
Re: [archived] glx_image
does this replace <txp:image /> or <txp:article_image />?
Listen to Kenneth
Offline
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
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
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
Re: [archived] glx_image
Thank you!
That made the trick. However- you forgot a semicolon after
$alt."\" />"
in the third line (otherwise there is only a blank page you get) - this method produces links to full-size images even from themselves, not only from thumbnail images
Offline
Re: [archived] glx_image
Chris ahh thats right, well here is version 0.3
It is now possible to use Deans dca_pop to have internal images opend in a popup.
Example:
<code><txp:glx_image id=“46” class=“center” link=“pop” caption=“standard” /></code>
Johan Nilsson
Offline
Re: [archived] glx_image
Excellent! Works great.
My tweaks:- you can get rid of one div (caption), if you replace
<div class=\"caption\">".$caption."</div>
withspan
tag:<span>".$caption."</span>
- css looks then like: div.image-element span {caption formatting}
- if you want a title attribute for the thumbnail, have to add
" title=\"View a larger version of this image\"",
to thea
tag in the dca_pop plugin (before" onclick=\""
)
Offline