[Pmwiki-users] Skins
Nils Knappmeier
nk
Sat Feb 21 17:16:48 CST 2004
>And a bit "off topic":
>I have tried several "template" generators (including smarty), but I
>always get back to PHP. after all I think PHP is much better for "parsing"
>templates than anyone of the scripts available, and if your pages are a
>little bit more than fairly easy you need a lot of insight in those template
>scripts to get it to work, and thats where I feel PHP is just as good. Not
>to say "much better".
>
>
I think this is a good point. I mean PHP is supposed to be an inline
programming language, where you
put some PHP code in a special tag in an HTML file. As far as I can see,
PmWiki's files usually start
with a <?php and end with a ?>, and there is direct HTML code included
anywhere.
Now for a start, how would that be:
We put a file called template.php somewhere, which contains HTML code
with some PHP function calls or variables.
<html>
<body>
<h1><? printTitle() ?></h1>
<table>
<tr><td><? printContents('Main/Sidebar') ?></td>
<td><div class='wikitext'><? printContents($CurrentPage) ?></div></td>
</tr></table>
</body>
</html>
Now, how it exactly should work I don't know. But somehow, some
processing will be done, to ensure that some global variables
contain the correct values ($CurrentPage, $Title, whatever), and that
some functions (printContents()) do the right thing. And after
the processing, you just do an include('template.php');
Of course, same as for config.php, you can specify your own template in
local and if it exists, the main template will just be ignored.
Now, the question is: How many templates do we need? What are the
functions and variables that are needed to make the configuration
of that stuff easy and flexible.
How does that sound?
>/ /Runar
>
>
>
>
>
More information about the pmwiki-users
mailing list