Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#106 2007-03-21 13:07:40
Re: hak_article_image
Hi Patrick, really sorry about delay getting back to you.
Many thanks for your code help, I’ve created a form and adjusted my tags. One further question, I wanted to keep the main image (+ caption) with the thumbnails underneath – I’ve reinstated the old code so you can see what I mean The revised code just displays one thumbnail, I tried adjusting it, but I ended up making a bit of a mess!
Offline
#107 2007-03-21 13:25:13
Re: hak_article_image
hakjoon wrote:
This took a little longer then I expected.
- Can now use forms (not as extensive as upm_image but it’s easily extendable).
- Access to image caption.
- Creates a global
$hak_thisimagevariable if anyone wants to create more form tags. - should be fully backwards compatible with old non-form syntax.
I tried to test this as best I could but eventually it just needs to go out. It’s a fairly big re-implementation so I migth have missed things so please report any problems.
Marvellous – thanks.
Offline
#108 2007-03-21 13:57:29
Re: hak_article_image
decoderltd wrote:
Many thanks for your code help, I’ve created a form and adjusted my tags. One further question, I wanted to keep the main image (+ caption) with the thumbnails underneath – I’ve reinstated the old code so you can see what I mean The revised code just displays one thumbnail, I tried adjusting it, but I ended up making a bit of a mess!
That should have gotten you somewhat there but maybe something got wonky. This should do what you want. If it doesn’t something is wrong with the plugin. I’m going to leave out wraptags and stuff for now to make it a little simpler to understand.
Simplest way:
<div><txp:hak_article_image limit="1" urloverride="1" form="main_image" /></div>
<div><txp:hak_article_thumb link="1" type="page" /></div>
<!-- main_image form -->
<txp:hak_image />
<p><txp:image_caption /></p>
Notice that I’m only using a form for the main image call since we want the caption. The index of images can be handled through the old simple format. If we wanted to use a form we would change the call to:
<div><txp:hak_article_thumb form="image_index" /></div>
<!-- image_index form -->
<txp:hak_article_image_link type="page"><txp:hak_thumbnail /></txp:hak_article_image_link>
the link attribute becomes unnecessary because you are determining if a link exists in the form. The <txp:hak_article_image_link> tag now takes all the link attributes.
Also worth noting is that <txp:hak_article_thumb form="image_index" /> and <txp:hak_article_image form="image_index" /> will give you the same results because the decision on whether to show a thumbnail or the full size image is determined in the form using either <txp:hak_image /> or <txp:hak_thumbnail />
Hope that helps.
Shoving is the answer – pusher robot
Offline
#109 2007-03-21 15:53:16
Re: hak_article_image
That’s great, thanks Patrick.
I used the following code…
<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 -->
Offline
#110 2007-03-24 20:34:50
- two7s_clash
- Member

- From: VA
- Registered: 2007-02-13
- Posts: 15
Re: hak_article_image
My virtue of this following post my idiocy is well documented. No need for reminders. That said, how in the blazes do you actually associate explicitly more than one image with an article? I can only associate one image to an article.
Basically, I have several layouts based around the “sandbag” div approach:
<code>
<style>
#sml-02,#sml-03,#sml-04,
#sml-05,#sml-06,#sml-07,#sml-08,
#sml-09,#sml-10,#sml-11,#sml-12 {
float:left;
clear:left;
}
#smr-00,#smr-01,#smr-02,#smr-03,
#smr-04,#smr-05,#smr-06,#smr-07,
#smr-08,#smr-09,#smr-10,#smr-11,
#smr-12 {
float:right;
clear:right;
}
</style>
<h2><txp:title /></h2>
<div id=“smr-00”><txp:article_image/></div>
<div id=“sml-02”<txp:next_article_image /></div>
<div id=“smr-01”><txp:next_article_image /></div>
<div id=“sml-03”><txp:next_article_image /></div>
<div id=“smr-02”><txp:next_article_image /></div>
<div id=“sml-04”><txp:next_article_image /></div>
<txp:body />
</code>
I know that <txp:next_article_image> ain’t a real tag. But can you tell what I’m trying to do? Make it so the article body be what it may, will flow between right and left alternating images, using as few or as any images as I assign to a specific article. I thought I could do this with categoties, but no luck.
Clear as mud?
Help.
Last edited by two7s_clash (2007-03-24 20:37:19)
Existing is plagiarism.
Offline
#111 2007-03-24 22:04:15
Re: hak_article_image
Just use multiple image ids in the article-image field separated by commas.
For example: 5,16,25,2,11 will give you acces to those images in that order. You can then combine the limit and offset attributes to access a specific image. For example to display the thumbnail of image 25 you would do.
<txp:hak_article_thumb limit="1" offset="2" />
to display images 16,25 and 2 you can use
<txp:hak_article_image limit="3" offset="1" />
does that help?
Shoving is the answer – pusher robot
Offline
#112 2007-03-26 04:22:17
- two7s_clash
- Member

- From: VA
- Registered: 2007-02-13
- Posts: 15
Re: hak_article_image
Ahh, yes, very helpful! Thx.
Existing is plagiarism.
Offline
#113 2007-03-29 16:55:16
- two7s_clash
- Member

- From: VA
- Registered: 2007-02-13
- Posts: 15
Re: hak_article_image
Any general trouble shooting advice?
As I’m trying to insert hak_article_image tags my article forms, I keep getting thrown “500’s”
In the article image field, I’ve simply got: 9,35,30
Article form looks like this
<code>
<div class=“m_text”>
<img alt=”“ style=“border: none” src=“http://test.strategicglobalsolutions.com/images/6-t1.gif” ><br>
<div class=“lh” style=“margin:20px 0px 0 62px” >
<h2><txp:title /></h2>
<div id=“smr-00”><txp:hak_article_image limit=“1” /></div>
<div id=“sml-02”><txp:hak_article_image offset=“1” limit=“1” /></div>
<div id=“smr-01”><txp:hak_article_image offset=“2” limit=“1” /></div>
</div><txp:body />
</div>
</code>
Existing is plagiarism.
Offline
#114 2007-03-29 17:38:31
Re: hak_article_image
does it only happen when you insert the tag? Try just one instance of the tag to start. I can’t imagine what would be causing it to 500.
Do you have access to the error logs?
Last edited by hakjoon (2007-03-29 17:38:48)
Shoving is the answer – pusher robot
Offline
#115 2007-03-30 03:01:11
- two7s_clash
- Member

- From: VA
- Registered: 2007-02-13
- Posts: 15
Re: hak_article_image
Yeah, I tried with just the one tag, that still kills it. I don’t see anything really in error.log… anywhere else I should look?
Here’s each piece as I’ve got it filled out currently:
http://f1shw1ck.com/sandbox/form.png
http://f1shw1ck.com/sandbox/page.png
http://f1shw1ck.com/sandbox/article.png
http://f1shw1ck.com/sandbox/section.png
Last edited by two7s_clash (2007-03-30 03:55:09)
Existing is plagiarism.
Offline
#116 2007-03-30 13:41:16
Re: hak_article_image
Nothing seems out of the ordinary.
What if you use the built in article_image tag? Does it work? If you are getting a 500 you should be seeing something in the Apache error log.
Shoving is the answer – pusher robot
Offline
#117 2007-03-30 14:56:41
- two7s_clash
- Member

- From: VA
- Registered: 2007-02-13
- Posts: 15
Re: hak_article_image
Yeah, plain ol article image works…
Error log: [Fri Mar 30 07:54:37 2007] [error] [client 216.12.19.217] Premature end of script headers: php5.cgi, referer: http://test.strategicglobalsolutions.com/
[Fri Mar 30 07:54:39 2007] [error] [client 216.12.19.217] Premature end of script headers: php5.cgi, referer: http://test.strategicglobalsolutions.com/
Existing is plagiarism.
Offline
#118 2007-03-30 17:14:56
Re: hak_article_image
Alright I have no idea. What if you only have one image in the article_image field? Does it change the behaviour at all? If you switch the production State to debugging does it give you any info?
Also maybe you could try this previous Version that way I can at least track it to something in the new implementation.
Shoving is the answer – pusher robot
Offline
#119 2007-03-31 00:05:32
- ekfritz
- New Member
- Registered: 2006-01-29
- Posts: 4
Re: hak_article_image
Quick question, and I fully acknowledge this may be some gigantic brain-fart on my part but, in the description of hak_article_image, you say “both tags support the standard break, wraptag, class and breakclass attributes.”
So I tried to do this to use your plugin with Thickbox:
<txp:hak_article_thumb link="1" linktype="image" linktitle="txp:caption" class="Thickbox" />
yet when I look at the page source, no class attribute was applied. Am I missing something obvious?
Offline
#120 2007-03-31 16:03:56
Re: hak_article_image
No that’s actually just confusion on the way wraptags work. The class actually gets applied to the wrapping tag. It’s just a TXP idiosyncracy. I’ve thought of changing it but then it would be inconsistent with the way other tags work.
I didn’t realize Thickbox required a class on the link instaed of using rel="" Let me see about implementing that.
Last edited by hakjoon (2007-03-31 16:04:18)
Shoving is the answer – pusher robot
Offline