Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#97 2007-03-02 17:38:58

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

Just to keep you all in the loop. I decided to finally bite the bullet and make this puppy use forms. This requires a bit of a rewrite so it’s taking a little longer. In the end I think it will be worth it though.

I’m planning on this next version being fully backwards compatible so you don’t have to use the forms if you don’t want to.

However, I’m planning on taking this work into a more general purpose hak_image tag (Ideally implementing a lot of these ideas) that will probably not be backwards compatible.


Shoving is the answer – pusher robot

Offline

#98 2007-03-02 17:48:35

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: hak_article_image

>hakjoon wrote:
bq. I’m planning on taking this work into a more general purpose hak_image tag

You go girl :)

Seriously though, thanks, a more powerful image tag (with forms) is something I’ve been looking for, for a long time. Let me know if you want me to help test.

Offline

#99 2007-03-02 20:03:54

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: hak_article_image

Hakjoon,

That’s great news!

I’ll be glad to help test as well.

Cheers,
Tom

Offline

#100 2007-03-05 08:39:37

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: hak_article_image

Excellent news – thanks!

Offline

#101 2007-03-17 01:46:55

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

This took a little longer then I expected.

Ver. 0.6

  • Can now use forms (not as extensive as upm_image but it’s easily extendable).
  • Access to image caption.
  • Creates a global $hak_thisimage variable 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.

Last edited by hakjoon (2007-03-17 01:49:23)


Shoving is the answer – pusher robot

Offline

#102 2007-03-19 12:53:20

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: hak_article_image

Hi Patrick,

Sounds great, thanks. I’ve downloaded the file but it still seems to be version 0.5.2, have I gone to the wrong URL?

Offline

#103 2007-03-19 13:50:44

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

Not sure what happened there but somehow the new upload didn’t take. It should be working now.


Shoving is the answer – pusher robot

Offline

#104 2007-03-19 15:29:56

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: hak_article_image

That’s working fine now, thanks.

Just one question. I’ve read through the help file but I’m not quite sure how to add a caption to the main image – this is my code:

<div class="columns-2-A"> <txp:hak_article_image urloverride=‘1’ limit='1' break="br" linktitle="txp:caption" wraptag="ul"/> <txp:hak_article_thumb link='1' linktype="page" urlhide='0' /> </div><!-- end of columns-2-A -->

I tried adding the <txp:hak_image_caption /> tag beneath the <txp:hak_article_image/> but nothing appeared.

Last edited by decoderltd (2007-03-19 15:30:44)

Offline

#105 2007-03-19 15:47:03

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: hak_article_image

To use <txp:hak_image_caption /> you need to use a form. It was the only way I could think of to allow the multitude of placements etc people would want.

When using a form <txp:hak_article_image /> works somewhat like the <txp:article />@ tag.

So you do:

<div class="columns-2-A"> 
  <txp:hak_article_image urloverride=‘1’ limit='1' break="br" wraptag="ul" form="form_name" urlhide='0'/>  
</div><!-- end of columns-2-A -->

notice the form attribute and that urlhide has been move here. Then in you form you do.

<txp:hak_article_image_link type="page">
 <txp:hak_thumbnail />
 <txp:hak_image_caption wraptag="p" />
</txp:hak_article_image_link>

I’m not sure that you want to use urlhide and urloverrid in the same set. Normally I use urlhide in the image index call. Something like

<txp:hak_article_image urlhide="1" form="index_form" />
<txp:hak_article_image urloverride="1" limit="1" form="main_image_form" />

Sorry this is confusing. I was having a really hard time writing the docs. I welcome any suggestions in how to make it clearer.


Shoving is the answer – pusher robot

Offline

#106 2007-03-21 13:07:40

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

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

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: hak_article_image

hakjoon wrote:

This took a little longer then I expected.

Ver. 0.6

  • Can now use forms (not as extensive as upm_image but it’s easily extendable).
  • Access to image caption.
  • Creates a global $hak_thisimage variable 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

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

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

Board footer

Powered by FluxBB