Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#151 2007-11-06 21:33:23
Re: hak_article_image
There currently isn’t a tag to do this but if you use a form you could,
<txp:hak_article_image offset="1" form="myform" />
then in myform try
<txp:php>
echo $GLOBALS['hak_thisimage']['id'];
</txp:php>
I haven’t actually tried this and I don’t use <txp:php> much so i don’t know the ins and outs of using it, but I think it should work.
Shoving is the answer – pusher robot
Offline
#152 2007-11-16 18:11:50
Re: hak_article_image
Hi Patrick,
I was wondering if you could help me, I’m trying to produce a layout with hak_article_image that uses numbered links instead of thumbnails. I would then style the links with CSS.
This is the code for a main image + thumbnail links that you helped me with before:
<div class="columns-2-A">
<txp:hak_article_image limit="1" urloverride="1" form="decoder_hak_caption" break="br" wraptag="ul" />
<txp:hak_article_thumb link='1' linktype="page" urlhide='0' />
</div><!-- end of columns-2-A -->
Many thanks.
Offline
#153 2007-11-16 22:27:35
Re: hak_article_image
You can use <txp:hak_article_image_link /> in a form to just create a link. So for example to replace the thumbnail in the example above with just an ordered list of the alt values you could do
<div class="columns-2-A">
<txp:hak_article_image limit="1" urloverride="1" form="decoder_hak_caption" break="br" wraptag="ul" />
<txp:hak_article_thumb form="ordered_links" wraptag="ol" break="li" />
</div><!-- end of columns-2-A -->
then in the ordered_links form you can do
<txp:hak_article_image_link type="page"><txp:hak_image_alt /></txp:hak_article_image_link>
which should give an ordered list of linked alt values which point to the same page passing teh image along. See if that works.
Shoving is the answer – pusher robot
Offline
#154 2007-11-19 11:06:26
Re: hak_article_image
Hi Patrick,
Many thanks for your help, I’ve tried out your sample code and it’s beginning to work well.
However, instead of the image ALT displaying I’d just like an ordered numbered list (with perhaps the ALT showing as a tooltip), so for example, if there’s 4 images they’ll be 4 numbered links. This an example of how it’s working at the moment, although not all entries have multiple images.
This is my css:
.pagelink {
font-size: 10px;
height: 2.5em;
font: bold 10px/2.5em "Lucida Grande", "Verdana", sans-serif;
padding: 0 14px 0 8px;
float: left; }
.pagelink a {
color: #fff;
padding: 2px 3px;
background: #8f0817;
text-decoration: none;
}
.pagelink a:visited {
}
.pagelink a:hover {
background: #9b0000;
}
.pagelink a:active {
color: #4d4d4d;
background: #ffffff;
}
I’m not sure where to go from here so would really appreciate a little further direction. Thanks.
Last edited by decoderltd (2007-11-19 15:58:50)
Offline
#155 2007-11-19 16:17:14
Re: hak_article_image
Sorry,I’m not quite understanding what you want. You can put whatever you want in between the <txp:hak_article_image_link type="page"> tags. Static text, other TXP tags whatever you want.
Are you looking for
or
I’m not sure of an easy solution for the second one, because there isn’t a built in tag that will expose the loop count as far as I know, so we would have to add a tag to handle that.
Shoving is the answer – pusher robot
Offline
#156 2007-11-19 17:03:20
Re: hak_article_image
Hi Patrick,
Yep, it’s the second option that I’m trying to achieve! It makes everything that much neater (it can run over one line) and also lets the viewer know the number of images are available.
If there’s no way around it I could look at your first option and keep the description very short, I’d just need to create a numbered list.
Offline
#157 2007-11-19 18:05:26
Re: hak_article_image
There’s no way, that I can think of, to do it without writing new code to make the index available. It’s probably not super hard.
Shoving is the answer – pusher robot
Offline
#158 2007-11-20 16:12:03
Re: hak_article_image
Thanks again for all your help Patrick. I’ll see if I can find another way of doing it.
Offline
#159 2007-12-19 02:31:33
Re: hak_article_image
Hello Patrick, i got pointed here
for i was looking for a plugin, which could point to multiple article images by a list of indices, too.
Obviously i learned now, that currently this is not possible. tried rewriting teh code, but couldn;t get it done yet.
Nevertheless, while trying the <txp:hak_image_alt /> .method you mentioned above i found, that it also works with the caption, but leads to links here looking like “http://mysite.com/home/?p=2” instead of “http://mysite.com/images/2.jpg”, which comes up when using type=“image” instead of type=“name”.
“http://mysite.com/home/?p=2” then displays the page as is, but for some reason suddenly the comments are shown, although they are switched off on that particluar article. odd.
Just wanted to make you aware of this behaviour. I am using txp 4.0.5 and clean urls (title only).
Are you by any chance aware of a plugin, which could perform the task of linking from a list of indices then?
In any case thanx a lot for developping this, it is already a great plug.
EDIT: Found a solution/hack to this using a bit of extra PHP, will post shortly.
Last edited by jayrope (2007-12-19 04:37:27)
A hole turned upside down is a dome, when there’s also gravity.
Offline
#160 2007-12-19 04:45:16
Re: hak_article_image
Solution to display multiple article images, one at a time to be selected from list of indexes
Preface: Multiple article image IDs appear comma-separated in the article_image field in CONTENT->WRITE.
Way to go then:
In your article form use code
<txp:hak_article_image urloverride="1" limit="1" /><p><txp:hak_article_image urloverride="1" limit="1" form="image_caption" /></p><p><txp:hak_article_image form="ordered_links" break=" / " /></p>
In form “image_caption” (type misc) use code
<txp:hak_image_caption />
In form “ordered_links” (type misc) use code
<txp:hak_article_image_link type="page">
<txp:php>global $imgndx;$imgndx +=1;echo $imgndx;</txp:php></txp:hak_article_image_link>
Style as desired with additional css.
Hope that helps anyone.
Last edited by jayrope (2007-12-19 04:46:43)
A hole turned upside down is a dome, when there’s also gravity.
Offline
#161 2007-12-21 13:05:25
Re: hak_article_image
That’s great Jane, that’s exactly what I need. I look forward to trying it out.
Offline
#162 2008-01-06 19:25:09
Re: hak_article_image
Thanks for the excellent plugin.
So, I wanted a section landing page called “portfolio”, with a gallery of thumbnails of images from any article (in any section) with a category of “slideshow”, which would link to a thickbox series.
In other words, I had articles in various sections, some with images, some of which had category “slideshow”. But I had no articles in section “portfolio”. So the “portfolio” page should pull thumbnail images from other sections, with links to the full images, with a class of “thickbox” on the links.
After trying several different things, this is what worked:
1. On the “portfolio” page, this pulls articles from any section with category “slideshow”:
<txp:article_custom category=“slideshow” form=“slideshow” />
2. In an article-type form called “slideshow”:
<li><txp:hak_article_thumb form=“slideshow2” /></li>
3. In a misc-type form called “slideshow2”, this creates the linked thumbnails, with the class on the link:
<txp:hak_article_image_link type=“image” rel=“slideshow” class=“thickbox” title=“txp:caption”>
<txp:hak_thumbnail />
</txp:hak_article_image_link>
I tried several ways with only one form (or none), but they didn’t work. So, thought I’d share the successful result.
Offline
#163 2008-02-11 12:44:23
- FRIIIEEK
- Member

- From: Düsseldorf
- Registered: 2007-03-23
- Posts: 17
Re: hak_article_image
Hey Guys!
I’m using hak’s plugin quite long and i’m very glad to have it!
This time I simply need to add a class-Attribute to the img-Tag I create with <txp:hak_article_thumb />
So I tried this:
<txp:hak_article_thumb link="0" offset="2" limit="2" class="myimgclass" />
But the Image-Tag does not get the class-Attribute.
Can you give me a hint or solution for my problem?
Thanks
FRIIIEEK
Offline
#164 2008-02-11 15:30:37
Re: hak_article_image
You can’t set the class of the image from the main <txp:hak_articleimage/thumb /> tags but you can attach it to <txp:hak_thumbnail /> which you can use in a form. Change this to.
<txp:hak_article_thumb link="0" offset="2" limit="2" form="myimgclass" />
then in the myimgclass form just put
<txp:hak_thumbnail class="myimgclass" />
I started working on a whole new image that that will allow you to use it as container tags but it’s not ready yet.
Shoving is the answer – pusher robot
Offline
#165 2008-02-12 16:04:17
- FRIIIEEK
- Member

- From: Düsseldorf
- Registered: 2007-03-23
- Posts: 17
Re: hak_article_image
Wow! That was fast!
I tried it today and it was WONDERFUL! ;)
Thanks a lot!
Offline