当前位置:网站首页>帝国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"?>边栏推荐
- Some abilities can't be learned from work. Look at this article, more than 90% of peers
- Solution: jupyter notebook does not pop up the default browser
- Activity and fragment lifecycle
- What are the strengths of "testers"?
- Game test related tests a hero's skills (spring moves are asked more questions)
- QT: QSS custom qtoolbar and qtoolbox instances
- 《通信软件开发与应用》
- How can UI automated testing get out of trouble? How to embody the value?
- 公司测试部门来了个00后卷王之王,老油条感叹真干不过,但是...
- Qt:qss custom qlistview instance
猜你喜欢

(二)进制

封装一个koa分布式锁中间件来解决幂等或重复请求的问题

Solve the problem that pycharm Chinese input method does not follow

解决undefined reference to `__aeabi_uidivmod‘和undefined reference to `__aeabi_uidiv‘错误

STM32F1与STM32CubeIDE编程实例-TM1637驱动4位7段数码管

“测试人”,有哪些厉害之处?

Software testing e-commerce projects that can be written into your resume, don't you come in and get it?

QT: QSS custom qtableview instance

17K薪资要什么水平?来看看95后测试工程师的面试全过程…

Que se passe - t - il ensuite pour ceux qui se sont concentrés sur les tests automatisés?
随机推荐
有些能力,是工作中学不来的,看看这篇超过90%同行
Flink < --> how to use redis +with parameter
What happened to those who focused on automated testing?
(二)进制
数据库增量备份 - DB INCR DB FULL
php如何解决高并发问题
Game test related tests a hero's skills (spring moves are asked more questions)
17K薪资要什么水平?来看看95后测试工程师的面试全过程…
Stack, monotone stack, queue, monotone queue
Qt:qss custom qgroupbox instance
What experience is there only one test in the company? Listen to what they say
游戏测试相关 测试一个英雄的技能(春招被问比较多的一道题)
8年测试工程师总结出来的《测试核心价值》与《0基础转行软件测试超全学习指南》
php服务器 与redis交互大量CLOSE_WAIT分析
After 8 years of industry thinking, the test director has a deeper understanding of test thinking
Inexplicable problems in the nesting of constraintlayout and relativelayout
Qt:qss custom qscrollbar instance
Latest sales volume of pinduoduo
QT: QSS custom qtoolbutton instance
Qt:qss custom qmenubar instance