dwoo icon indicating copy to clipboard operation
dwoo copied to clipboard

Paginate Plugin for dwoo2

Open MikeW22 opened this issue 10 years ago • 5 comments

I use dwoo for many projects. Now, I'm lookin for a paginate Plugin.

MikeW22 avatar Jan 31 '14 17:01 MikeW22

Is it what you want ? http://www.phpinsider.com/php/code/SmartyPaginate/

emulienfou avatar Feb 03 '14 06:02 emulienfou

Right !

Best Regards

Michael Woldrich

Von: DSanchez [mailto:[email protected]] Gesendet: Montag, 3. Februar 2014 07:51 An: emulienfou/dwoo Cc: MikeW22 Betreff: Re: [dwoo] Paginate Plugin for dwoo2 (#9)

Is it what you want ? http://www.phpinsider.com/php/code/SmartyPaginate/

— Reply to this email directly or view it on GitHub https://github.com/emulienfou/dwoo/issues/9#issuecomment-33928147 . https://github.com/notifications/beacon/6555811__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwNjk0MzA0NSwiZGF0YSI6eyJpZCI6MjQ2OTY3MDB9fQ==--dec6c89403f864a5a9a9ff4f308ffc8637b38cd6.gif

MikeW22 avatar Feb 03 '14 09:02 MikeW22

Maybe this template I use would be helpful to you:

{template pagingLinks total pageSize=12 showAll=false}
<div class="paging">
    {if $total > $pageSize}
        {$previousOffset = tif($.get.offset && $.get.offset > $pageSize ? $.get.offset - $pageSize : 0)}
        {$nextOffset = tif($.get.offset ? $.get.offset + $pageSize : $pageSize)}
        {if $.get.offset > 0}
            <a class="paging-link prev" href="?{refill_query limit=$pageSize offset=$previousOffset}">&larr;&nbsp;Prev</a>
        {/if}

        <ol class="paging-pages">
        {foreach item=page from=range(1,ceil($total/$pageSize))}
            {math "($page-1)*$pageSize" assign=offset}
            <li class="paging-page">
                {if $.get.offset == $offset}
                    <strong class="paging-current">{$page}</strong>
                {else}
                    <a class="paging-link" href="?{refill_query limit=$pageSize offset=$offset}">{$page}</a>
                {/if}
            </li>
        {/foreach}
        </ol>

        {if $.get.offset < $total - $pageSize}
            <a class="paging-link next" href="?{refill_query limit=$pageSize offset=$nextOffset}">Next&nbsp;&rarr;</a>
        {/if}

        {if $showAll}
            <a class="paging-link show-all" href="?{refill_query limit=0}">Show All ({$total|number_format})</a>
        {/if}
    {/if}
</div>
{/template}

themightychris avatar Mar 25 '14 20:03 themightychris

For information, the Block template as been replaced by function in Dwoo 2.

So, in Dwoo 2.x branch you need to replace {template}{/template} by {function}{/function}.

emulienfou avatar Mar 26 '14 07:03 emulienfou

Need to check this code in 1.2.2 and provide a demo for future use!

emulienfou avatar Sep 10 '16 13:09 emulienfou