We may need more information about the document data: "The correct
thumbnail filename should be easy as the primary image filename is a
subset of the page URL"? Are you linking to an HTML page, an image,
or some other file download?
The first step is to flag the documents while completing any
additional information such as a summary. Title and filename can be
calculated from existing data.
The automation collects all flagged pages to a list. Cache if process
is slow and frequent. Choose using a random number. (See Andreas
Hartmann's post in this thread.) Cache the number or the results if
stability is desired. Add the resulting snippet to the homepage.
--
I am happy you like my documentation. More should appear. Migrating
my websites to Lenya 1.3 has higher priority than posting additional
documentation, but most of the Lenya section was collecting and
organizing my posts to the mailing lists so new material depends on
the level of activity on the MLs.
XSL is Turing-complete according to the academics. So is COBOL.
Turing-completeness is about possibilities. Real world programming is
about time to usability and ease of maintenance. The W3C forgot XPath
needs a random() function. XPath 2.0 has been a draft for two years.
Does anybody know how to make suggestions?
solprovider
On 9/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Some interesting ideas here!
>
> It doesn't have to be strictly "Page of the day" ("Page of the browser
> refresh" is fine for our purposes). It would just be leaves, not
> categories, doesn't have to include every page of a certain document
> type but rather a hand-picked selection and doesn't have to be
> especially random.
>
> I was thinking of a manually updated file of page URLs maintained by the
> administrator with a bit of JavaScript(?) that picks a "random" URL from
> the file and 'somehow' extracts the page title (for use as link text) and
> the correct thumbnail filename (which should be easy as the primary image
> filename is a subset of the page URL).
>
> Regards,
> James
>
> P.S., You are aware that XSLT is Turing-complete aren't you ;-) Jesting
> aside, thanks for your HOWTO pages, I refer to them frequently.
>
> On Fri, 21 Sep 2007, [EMAIL PROTECTED] wrote:
> > "Page of the Day" implies daily update so the update function should
> > be scheduled once each day. Cache the pagelet. Delete the homepage
> > from cache so it updates to include the new material..
> >
> > The selection should exclude the homepage. Only include leaves or
> > should category pages be included? Should editors set a flag on pages
> > that should be included? Maintain list of previously chosen pages to
> > prevent frequent repeats. How many items on recently used list?
> >
> > Use XMAP and XSL to create list of possible pages. Add a random
> > number to each item. Use the page with the lowest number.
> >
> > The main design decision is how to create the random numbers. A
> > completely XSL solution would be fun, but a custom transformer that
> > adds a "random" attribute to every element (excluding root) would be
> > simple.
> >
> > solprovider
> >
> > On 9/21/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >> We want to provide a thumbnail on the home-page which represents and links
> >> to a random page of the day under Lenya. The random pages don't
> >> necessarily have to selected "live" (I was thinking of dumping the URLs
> >> to a file periodically and making some sort of script to select one).
> >>
> >> So, has anyone done something similar? What's the easiest way to do it?
> >> James
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]