Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued/Classic Products: Article Manager 2:
Check if article is the last one

 

 


nkerschgens
User

Jun 9, 2009, 3:41 AM

Post #1 of 3 (1259 views)
Shortcut
Check if article is the last one Can't Post

Hi,

I am creating a list with articles:


Code
<ul class="featured"> 
<!-- template insert : $articleList$ -->
</ul>

<!-- templatecell : articleRow -->
<li><a href="$published.MOVIE.url$">$article.cover$</a></li>
<!-- /templatecell : articleRow -->
<!-- templatecell : article.cover.Row -->
<img src="$file.WebUrl$">
<!-- /templatecell : article.cover.Row -->


I would like to use an if statement (could also be php) to check for the last article. If it is the last article, i need to give the <li> the class "last"

Is this possible?


Donna
Staff / Moderator


Jun 10, 2009, 4:24 PM

Post #2 of 3 (1250 views)
Shortcut
Re: [nkerschgens] Check if article is the last one [In reply to] Can't Post

Hi there,

There's a "last article number" placeholder you could try using for this. See if this works for you:


Code
<!-- templatecell : articleRow -->  

<li [templateIf : $articlelist.currentresultnumber$ == $articlelist.lastresultnumber$] class="last" [/templateIf]><a href="$published.MOVIE.url$">$article.cover$</a></li>

<!-- /templatecell : articleRow -->


This just replaces the middle part of the code you quoted, so just the Article Row. The rest would stay the same.

Give that a try and let me know how it works. :)

Donna

--
support@interactivetools.com


nkerschgens
User

Jun 11, 2009, 12:36 AM

Post #3 of 3 (1248 views)
Shortcut
Re: [Donna] Check if article is the last one [In reply to] Can't Post

EXCELLENT! it works fine!
Thank you