[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Questions...

On Sun, 23 Jan 2000, Carsten Wartmann wrote:

> I want to have a news and quicklinks area on my site, so I thought it
> would be the easiest to make directories "news" and "quicks" which
> contain simple files like i.e. NewVersion1.72.wml:
> <date>12.12.1999</date>
> <link>www.blender.nl</link>
> <text>Blender Version 1.72</text>
> and let wml render them into a nice table (the tags are definied in my 
> common.wml).
> I first come up with the idea to let  perl do the work:
> #include "common.wml"
> <:
> 	@FILES = ();
>     push(@FILES, `find ./news/ -depth -type f -name "*.wml" -print`);
>         @FILES = sort(@FILES);
>     foreach $file (@FILES) {
> 	@DATEI = ();
>         $file =~ s|\n$||;
>         $file =~ s|^\./||;
> 	push(@DATEI, `cat $file`);
> 	print @DATEI;
> 	print "\n";
>     }
> :>
> This works some kind, but naturally the tags didnīt get expanded,
> because perl is pass 3... I tried to call wml with the option -p
> 1-3,1-9 but this didnīt work, it does the passes this way:
> 1,1,2,2,3,3,... (why?)

Passes are sorted. You have to put an exclamation mark after pass
specification to let this unsorted. As i did not know whether this is a
good idea, i did not document this feature. It is documented in

> Maybe Iīm totally wrong with my idea and someone could point me into
> the right direction.

There are many solutions. The simplest is

#include "common.tmpl"
#include "news/*.inc"

In lines above, i replaced .wml suffix because this suffix should be
reserved for input file only.

Denis Barbier
WML Maintainer

Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com