[Pmwiki-users] Skins
Nils Knappmeier
nk
Sun Feb 22 02:52:52 CST 2004
>Many thanks for this excellent example! Now then, do me a favor... :-)
>show me an example of how a layout designer would specify
>where/how the "Edit Page", "Page Revisions", etc. links would be
>coded in the above format. Show enough to produce the entire
>resulting links, i.e.,
>
> <a href='http://www.mysite.com/path/to/pmwiki/Main/HomePage?action=edit'>Edit Page</a>
>
>where, of course, 'http://www.mysite.com/path/to/pmwiki' and 'Main/HomePage'
>
>
>are in variables. Bonus points if you can also handle internationalization
>in the process. :-) No fair simply calling a printLinks() function that
>is somehow defined in PmWiki, unless you tell me how the layout designer
>can control how it chooses to output a link.
>
>
That's not what I had in mind. I though more of
<a href='<? printEditLink($CurrentPage) ?>'>Edit Page< /a>
<a href='<? printRevisionLint($CurrentPage) ?>'>Page revisions</a>
as part of the template (Although I hadn't put it into my first version).
i18n...? Two ways I could imagine right now:
1) One template per language...
2) Use <? echo $EditPage ?> instead.
(Is there a way in PHP like in JSP to simply print the contents
of a
variable by some kind of special <?.. directive? (like <?=
$Editpage ?> or so)
I think, I'm still quite unfamiliar with the complexity of function,
pmwiki offers. Of course, [[noheader]] wouldn't work that way. And I'm
not sure about some of the modules in the cookbook.
Also, I'm beginning to realize that a template of this kind would be all
but easy to read. From that point of view, if seen better approaches in
the other threads of this topic.
The benefits of this way, are primarily:
1) Speed (Am I right? It's faster to let PHP do the work, than writing a
PHP script that puts it all together)
2) I'd be able to put my own PHP code into the template. Code that is
independent of the Wiki, e.g. to generate a Web Counter or display
whether I'm online at the moment. Or I could have a textfield at the top
of the page, where people can enter a number and click in OK and then
the contents of the page is printed n-times. (Just an example, where you
would _have_ to use PHP)
Then again, (2) probably would be achievable another way to (if we want
that). And I'd rather not worry about one until I implement
a diff function that runs in a better time/space than O(n*m) ;-)
Nils
More information about the pmwiki-users
mailing list