Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-09-15 17:56:32

markusfalk
Member
Registered: 2007-08-16
Posts: 57
Website

if_article_image

would find it nice to have


I sometimes destructively reverse engineer my own work and the only help is this forum.

visit me at visiongraphix

Offline

#2 2007-09-15 18:53:48

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: if_article_image

I think, you can. Should definetely be in core.

regards, marios


⌃ ⇧ < ⌃ ⇧ >

Offline

#3 2007-09-16 01:03:38

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: if_article_image

Polished this idea up a little and added the capability to select for specific image numbers. Given a little testing I’ll submit a patch for crockery for it.

ras_if_article_image_v4.1.0

Offline

#4 2007-09-16 06:19:05

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,367
Website GitHub Mastodon Twitter

Re: if_article_image

I think that a more generic tag would be better… Something like chh_if_data. I would push for something like <txp:if_empty>do this<txp:else />do that</txp:if_empty>

My proposed tag could be context sensitive and could eventually replace if_excerpt, if_comments etc. If there are other people who agree with this it would be good to hear what fields should the new tag target.

Last edited by colak (2007-09-16 06:20:08)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2007-09-16 13:38:19

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: if_article_image

How would you handle nested situations where content of different types were being looked for within one set of tags. Perhaps a specific type attribute?

Offline

#6 2007-09-17 07:04:56

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,367
Website GitHub Mastodon Twitter

Re: if_article_image

Rick… You are right… replacing the tags I mentioned above might result in very confusing situations… yet again check the example below…

I’m by no means saying that i have thought it through, nor am I asking the developers to include it. I mentioned it here for discussion purposes

How I could see it working could be something like…

<txp:if_category name="news"><txp:if_empty>no news<txp:/else><txp:excerpt /></txp:if_empty></txp:if_category>

or

<txp:if_section name="news"><txp:if_empty><txp:category name="news"><txp:else />no news</txp:if_empty></txp:if_section>

As I said… here only to discuss:)

Last edited by colak (2007-09-17 07:10:30)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2007-09-17 08:42:28

markusfalk
Member
Registered: 2007-08-16
Posts: 57
Website

Re: if_article_image

ras_if_article_image_v4.1.0 works fine.


I sometimes destructively reverse engineer my own work and the only help is this forum.

visit me at visiongraphix

Offline

#8 2007-09-17 14:08:51

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: if_article_image

colak – I’m just here casting about for ideas, its why I see the possible conflicts. Centralizing the handling of TXP’s differing types of content is an issue that has been discussed before, but not really from a tag approach. Definitely food for thought.

thanks Markus – After looking at the crockery branch it seems an if_article_image tag is already in core, the difference with ras_if_article_image is the choice of selecting by image number.

Offline

#9 2008-12-31 20:06:49

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: if_article_image

Hi Rick,

Just discovered this plugin. Is it possible to do something like this:

<txp:ras_if_article_image image_number="more than one image">
Selected content if true
<txp:else />
Selected content if false (optional)
</txp:ras_if_article_image>

What I’d like to do is check for the existence of more than one image in the article image field – the idea is that if there is more than one image, show a photo gallery, if only one image, then we don’t need the gallery.

Offline

#10 2008-12-31 20:27:19

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: if_article_image

Hi Jonathan,

upm_image supports if_article_image_list.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#11 2008-12-31 20:56:17

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: if_article_image

I did not know that! Let me check it out!

Offline

#12 2009-01-01 02:38:01

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: if_article_image

Hi Jonathan,

ras_if_article_image can be coded to use a comma delimited list for the image_number attribute. Your description of what you would like is a little cryptic. Are you looking for multiple images assigned to a single article, or do you want the conditional to compare each assigned article image to an attribute list? The later is easy to code if can use it.

ras_if_article_image_v4.0.7.dev

Last edited by rsilletti (2009-01-01 03:10:02)

Offline

#13 2009-01-01 09:57:04

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: if_article_image

Hi Rick, I haven’t tested ras_if_article_image yet, as Maniqui pointed me in the direction of upm_image’s if_article_image_list tag, which seems to do what I want. Let me explain:

On my personal site, I am using the article image field to store image id’s, and Galleria to display an image gallery of these images. However, I only use Galleria currently in the about and photos sections.

What I was looking to do is use Galleria in other sections of the site. To do this, my normal forms have to check for the existence of either one article image or many article images.

If there is only one image, display the image as-is, if more than one image then we need Galleria to display an image gallery.

Hope that explains it!

Offline

Board footer

Powered by FluxBB