#if(newsPage1.totalPage<=5)
#setLocal(startPage = 1)
#setLocal(endPage = newsPage1.totalPage)
#for(page : [startPage..endPage])
#if(page == newsPage1.pageNumber)
#(page)
#else
#(page)
#end
#end
#elseif(newsPage1.pageNumber > 5 && newsPage1.pageNumber< newsPage1.totalPage)
FIRST
<
#setLocal(startPage = newsPage1.pageNumber-4)
#setLocal(endPage = newsPage1.pageNumber)
#for(page : [startPage..endPage])
#if(page == newsPage1.pageNumber)
#(page)
#else
#(page)
#end
#end
>
LAST
#elseif(newsPage1.pageNumber > 5 && newsPage1.pageNumber== newsPage1.totalPage)
FIRST
<
#setLocal(startPage = newsPage1.pageNumber-4)
#setLocal(endPage = newsPage1.pageNumber)
#for(page : [startPage..endPage])
#if(page == newsPage1.pageNumber)
#(page)
#else
#(page)
#end
#end
#else
#setLocal(startPage = 1)
#setLocal(endPage = 5)
#for(page : [startPage..endPage])
#if(page == newsPage1.pageNumber)
#(page)
#else
#(page)
#end
#end
>
LAST
#end