0

I've setup a content collection for a portfolio.

When displaying a page in the content collection, I want to display links to the NEXT and PREVIOUS items in the collection.

Also, is it possible to check if there is a next and previous page (so as not to display link if there isn't one.

Many Thanks in advance.

4

2 回答 2

1

尝试这样的事情:

<cfif iterator.pageCount() gt 1>
<div class="pagination">
    <ul class="moreResults">
        <cfif $.event('page') gt 1><li class="navPrev"><a href="" data-page="#evaluate($.event('page')-1)#">&laquo;</a></li></cfif>
        <cfif $.event('page') lt iterator.pageCount()><li class="navNext"><a href="" data-page="#evaluate($.event('page')+1)#">&raquo;</a></li></cfif>  
    </ul>
</div>
</cfif>
于 2013-07-26T16:53:38.060 回答
0

我结束了这个。可能不是最好的方法,但它有效:

portfolio = $.getBean('feed').loadBy(name='Portfolio').getIterator().getPageIDList();

currentPageNumber = listLen(portfolio) - $.content().getOrderNo() + 1;
pagePrevious = "";
pageNext = "";

if (currentPageNumber GT 1)
    pagePrevious = listGetAt(portfolio,currentPageNumber - 1);      

if (listLen(portfolio) GT currentPageNumber)
    pageNext = listGetAt(portfolio,currentPageNumber + 1);

pagePreviousURL = $.getBean('content').loadBy(contentHistID = pagePrevious, siteID = event.getValue('siteID')).getURL();
pageNextURL = $.getBean('content').loadBy(contentHistID = pageNext, siteID = event.getValue('siteID')).getURL();
于 2013-08-21T02:35:21.627 回答