当前位置:网站首页>帝国cms 无缩略图 灵动标签(e:loop)判断有无标题图片(titlepic)的两种写法
帝国cms 无缩略图 灵动标签(e:loop)判断有无标题图片(titlepic)的两种写法
2022-07-03 09:49:00 【用户5471431】
最近做一个网站项目中,首页用灵动标签(e:loop)实现新文章的列表,部分文章标题图片(titlepic),部分文章没有标题图片(titlepic),希望实现如下图效果,需要判断是否具有标题图片titlepic,如果不具有标题titilepic,则不显示或者不输出img标签,如果具有标题图片titlepic,则输出显示img标签。
实现如上效果代码如下(通过php判断是否具有标题图片titlepic):
<?php
if($bqr[titlepic])
{
?>
//有标题图片时显示内容
<?php
}
else
{
?>
//没有标题图片时显示内容
<?php
}
?>
另外一种方式,是没有titilepic的情况先,输出默认图片地址:
<?=$bqr[titlepic]?$bqr[titlepic]:"http://www.fangzhanba.com/e/data/images/notimg.gif"?>
边栏推荐
- Qt:qss custom qpprogressbar instance
- TypeScript学习总结
- The normal one inch is 25.4 cm, and the image field is 16 cm
- 历经一个月,终于拿到金蝶Offer!分享一下四面面经+复习资料
- 我对测试工作的一些认识(资深测试人员总结)
- 2022 pinduogai 100000 sales tutorial
- Programming examples of stm32f1 and stm32subeide -tm1637 drives 4-bit 7-segment nixie tubes
- 我,大厂测试员,降薪50%去国企,后悔了...
- redis那些事儿
- 今晚要修稿子準備發佈。但是,仍卡在這裡,也許你需要的是一個段子。
猜你喜欢
随机推荐
测试理论概述
TypeScript学习总结
我,大厂测试员,降薪50%去国企,后悔了...
软件测试——Redis数据库
Crawl with requests
IIS修改配置信息后不生效
数据库增量备份 - DB INCR DB FULL
Tencent micro app to get wechat user information
ConstraintLayout跟RelativeLayout嵌套出现的莫名奇妙的问题
Flink < --> Introduction to JDBC +with parameter
php如何解决高并发问题
17K薪资要什么水平?来看看95后测试工程师的面试全过程…
Qt:qss custom qmenubar instance
Comment réaliser des tests automatisés pour les tests logiciels embarqués?
反正切熵(Arctangent entropy):2022.7月最新SCI论文
How to realize automatic testing in embedded software testing?
程序进程管理工具-go supervisor
EPS电动转向系统分析
Some abilities can't be learned from work. Look at this article, more than 90% of peers
Oracle收回权限 & 创建角色