Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: web counter, next-page method?

From: carl:cybercraft at: 8-Apr-2004 16:36

>OK, guys, all fine answers. As for DB aproach pov, I think I can manage >it, as I have some db background. Maybe I expressed myself a bit >incorrectly. My "problem" is that of how to visually represent that. As >I already said - I don't do gfx + html. It is done by our gfx folk. I >can fill-in the table with appropriate info, but I was asked what should > >designer do to represent "next-page" visually. > >e.g. >- once on first page, you can represent your results as: (1) 2 3 4 ->> >- you click "2", you get - <<-- 1 (2) 3 4 -->
>Those page-continuation sections, can have various visual >representations - as e.g. with counter - you can use html only with >clear text, or you can compose it with bitmaps, etc. But there is no >"if, then, else" awailable with html. So my question is, what is the >right aproach to build html template for me to just fill in the data. >Maybe the only solution is that designer marks html section where such >"next-page" section will be placed, and it will be separated in another >few templates I will have to plug-in? As you can see with above example, >it is rather dynamic - when you start, there is no back button, as you >move to (2), there is the back button, once you reach (4), there will be >no forward button, etc.
No, he could include it in the main template, with a tag marking where the start and end of [back-page] [pages] and [next-page] are to go (or not to go), along with a word in the HTML indicating where your URL is to be inserted. (He could then change the template later without you needing to change your code.) Then your CGI would parse the template and add (or not add) the HTML (and insert an URL) to the page being output based on how many pages of results there are and on what page you're on... the back-page: if page > 1 [insert back-page-button] for pages: if pages > 1 [insert pages-buttons] for next-page: if page < pages [insert next-page-button] As I assume your CGI must be adding the results to the output too, the format you use for the page tages in the template should match those for the results, so your parsing is looking for the same tags for both in the template. The results are dynamic too of course, as they'll not always having 30 items in them, so not too dissimilar to generating the pages buttons.