I've noticed that, very often, it is necessary to provide an index or listing
of articles.
Perhaps it would be useful if someone whipped up a set of utility functions
for this purpose.
Suggested prototypes:
mgd_render_list(topic, number, base_url, prefix, suffix, [type]) - Would
produce a list of the first [number] of articles from topic [topic] with,
optionally, type [type], producing a string for each of the form: [prefix]
<a href = "[base_url]/[id_of_article]">[article-title]</a> [suffix]. If
base_url is empty, then don't print out the <a> tag stuff. Provides some
sprintf style replacement things for the pre and suf -fix things, something
like %a for abstract, %c for last modified date, %A for author name... etc.
mgd_render_list_calendar(topic,base_url, prefix,suffix, startstamp, endstamp,
[type]) - see mgd_render_list, this shows everything between startstamp
+ endstamp (which are unix timestamps).
mgd_render_topic_list(topic,base_url, prefix, suffix) - list the subtopics.
Otherwise the same as mgd_render_list
for the first two, add the usual variations (_all, and whatever else). For
the third, I don't believe _all would be useful...
I would advocate adding a whole series of mgd_render_xxxx family functions,
to help automate + make more consistent those common tasks such as showing
a list of articles or topics. I know that on the LHS site
(http://www.lincolnhs.pps.k12.or.us)
I've had to implement such lists many times... It would be much nicer if
I could just call a function (even one with big arguments :) and have it
be done.
Some other nice things to have in the mgd_render_xxx family:
mgd_render_login(login_url, backcolor, forecolor, caption, setcookie, links)
- print out a nice html login form suitable for putting on a nav bar, similar
to the ETP login box, which would automatically log the user into midgard
+ set the midgard cookie. Example:
/=================\
|Username:_______ |
|Password: _______ |
| [links] Login |
\=================/
And, of course, it would make sites MUCH easier to maintain. Instead of
scrolling past several instances of the same code with slight variations,
you would just see the mgd_render_xxx function and be able to instantly
tell what's going on, AND not have to worry about debugging.
I think that adding this wouldn't defeat Midgard's purpose of providing
a non-layout specific way of managing HTML, PHP, and content. Afterall,
the functions don't generate anything of themselves - they only take user-
passed data and manipulate it.
Ben Garney
LHS Webmaster
http://www.lincolnhs.pps.k12.or.us/
IMPORTANT NOTICE: If you are not using HushMail, this message could have been read
easily by the many people who have access to your open personal email messages.
Get your FREE, totally secure email address at http://www.hushmail.com.
--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org
To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]