朝霞的颜色多的不能再多了。有橘黄色桃红色朱红色葡萄紫,还有淡红色等等。我觉得大自然有一个五颜六色的彩笔盒,把天空当画板,给天空上色。
利用SQL来实现,以下是我的源码,要根据你的数据库表名自行改动:
{dede:sql sql="select as_ask.id,as_ask.title,as_askanswer.content from as_ask LEFT JOIN as_askanswer on as_ask.id=as_askanswer.askid where as_askanswer.ifanswer=1 and as_askanswer.ifcheck=1 or as_ask.bestanswer=as_askanswer.id order by as_ask.id desc LIMIT 0,1"}<br /><strong>问:</srtong><a rel="nofollow noopener noreferrer" href="/ask/question.php?id=[field:id/]" class="link3">[field:title function=cn_substr(@me,46)/]</a><br /><p><strong>答:</srtong>[field:content function=cn_substr(html2text(@me),40)/],...<a rel="nofollow noopener noreferrer" href="/ask/question.php?id=[field:id/]" class="link2">详情>></a></p><br />{/dede:sql}
放在首页任意位置调用就可以了。
里面调用条数,长度,可以根据自己的需求进行调整 。
可在在全局标记测试效果。
如果需要分栏目调用,那么加入as_ask.tid2=XX,如我的整形栏目为as_ask.tid2=7,调用如下:
{dede:sql sql="select as_ask.id,as_ask.title,as_askanswer.content from as_ask LEFT JOIN as_askanswer on as_ask.id=as_askanswer.askid and as_ask.tid2=7 where as_askanswer.ifanswer=1 and as_askanswer.ifcheck=1 or as_ask.bestanswer=as_askanswer.id order by as_ask.id desc LIMIT 0,1"}<br /><strong>问:</srtong><a rel="nofollow noopener noreferrer" href="/ask/question.php?id=[field:id/]" class="link3">[field:title function=cn_substr(@me,46)/]</a><br /><p><strong>答:</srtong>[field:content function=cn_substr(html2text(@me),40)/],...<a rel="nofollow noopener noreferrer" href="/ask/question.php?id=[field:id/]" class="link2">详情>></a></p><br />{/dede:sql}
到此这篇关于织梦模板DEDECMS的首页调用问答模块内容的好代码教程就介绍到这了。优秀的人,不是与生俱来就领先一步,也不一定比别人更加幸运。他们中的多数,只是在任何一件小事上,都对自己有所要求,不因舒适而散漫放纵,不因辛苦而放弃追求。雕塑自己的过程,必定伴随着疼痛与辛苦,那一锤一凿的敲打,终能让我们收获一个更好的自己。更多相关织梦模板DEDECMS的首页调用问答模块内容的好代码教程内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!