2008-11-21 19:20:48

the_ghost
Plugin Author
pi
Real name: Victor
From: Minsk, The Republic of Belarus
Known languages: Belorussian, English, Russian, German, Italian, France, Turkish
Website

Add tag txp:if_article_image

There are a lot of core tags if_article_something but very important if_article_image is absent. It makes to use different way to achieve such logic…


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

 

2008-11-21 19:31:04

maniqui
Moderator
omega
Real name: Julián
From: Buenos Aires, Argentina
Known languages: es,en

Re: Add tag txp:if_article_image

Although I also think it should be a built-in tag, in the meanwhile, you can find it on upm_image plugin.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

 

2008-11-21 19:34:00

renobird
Member
xi
Real name: Tom Reno
From: Gainesville, Florida
Website

Re: Add tag txp:if_article_image

I’ve never used it – but this might be what you need.

Scroll down a few posts.

There’s this too.

Last edited by renobird (2008-11-21 19:36:08)

Offline

 

2008-11-21 19:42:32

colak
Admin
omega
Real name: Yiannis
From: Cyprus
Known languages: el, en
Website

Re: Add tag txp:if_article_image

chh_if_data should do what you need

Last edited by colak (2008-11-21 19:43:23)

Offline

 

2008-11-21 19:50:34

renobird
Member
xi
Real name: Tom Reno
From: Gainesville, Florida
Website

Re: Add tag txp:if_article_image

yep. Forgot about using chh_if_data for this.
That’s probably the cleanest solution, as it it can be used in a variety of other ways too.

Offline

 

2008-11-21 19:58:41

Bloke
Developer
omega
Real name: Stef Dawson
From: Leeds, UK
Known languages: Engl(ish)
Website

Re: Add tag txp:if_article_image

the_ghost wrote:

if_article_image is absent

Or if you already have it loaded on your site for other things, there’s:

<txp:smd_if field="article_image" operator="isused">
   // Yay, there's an article image
</txp:smd_if>

:-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

 

2008-11-21 20:03:06

renobird
Member
xi
Real name: Tom Reno
From: Gainesville, Florida
Website

Re: Add tag txp:if_article_image

Take home message:

There’s a bunch of ways to do this already – probably no need to add to the core.

:)

Bloke, nice – I never knew about that.

Offline

 

2008-11-21 20:37:28

Els
Admin
omega
Real name: Els Lepelaars
From: The Netherlands
Known languages: nl, en, (some: de, fr, es, it)
Website

Re: Add tag txp:if_article_image

What about the ‘native’ way? – well, almost… ;)

<txp:variable name="article_img" value='<txp:article_image />' />

<txp:if_variable name="article_img" value="">
	// No article image
<txp:else />
	// Yay, there's an article image
</txp:if_variable>

<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

 

2008-11-21 20:55:09

the_ghost
Plugin Author
pi
Real name: Victor
From: Minsk, The Republic of Belarus
Known languages: Belorussian, English, Russian, German, Italian, France, Turkish
Website

Re: Add tag txp:if_article_image

I even didn’t think that community will found so many variants. But I know how to make such conditional check, or with the help of smd_if, or with the help of txp:variable. But I think, this tag should be in the core. I think it’s rather important tag. For me it’s even more important than txp:if_keywords :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

 

2008-11-21 21:02:00

renobird
Member
xi
Real name: Tom Reno
From: Gainesville, Florida
Website

Re: Add tag txp:if_article_image

Victor,

I suspect there would be resistance to adding it to the core – since there are so many other ways to achieve the exact same thing with plugins.
Especially if the example Els posted above works…then you really already have the functionality built-in (it’s just not a single tag).

Any ‘ole how…this has been interesting…I definitely learned a few ways to approach this.

Last edited by renobird (2008-11-21 21:02:17)

Offline

 

Powered by FluxBB