logo

New Response

« Return to the main article

You are replying to:

    • avatar
    • Bart
    • Posted on Thu 11 Mar 2004

    This was a really nice tip.

    I adapted it for use with a normal view (not just for searching) by doing an @elements(@dblookup)) to get the total hits.

    Not great for performance, I suppose, but I don't notice any problems with a small database.

    I also added a check to see if the start URL parameter was null and start=1, so that I could bold the first group when you first open the view.

    GroupBy:=30; Count:=GroupBy;

    link := "<a href=\""+@ViewTitle+"?openView&start=";

    TotalHits:=@Elements(@DbColumn("":"";"";@ViewTitle;1));

    start:=1; StartURLQry:=@UrlQueryString("start");

    @While(start<totalhits; @If(@Text(start) = StartURLQry | (StartURLQry="" &Start=1); html:=html + "<b>[ " + @Text(1+(start-1)) + " - " + @If(Start+GroupBy>TotalHits;@Text(TotalHits);@Text((start+GroupBy-1)))+ " ]</b> "; html:=html + link + @Text(start) + "&count=" + @Text(count) + "\">[ " + @Text(1+(start-1)) + " - " + @If(Start+GroupBy>TotalHits;@Text(TotalHits);@Text((start+GroupBy-1))) + " ]</a> ");

    start:=start+GroupBy );

    html

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: