Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#157 2007-11-19 18:05:26

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

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

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

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

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

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

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

Mike Montgomery
Member
Registered: 2005-11-28
Posts: 29
Website

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

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

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

#166 2008-02-14 06:34:32

cuda
Member
From: Georgia, USA
Registered: 2008-02-06
Posts: 70
Website

Re: hak_article_image

I need a hand first time with this plugin….

I am using <txp:article_custom from=“some_form” /> and want to include the first image in the article image field comma separated list in the form so I thought I could use:

—-some_form
<txp:hak_article_thumb limit=“1” />

<rest of form stuff>
—-end some_form
form type : article

But it does not display an image. I have two image ID’s in the article field (1,2) which is displaying all the other information for the articles specified in the form other then the image…I think it is just a matter of me using the tag properly but not sure….thanks for the help

Offline

#167 2008-02-14 13:59:44

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

Re: hak_article_image

Can you post exactly what’s in your article_image field? It could be just a syntax issue or it could be a bug. What you are describing seems like you are doing everything right.


Shoving is the answer – pusher robot

Offline

#168 2008-02-14 14:29:41

cuda
Member
From: Georgia, USA
Registered: 2008-02-06
Posts: 70
Website

Re: hak_article_image

article image field : 1,2

Now I did not put the tag in the body of the article….I wanted to avoid doing that and have the form handle the image display. So the form looks like this:

—————form
<txp:hak_article_thumb limit=“1” />

<p>
<txp:body />
</p>

<dl>
<dt><span>Address :</span></dt><dd><txp:custom_field name=“Address” /></dd>

<dt><span>Sq. Ft. :</span></dt><dd><txp:custom_field name=“Sq. Ft.” /></dd>

<dt><span>Price :</span></dt><dd><txp:custom_field name=“Price” /></dd>
</dl>
——end form

called from a page template with

<txp:article_custom form=“forsale-homepage” limit=“1” />

I hope that is of more help….thanks for the quick response!

Offline

Board footer

Powered by FluxBB