[Pmwiki-users] Suggestions for Template Improvements

Steven Leite steven_leite
Thu Feb 26 06:44:24 CST 2004


These ideas will greatly improve the way PmWiki admin's install and configure and ultimately use templates.

Suppose I'm making a new Group template called: 
"MyNewGroup.tmpl". 

* Problem 1 *
My wysiwyg editor won't load the .tmpl file unless I explicitly tell it to do so because it doesn't recognize .tmpl as a valid .html extension.  Additionally, my editor uses color coded text to identify and clarify markup for me, but this also doesn't work due to the .tmpl extension currently being practiced.

* Solution 1 *
I'd like to suggest changing the .tmpl files in /pub/skins to .htm instead.  (I think the fact that they are located in a folder called skins is enough to declare them as such, no further renaming of extensions is really necessary). 

* Problem 2 *

Currently (as of the 6.4 release?) PmWiki checks for existance of GroupName.css and automatically includes them in the html output (which is great!), but suppose an html author creates a spiffy new template, and aptly names it:

/pub/skins/MyNewGroup/MyNewGroup.htm

as well as a file called

/pub/skins/MyNewGroup/MyNewGroup.css.  

Currently, PmWiki will be looking in the wrong place for the MyNewGroup.css file (it's checking /pub/css instead) which is not particularily intuitive.  Also, there's currently no way to make the new template work without taking further (confusing) steps; those being that the html author must create yet another file called MyNewGroup.php, and put it in yet another directory called /local.  If that wasn't bad enough, he/she also has to edit the MyNewGroup.php file and instruct PmWiki precisely where to find the new template by specifying something wierd programming code like:

$PageTemplateFmt = 'pub/skins/MyNewGroup/MyNewGroup.htm'; 

which looks a bit daunting and confusing to a html author with little or no PHP experience.  That also doesn't take care of the css problem that will ensue.

So ...

* Solution 2 *

I'd like to suggest a very simple solution, which will solve all of the abvove problems!

PmWiki should automatically check the /pub/skins directory for a folder called MyNewGroup, containing a template file called MyNewGroup.htm, and additionally, a css file called MyNewGroup.css.

This makes it VERY EASY for an html author to create a new template, complete with css file, and make it work instantly simply by sticking those 2 files in the appropriate folder: (/pub/skins/MyNewGroup/).  Wow, how simple was that!

Now to take care of those people that want different names, extentions, locations, etc, you can use the existing method (which all users are currently forced to do anyways, which is:) create a file called:

/local/MyNewGroup.php

complete with all the geek-speak php code you need, and your problem is also solved!

* Conclusion * 

This is a win-winn situation.  Newbie html authors will love it, programmer types can't complain since nothing has really changed from their perspective, and best of all, PmWiki Philosphy #5 (Ease of Installation and Configuration) is being adhered to.

Thanks for listening!

--S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://contra.vosn.net/pipermail/pmwiki-users_pmichaud.com/attachments/20040226/fcade347/attachment.htm


More information about the pmwiki-users mailing list