当前位置:网站首页>帝国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"?>
边栏推荐
- Redis notes 01: Introduction
- Basic theoretical knowledge of software testing -- app testing
- 【Proteus仿真】74HC154 四线转12线译码器组成的16路流水灯
- IIS修改配置信息后不生效
- Programming examples of stm32f1 and stm32subeide -tm1637 drives 4-bit 7-segment nixie tubes
- 搭建ADG后,实例2无法启动 ORA-29760: instance_number parameter not specified
- QT: QSS custom qsplitter instance
- php如何解决高并发问题
- Comment réaliser des tests automatisés pour les tests logiciels embarqués?
- Have you learned the new technology to improve sales in 2021?
猜你喜欢
Comment réaliser des tests automatisés pour les tests logiciels embarqués?
17K薪资要什么水平?来看看95后测试工程师的面试全过程…
What kind of living condition is a tester with a monthly salary of more than 10000?
Large scale e-commerce project - environment construction
有赞CTO崔玉松:有赞Jarvis核心目标是使产品变得更加聪明和可靠
How can UI automated testing get out of trouble? How to embody the value?
Clion debug
MAUI Developer Day in GCR
I, a tester from a large factory, went to a state-owned enterprise with a 50% pay cut. I regret it
UI自动化测试如何走出困境?价值又如何体现?
随机推荐
[true question of the Blue Bridge Cup trials 44] scratch eliminate the skeleton Legion children programming explanation of the true question of the Blue Bridge Cup trials
硬 货 | 一改测试步骤代码就全写?为什么不试试用 Yaml实现数据驱动?
Qt:qss custom qspinbox instance
How to realize automatic testing in embedded software testing?
After 8 years of industry thinking, the test director has a deeper understanding of test thinking
(二)进制
Test what the leader should do
Large scale e-commerce project - environment construction
Cache routing component
软件测试——Redis数据库
What is the salary level of 17k? Let's take a look at the whole interview process of post-95 Test Engineers
使用ML.NET+ONNX预训练模型整活B站经典《华强买瓜》
php如何解决高并发问题
Google Earth Engine(GEE)——GHSL 全球人口网格数据集250米分辨率
Summary of the history of Mathematics
有赞CTO崔玉松:有赞Jarvis核心目标是使产品变得更加聪明和可靠
snownlp情感分析
. Net core - a queuing system for wechat official account
Qt:qss custom qmenubar instance
QT: QSS custom qtreeview instance