Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Show pagination form only if articles are more than limit
I have a form that controlls page navigation links.
How can I check if there are more articles than limit?
Can smd_if help me?
Last edited by wornout (2011-02-03 13:20:47)
Offline
Re: Show pagination form only if articles are more than limit
would this tip help?
Edit: just noticed your comment there. I guess not.
What code do you have now?
Last edited by colak (2011-02-03 13:35:12)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Online
Re: Show pagination form only if articles are more than limit
Thanks colak!
I simplified the code that is know:
<txp:if_article_list> <txp:variable name="has_np" value='<txp:older /><txp:newer />' /> <txp:smd_if field="txpvar:has_np" operator="isused"> <div id="page-nav"> <txp:soo_page_links window_size="10" wraptag="p" /> </div><!-- #page-nav --> </txp:smd_if> </txp:if_article_list>
Offline
Re: Show pagination form only if articles are more than limit
soo_page_links
has a showalways
attribute that, by default, should prevent it from displaying anything if there aren’t extra pages. Is it not working correctly? Or is it only the div
tags you’re concerned about?
Code is topiary
Offline
Re: Show pagination form only if articles are more than limit
soo_page_numbers works perfectly. I problem was the div
Maybe a form attribute or a container tag could be useful!
Offline
Re: Show pagination form only if articles are more than limit
Form or container seems problematic for this, because soo_page_links
displays a list — a form would be for formatting individual page links.
I think the solution you’re using is compact enough that making another plugin to cover this case isn’t called for. Note that this would also work:
<txp:if_article_list>
<txp:variable name="has_np" value='<txp:older /><txp:newer />' />
<txp:if_variable name="has_np" value=""><txp:else />
<div id="page-nav">
<txp:soo_page_links window_size="10" wraptag="p" />
</div><!-- #page-nav -->
</txp:if_variable>
</txp:if_article_list>
Code is topiary
Offline
Re: Show pagination form only if articles are more than limit
It’s true Jeff. I think at the solutions but I don’t know how to do them :-)
However this method is very efficient!
Thanks!
Offline
#8 2011-02-06 21:36:00
- Dimitri
- Member
- From: Johannesburg
- Registered: 2010-10-31
- Posts: 129
Re: Show pagination form only if articles are more than limit
Dunno if that what you need, easy to use. Careful some variables are quite old, check the docs or help to check the updated variables.
<txp:way_too_cool />
Offline