Try to put the actual code in your conditional (or use an embed, perhaps a snippet):
{if current_page == total_pages}
<?php do something -->
{/if}
Yes, that does work but not for the purpose I need I’m afraid.
perhaps you could try an example.
Looking at the parse order, it would seem what I’m trying to do can’t be done, or I’m approaching it from the wrong angle.
I have resolved it in a different way, by using
{if current_page == total_pages} <a href="http://{path=group/template}">View Everything Else</a>{/if}
but ideally would have liked the “Everything Else” to be on the last page of the pagination. (But NOT within the {pagination}, on a separate part of the page - hence the use of a conditional variable.
If anyone has some spare time and would like to take a look at my setup, here it is with site specific code stripped out:
<?php
/*
* template group: listings
* template : view
* weblog : events
* entries : 15
* PHP Parsing Enabled. Try with Input and Output.
*/
?>
{exp:weblog:entries weblog="events" status="Open" limit="5" paginate="both"}
{paginate}
(Viewing page {current_page} of {total_pages}) {pagination_links}
{if "{current_page}" == "{total_pages}"}
<?php $is_last_page = true; /* It's the last page ! */?>
{/if}
{/paginate}
<div>
<h2>{count} {title}</h2>
<p>{summary}<br />
</div></p>
<p>{/exp:weblog:entries}</p>
<p><?php if ($is_last_page) { /* It's the last page…let's show the other entries */ ?><br />
{exp:weblog:entries weblog="events" status="Closed"}<br />
These entries have status "Closed".</p>
<p><div></p><h2>{count} {title}</h2>
<p>{summary}<br />
</div></p>
<p>{/exp:weblog:entries}</p>
<p><?php } ?>
See what results you get.
makes good sense to me