Topic: Will "per-style templates" become available?

Develops of PunBB have said many times that PunBB 1.3 will include "per-style templates" (one set of templates per style) system, but I still cannot see this system in the latest version of 1.3 Beta. We want to customize not only CSS files but XHTML structures.

When will this dream come true?

Welcome to my WoW guild site, the Eternal Reach.

You can also visit Chita, a site built by me, a feral paradise for feline animals.

Re: Will "per-style templates" become available?

yup

Re: Will "per-style templates" become available?

But I didn't find it.

Welcome to my WoW guild site, the Eternal Reach.

You can also visit Chita, a site built by me, a feral paradise for feline animals.

Re: Will "per-style templates" become available?

line 42 & 51 of the header checks if there is a template file in the style folder

if (file_exists(PUN_ROOT.'style/'.$pun_user['style'].'/main.tpl'))

Re: Will "per-style templates" become available?

There are still some XHTML codes in PHP files.

In include/template/main.tpl:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" <!-- pun_local -->>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- pun_head -->
</head>
<body>

<div <!-- pun_page --> class="pun-page">
<div class="pun">

<!-- pun_skip -->
<div id="pun-home">Powered by <a href="http://punbb.org/">PunBB</a></div>

<!-- pun_title -->
<!-- pun_desc -->
<!-- pun_navlinks -->
<!-- pun_visit -->

<!-- pun_alert -->

<!-- pun_announcement -->

<!-- pun_crumbs -->

<div class="divider"><hr /></div>

<!-- pun_main -->

<div class="divider"><hr /></div>

<!-- pun_stats -->

<!-- pun_about -->

<!-- pun_debug -->

</div>
</div>

</body>
</html>

It seems that I cannot customize at all!

Welcome to my WoW guild site, the Eternal Reach.

You can also visit Chita, a site built by me, a feral paradise for feline animals.

Re: Will "per-style templates" become available?

well pun isn't going into a FULL template system. if thats what your looking for, then im gonna have to change my previous answer to, "no"

Re: Will "per-style templates" become available?

You can write extensions along with your style if you *really* need to change things.

Re: Will "per-style templates" become available?

Per-style templates means the existing templates can be changed on a per-style basis, NOT that we're adding a full templating system. Nobody has ever even suggested that.

Re: Will "per-style templates" become available?

Or the devs can implement per-style templates themselves, but that would actually require PunBB to seperate logic from presentation, and consequently rewrite the entire application. Do the PunBB devs realize that it's riddled with massive redundant code repetition? If a change of class names requires this big a commit, something's wrong. Massive search/replace will only take you so far.

Re: Will "per-style templates" become available?

Indeed, that would be quite the large undertaking and not one we're going to look at for 1.3. Potentially in 1.4 we might look into the feasibility of a very basic templating system, which would allow us that separation between code and markup. The problem is finding/writing a simple enough system: using something like Smarty would be massive overkill from every perspective. smile

I do take issue with the idea that the code is "riddled with massive redundant code repetition" though, especially in the specific example referenced. When you change the name of core CSS classes, you need to change every place that class is used. The number of changes wouldn't be reduced by using a templating system, unless you're discussing breaking templates down to the level of having templates for individual elements of a page (like a form field). That would have a severe impact on code readability and increase the number of template files massively.

11

Re: Will "per-style templates" become available?

Wouldn't that be essentially the same as having a function to generate indiviual form fields rather like we generate message boxes.

Re: Will "per-style templates" become available?

Yes, but think more along the lines of having one of those for every bit of markup you might repeat. Just looking at this page (viewtopic.php), there could be one for the pagination, one for the breadcrumbs one for the "post reply" link, one for the post action icons, one for the left part of a post, one for the right part, etc.

13

Re: Will "per-style templates" become available?

Yes. My idea of a template system is just to seperate back end code from front end.

Re: Will "per-style templates" become available?

It seems that "per-style templates" in 1.3 only add things, not "change" things.

Welcome to my WoW guild site, the Eternal Reach.

You can also visit Chita, a site built by me, a feral paradise for feline animals.