You are not logged in.
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
Although I also think it should be a built-in tag, in the meanwhile, you can find it on upm_image plugin.
Offline
chh_if_data should do what you need
Last edited by colak (2008-11-21 19:43:23)
neme.org | neme-imca.org | hblack.net | LABS
Offline
the_ghost wrote:
if_article_imageis 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
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
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
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