Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
if_article_image tag
Although this problem is soved, I regularly run into problems that an <txp:if_article_image>
tag would wipe out at a stroke.
Does anyone know if there are any plans for one?
Offline
Re: if_article_image tag
There is the tcm_if_article_image plugin.
Shoving is the answer – pusher robot
Offline
Re: if_article_image tag
ace – thanks :)
Offline
Re: if_article_image tag
Another method. I use this on a site to test if the article image exist :
<txp:php>global $thisarticle; $site = 'http://'.$GLOBALS['siteurl']; $pic = $thisarticle['article_image']; $title = $thisarticle['title']; $authorname = custom_field (array('name' => 'Author',)); echo( (empty($thisarticle['article_image']) ? "<img src=\"".$site."/images/blank.jpg\" alt=\"Generic Cover Book\" title=\"\" />" : "<a href=\"".$site."/images/".$pic.".jpg\" title=\"«".$title."» by ".$authorname."\" class=\"thickbox\"><img src=\"".$site."/images/".$pic."t.jpg\" alt=\"Cover of the Book\" title=\"Display the cover book\" /></a>") );</txp:php>
…and in French :
<txp:php>global $thisarticle; $site = 'http://'.$GLOBALS['siteurl']; $pic = $thisarticle['article_image']; $titre = $thisarticle['title']; $auteur = custom_field (array('name' => 'Auteur',)); echo( (empty($thisarticle['article_image']) ? "<img src=\"".$site."/images/blank.jpg\" alt=\"Couverture du livre non disponible\" title=\"\" />" : "<a href=\"".$site."/images/".$pic.".jpg\" title=\"«".$titre."» de ".$auteur."\" class=\"thickbox\"><img src=\"".$site."/images/".$pic."t.jpg\" alt=\"Couverture du livre\" title=\"Afficher la couverture\" /></a>") );</txp:php>
In this sample code, if article image don’t exist, I replace it with a generic one.
Hope that’s help you.
Last edited by Pat64 (2006-11-28 20:22:46)
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
#5 2007-06-14 10:49:47
- FireFusion
- Member
- Registered: 2005-05-10
- Posts: 698
Re: if_article_image tag
+ 1 for this request to be built in to the core
Offline