Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#289 2010-09-14 11:59:28

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,305

Re: hak_article_image

davebias wrote:

As you probably know, using the <txp:article_id /> tag inside of rel=”“ does not work.

I’m not Patrick and maybe already too little used to writing hak_image tags, but could the problem be caused by nesting tags within double quotes instead of using single ones such as <txp:hak_article_thumb rel='<txp:article_id />' />?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#290 2010-09-14 18:34:04

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

Re: hak_article_image

I think the problem is again that I use the built in Image function which clobbers the rel attribute. I have a re-implementation of it that doesn’t assume things. Let me see if I can get a dev box up and running and see if can get something out.


Shoving is the answer – pusher robot

Offline

#291 2010-09-14 21:36:23

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

Re: hak_article_image

hakjoon wrote:

My dev environment is all jacked up so I can’t actually add this to the plugin atm, but you can just add this function to the plugin and then just use it in a form with <txp:hak_thumbnail_url />

Thanks Hakjoon, but that doesn’t seem to be working. With the UPM one, my article form code included:

<div style="background-image:url(<txp:upm_article_image><txp:upm_img_thumb_url /></txp:upm_article_image>)"></div>

After pasting your new code in at the end of the plug-in, I tried replacing the whole UPM block of three with <txp:hak_thumbnail_url /> which didn’t work; neither did replacing just the …thumb_url… bit. The page source showed a blank between the brackets.

Please please steer me in the right direction! Thank you.

h.

Offline

#292 2010-09-14 21:41:12

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

Re: hak_article_image

aha!

<txp:hak_article_thumb><txp:hak_thumbnail_url /></txp:hak_article_thumb>

right?

Offline

#293 2010-09-14 21:50:48

davebias
Member
From: New York, NY
Registered: 2006-04-11
Posts: 16
Website

Re: hak_article_image

uli wrote:

I’m not Patrick and maybe already too little used to writing hak_image tags, but could the problem be caused by nesting tags within double quotes instead of using single ones such as <txp:hak_article_thumb rel='<txp:article_id />' />?

Thanks so much Uli – just that small thing did the trick! I had made the mistake of doing single quotes inside double quotes, but the single quotes are all that’s needed. The rel tags now render with the article ID number and the fancybox slideshow works perfectly!

cheers,
Dave

Offline

#294 2010-09-14 21:51:18

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,305

Re: hak_article_image

Dave & Patrick, I’ll have to do an artists’s site one of the next weeks and thought this here could be a nice finger exercise. So I decided to get back into writing hak_ai tags a little earlier and came up with two working workarounds (and one question):

<txp:variable name="rel" value='<txp:article_id />' />
<txp:hak_article_thumb link="1" rel='<txp:variable name="rel" />' linktype="image" linkclass="sshow" linktitle="txp:caption" />
<txp:rah_replace from='class="sshow"' to='class="sshow" rel="<txp:article_id />"'>
<txp:hak_article_thumb link="1" linktype="image" linkclass="sshow" linktitle="txp:caption" /></txp:rah_replace>

But the third, normal, one is working for me, too:

<txp:hak_article_thumb link="1" rel='<txp:article_id />' linktype="image" linkclass="sshow" linktitle="txp:caption" />

Aside from throwing errors: Where is not working?

EDIT: One minute too late :)

Last edited by uli (2010-09-14 21:52:10)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#295 2010-09-14 22:12:12

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

Re: hak_article_image

hicks wrote:

aha!

<txp:hak_article_thumb><txp:hak_thumbnail_url /></txp:hak_article_thumb>

right?

yeah you have to use it inside a hak_article_image or hak_article_thumb tag.

@Dave & Uli:

I’m glad that the rel tag thing worked. I didn’t think it would. I need to just finish the rewrite of this I have. It’s mostly done but It’s not fully backwards compatible yet. It’s a lot more flexible (actually works with all images in custom fields not just article-images).

Last edited by hakjoon (2010-09-14 22:15:29)


Shoving is the answer – pusher robot

Offline

#296 2010-09-14 22:18:32

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

Re: hak_article_image

Thanks!
One more thing: in <txp:hak_article_image link="0" class="gs-img-next" offset="1"/>, why is the class application not working? It doesn’t come up in the html. Thanks again. h.

Offline

#297 2010-09-15 01:38:18

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

Re: hak_article_image

yeah the class gets applied to the wraptag. It’s a TXP convention (or was when I wrote this). If you want a class in the image use the hak_image form tag which takes a class.

At a certain point adding every possible variation to the wrapper tags just got unwieldy so I added the form tags which are (hopefully) more flexible.

Last edited by hakjoon (2010-09-15 01:39:28)


Shoving is the answer – pusher robot

Offline

#298 2010-09-20 20:55:36

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

Re: hak_article_image

Nailed it. <txp:rah_replace from='alt=""' to='class="gs-img-next"'><txp:hak_article_image link="0" offset="1"/></txp:rah_replace>

Offline

#299 2010-11-04 19:46:44

secundar
New Member
From: Pittsburgh
Registered: 2004-06-02
Posts: 8
Website

Re: hak_article_image

Been away from TXP for a while and it’s good to be back… In my particular case, I’m trying to format an article that contains two images, as specified by id in the Article image field, each with it’s own class so they can be positioned and styled differently, i.e.:

<div class="csitem">
          <img class="csimg1" src="images/1.png" /> <img class="csimg2" src="images/2.png" /> 

          <div class="description">
            <h2>Title</h2>

            <p>desicription</p>
          </div>
        </div>

In my form I’ve tried to use <txp:hak_article_image limit="1"/> for the first, and added offset="1" for the second. There doesn’t seem to be a way to attach the respective class nor a way to render without the link to the image.

Any tips or examples? (I’m slowly making my way through this thread) Thanks!

Offline

#300 2011-06-27 09:39:01

[Axel]
Member
From: Switzerland/Denmark
Registered: 2007-07-26
Posts: 65
Website

Re: hak_article_image

I just found out that while using the plugin, the image title attribute for some reasons takes the content of the caption field. (img src=”***” title=“image_caption”) is there a way to change it, so it takes the image name as the title?

I call the images from an article form with

<txp:hak_article_image link="0" form="image" wraptag="aside" />

the image form is

<figure> <txp:hak_image /> <figcaption><p><txp:hak_image_caption /></p></figcaption> </figure>

Someone has an idea how to get this working?

Last edited by [Axel] (2011-06-27 09:43:06)


Greetz [Axel]

Offline

Board footer

Powered by FluxBB