Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 6 and Version 7 of Search_Pagination


Ignore:
Timestamp:
03/22/06 10:50:12 (13 years ago)
Author:
godoy
Comment:

Providing a clear method for using "<" and ">" in Kid templates.

Legend:

Unmodified
Added
Removed
Modified
  • Search_Pagination

    v6 v7  
    152152you can follow "Pagination Control" for Search Pagination on yahoo Design Pattern Library to implement more functional Search Pagination. 
    153153http://developer.yahoo.net/ypatterns/pattern_searchpagination.php 
     154 
     155= Alternatives to using "<" and ">" operators = 
     156 
     157There are two alternatives to using those directly (there's no problem with ">" so you should use it to make things more readable): 
     158 
     159 * using &lt; and &gt; entities (which are more readable than their Unicode code, specially to avoid mixing charsets...) 
     160 
     161 * using Boole's algebra and inverting the comparison you want to do (since ">" can be used directly).  So, rewriting the above code you'd end up with: 
     162 
     163   {{{ 
     164<span py:if = "query_size >= end"><a href = "/?start=${(start/10)+1}">Next</a> </span> 
     165}}} 
     166 
     167   (Remember that "a < b" is equal to "b >= a",  "a <= b" is the the same as "b > a" and so on.) 
     168 
     169These changes will improve readability and maintenability of your code.