<php> $where=[ 'post.create_time'=>['egt',0] ]; </php> <ul class="list-unstyled article-list"> <portal:articles item="vo" field="*" where="$where" order="post.create_time DESC" page="5" relation="categories" categoryIds="$category.id" returnVarName="articles_data"> <li class="list-item"> <div class="media"> <div class="media-left"> <a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}"> <img class="media-object mb-20" src="{:cmf_get_image_url($vo['more']['thumbnail'])}" alt="{$vo.post_title}" style="width: 120px;height: auto;"> </a> </div> <div class="media-body"> <h4 class="media-heading"><a href="{:cmf_url('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}">{$vo.post_title}</a></h4> <p>{$vo.post_excerpt}</p> <div class="list-actions"> <a href="javascript:;">访问量:<span>{$vo.post_hits}</span></a> // <a href="{:url('portal/Article/doLike',array('id'=>$vo['id']))}" class="js-count-btn"> 点赞数:<span class="count">{$vo.post_like}</span></a> // <a href="{:url('user/Favorite/add',array('id'=>$vo['id'],'cid'=>$category['id']))}" class="js-favorite-btn" data-id="{$vo.id}" data-table="portal_post" data-title="{:base64_encode($vo.post_title)}" data-url="{:cmf_url_encode('portal/Article/index',array('id'=>$vo['id'],'cid'=>$category['id']))}" > 收藏该文章 </a> </div> </div> </div> </li> </portal:articles>
这里使展示的URL链接不是美化后的链接,而是id链接。
美化规则如下:
使用上述代码,点击跳转的链接如下:
http://localhost/****/team/38.html
预想的链接应该是如下:
http://localhost/****/about.html:
后来又通过后台文章管理处打开文章,获得的链接如下:
http://localhost/****/portal/article/index/id/38.html
值得一说的是,三个链接得到的页面都是一致的真实详情页。
感觉有点乱,求大神帮忙理一理。顺便求一个在列表页能够展示所属详情页的URL,这个URL需要是美化后的。
0.话题发布后没及时显示,请联系官方QQ群管理;
1.话题支持代码,qq截屏直接粘贴,和QQ群一样;
2.问题描述清,比如服务器版本,程序版本;
3.能上代码,就不用文字;
4.把问题发到话题后再发QQ群;
5.如果感觉回复者解答的不错,可以发红包!
6.多帮助别人也是对自己的锻炼!
7.付费讨论中只有提问者和付费用户才可以查看回复
1.评论积分+1;每天最多10次奖励
2.发布话题积分+1;每天最多5次奖励
3.垃圾评论积分-500;
4.黄色,暴力,违反我国法律评论直接封号