Gossamer Forum
Home : Products : Gossamer Links : Discussions :

What "test" can I use for only the first page?

Quote Reply
What "test" can I use for only the first page?
On the Categories templates, I want to put a <%if XXX%> around "Related Categories" so it only appears on the first page. What soet of variable can I use that wil do that?

Thanks!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] What "test" can I use for only the first page? In reply to
Sorry, I'm not really sure what you mean by that. How are you using the related categories? The 'yahoo' mode, or the regular one where it's in a separate loop?

Adrian
Quote Reply
Re: [brewt] What "test" can I use for only the first page? In reply to
Hi-

I use "regular" Related....

What I want to do is do an <%if "this is the first page"%>Related Categoriies Loop and stuff<%endif%> so Related Categories only appears on Page 1...
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] What "test" can I use for only the first page? In reply to
I was going to suggest that you use the paging hash, but there's the problem that there's currently no way to know if the hash exists or not. Otherwise, you could do something like:
Code:
<%if not defined paging or paging.current_page == 1%>...<%endif%>
I'll have to talk to Jason about what we can do about that. Until then, you're out of luck!

Adrian
Quote Reply
Re: [brewt] What "test" can I use for only the first page? In reply to
This should work.
Code:
<%if paging.current_page <= 1%>

Adrian
Quote Reply
Re: [brewt] What "test" can I use for only the first page? In reply to
Adrian:

Thanks- works like a charm!
dave

Big Cartoon DataBase
Big Comic Book DataBase