迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費且不限制商業(yè)使用,是免費開源的產(chǎn)品,以萬端互聯(lián)為設(shè)計理念,支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
分頁條數(shù)不夠的時候怎樣讓它不顯示分頁
這個需要把你的模板代碼發(fā)來看一下呀。
{template "header.html"}
<div class="ban" style="background:url({THEME_PATH}tongbo/images/7a83e3f9556c1bf9849a044ecaccc82e.jpg) no-repeat center center;"></div>
<div class="ny">
<div class="container"> {template "left.html"}
<div class="fr">
<div class="title"><span>{$cat['name']}</span>
<p><a href="{SITE_URL}">主頁</a> > {dr_catpos($catid, '', true, '<a href="[url]">[name]</a> > ')}</p>
</div>
<div class="list-1">
{module catid=$catid order=updatetime page=1}
<dl>
<dt><a href="{$t['url']}" title="{$t['title']}">{$t['title']}</a><span>{dr_date($t['_updatetime'], 'Y-m-d')}</span></dt>
<dd>{dr_strcut($t['description'], 80, '...')} </dd>
</dl>
{/module} </div>
<div class="pages">
<style type="text/css">
.pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px; }
.pagination > li {
display: inline; }
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
line-height: 1.42857;
text-decoration: none;
color: #337ab7;
background-color: #fff;
border: 1px solid #ddd;
margin-left: -1px; }
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px; }
.pagination > li:last-child > a,
.pagination > li:last-child > span {
border-bottom-right-radius: 4px;
border-top-right-radius: 4px; }
.pagination > li > a:hover, .pagination > li > a:focus,
.pagination > li > span:hover,
.pagination > li > span:focus {
z-index: 2;
color: #23527c;
background-color: #eeeeee;
border-color: #ddd; }
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus,
.pagination > .active > span,
.pagination > .active > span:hover,
.pagination > .active > span:focus {
z-index: 3;
color: #fff;
background-color: #337ab7;
border-color: #337ab7;
cursor: default; }
</style>
<div class="pagination">{$pages}</div>
{template "footer.html"}
</body>
</html>
<div class="pagination">{if $num > 1}{$pages} {else} 沒有達到{/if}</div>
加上和不加的對比效果,在數(shù)量夠的情況下也顯示沒有達到
去掉page=1
回復@xr222 不對,那樣就不分頁了,我的意思是讓不夠分頁條件時不顯示,達到分頁數(shù)量的時候顯示分頁
這樣有什么意義呀,達不到分頁就顯示個1也沒事呀
待解決
這個判斷就可以
回復@疾風 這個方法在數(shù)量夠的情況下不會分頁
默認是10條分頁,評論設(shè)置里改一下你想多少條分頁就寫多少!
回復@我不是大佬 應(yīng)該是 {if $nums > 1}{$pages}{/if}
這個需要把你的模板代碼發(fā)來看一下呀。
{template "header.html"}
<div class="ban" style="background:url({THEME_PATH}tongbo/images/7a83e3f9556c1bf9849a044ecaccc82e.jpg) no-repeat center center;"></div>
<div class="ny">
<div class="container"> {template "left.html"}
<div class="fr">
<div class="title"><span>{$cat['name']}</span>
<p><a href="{SITE_URL}">主頁</a> > {dr_catpos($catid, '', true, '<a href="[url]">[name]</a> > ')}</p>
</div>
<div class="list-1">
{module catid=$catid order=updatetime page=1}
<dl>
<dt><a href="{$t['url']}" title="{$t['title']}">{$t['title']}</a><span>{dr_date($t['_updatetime'], 'Y-m-d')}</span></dt>
<dd>{dr_strcut($t['description'], 80, '...')} </dd>
</dl>
{/module} </div>
<div class="pages">
<style type="text/css">
.pagination {
display: inline-block;
padding-left: 0;
margin: 20px 0;
border-radius: 4px; }
.pagination > li {
display: inline; }
.pagination > li > a,
.pagination > li > span {
position: relative;
float: left;
padding: 6px 12px;
line-height: 1.42857;
text-decoration: none;
color: #337ab7;
background-color: #fff;
border: 1px solid #ddd;
margin-left: -1px; }
.pagination > li:first-child > a,
.pagination > li:first-child > span {
margin-left: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px; }
.pagination > li:last-child > a,
.pagination > li:last-child > span {
border-bottom-right-radius: 4px;
border-top-right-radius: 4px; }
.pagination > li > a:hover, .pagination > li > a:focus,
.pagination > li > span:hover,
.pagination > li > span:focus {
z-index: 2;
color: #23527c;
background-color: #eeeeee;
border-color: #ddd; }
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus,
.pagination > .active > span,
.pagination > .active > span:hover,
.pagination > .active > span:focus {
z-index: 3;
color: #fff;
background-color: #337ab7;
border-color: #337ab7;
cursor: default; }
</style>
<div class="pagination">{$pages}</div>
</div>
</div>
</div>
</div>
{template "footer.html"}
</body>
</html>
<div class="pagination">{if $num > 1}{$pages} {else} 沒有達到{/if}</div>
加上和不加的對比效果,在數(shù)量夠的情況下也顯示沒有達到
{module catid=$catid order=updatetime page=1}
去掉page=1
回復@xr222 不對,那樣就不分頁了,我的意思是讓不夠分頁條件時不顯示,達到分頁數(shù)量的時候顯示分頁
這樣有什么意義呀,達不到分頁就顯示個1也沒事呀
待解決
<div class="pagination">{if $num > 1}{$pages} {else} 沒有達到{/if}</div>
這個判斷就可以
回復@疾風 這個方法在數(shù)量夠的情況下不會分頁
默認是10條分頁,評論設(shè)置里改一下你想多少條分頁就寫多少!
回復@我不是大佬 應(yīng)該是 {if $nums > 1}{$pages}{/if}