1

Topic: Associate main.tpl with css ...

So ... I think with this new version PunBB is simply the best forum I ever seen ... however ...


to customize a forum, the perfect way would be to create a tpl file containing all which is customizable


Example ... I don't want tabular datas (table) on my site ... I go to template.tpl and I have



$viewforumindex => '<table><tr><td> blalaalallaalal</td></tr></table>';

Hop, I erase the line to replace with all the design I want !


Actually, all the free softs do it (the worst is coppermine, but it's in same time the powerful gallery soft ever created)

I think with CSS + this template.tpl, we can be able to create forums WE want, without asking Rickard or Paul every each minute "Ohhhh Rickard, How could I replace this line by another ?"

In same time, each design could be have its own main.tpl, to have more control about layout.

2

Re: Associate main.tpl with css ...

Rod wrote:

....... we can be able to create forums WE want, without asking Rickard or Paul every each minute "Ohhhh Rickard, How could I replace this line by another ?"

This is a concept I find highly attractive.

Re: Associate main.tpl with css ...

I'm not sure what you mean. A file containing all the markup contained in a set of variables? How does that help?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

4

Re: Associate main.tpl with css ...

I think the idea is that it makes it easier to edit and lets you move things round using markup changes rather than just css. Also makes it immune from updates, if the php core files get updated you dont loose your markup customizations. Essentially the same concept as language files where you just drop the variable representing the language file entry into the php rather than hardcoding it in.

5

Re: Associate main.tpl with css ...

Paul > it's exactly this.

Imagine : you do YOURSELF your forum : you create 3 blank pages

index

viewforum

viewtopic


and with only variables, you create your own forum : you don't want the header ? You don't put it in the code !!!

You don't want  "suscribe to this topic" you don't put it on your page

So ... the only thing to do (and quite long) is the separation of core php and markup ... but ... A LOT TIME won for ALL users

of course, the DEFAULT template would be "YOUR" vision of PunBB, but for designer, the best way to customize VERY EASILY their forum.

Re: Associate main.tpl with css ...

you mean a templating system more like phpbb where all of the html is held in the tpl? and there is one set of tpl files per css?

Re: Associate main.tpl with css ...

These templates would of course have to be updated as well as new versions are released. Is it really easier to modify the markup in some external file than in the file where it occurs?

Also, don't forget that such a system would increase memory consumption and load time.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

8

Re: Associate main.tpl with css ...

No no ... Simple ...

One main.tpl > control le layout inside an existing layout, or to change the width of a forum, for example
One css file > to control all css file about size, colors, blabla ...
One core.tpl > containing all could be customizable about the appareance of the site : If you want table, divs ... you choose !!! You want elements appears or disappear ... you control ALL on viewtopic, index, profile and viewforum

And all the forum code ...

In fact, IF I WANT to change SOMETHING in my forum, I don't have to open 40 files : ONLY me core.tpl, the good line and ... hop, it's OK.

So of course, more memory : but punBB against phpBB : 4 faster ... if it's only 3 faster ... we'll all win smile

Try to think a such template system ... more easy to customize (I think)

Re: Associate main.tpl with css ...

sounds good but i don't know how you would get everything in core.tpl

10

Re: Associate main.tpl with css ...

I don't think it would work. For example, to output a table PunBB uses a loop. The looping logic for a table is actually different than it would be for a tableless design. Writing php which is capable of coping with all possible markup variations that people might throw at it would be difficult. Plus of course core.tpl would also have to contain all the relevant variables for the data that is being output. That means you would have to put some php in core.tpl.

However, the idea that a template system would be slower might not necessarily be correct. A template system would produce smaller pages because the markup does not have to be so flexible. What you loose in processing time you might gain in download times.

Re: Associate main.tpl with css ...

What rob has described is what PHP developers seems to be heading towards.  OOP & Keeping a seperation between design & application.  I sometimes work with another developer.  this is how we colaborate.  I can mess with markup all I want and never have to worry about the application breaking because I mistakenly deleted a . or a ; or a ", etc..  the only thing I have to worry about it making sure my building blocks of design include the calls to the right objects.  Main.tpl is an example of how we colaborate.  Of course there is some markup in the PHP that  outputs the data/information, but I let him worry about that, and I just supply the div's or tables to wrap around them.  It seems to work well for us since we do most of our colaboration on-line. 

On that note.  I hate mixing markup with PHP expressions.  I never know when I need to put a  . or ' or " or () , etc..  I always seem to break stuff big_smile  If some one could point me to a tutorial or a site that explains all different ways to mix the two, that would be great.  I have seen it done so many ways.  Where I really get screwed up is where you build links from arrays that are queried from a database, and you mix mark up with php. the whole quotes thing really messes me up.  Iknow that if you do

$username = "Johnny";
echo 'Username is $username';

will display: Username is $username

and

$username = "Johnny";
echo "Username is $username";

will display:  Username is Johnny

I get mixed up when you mix and row from an array with mark up, and also when you are using variables in Query statements.

Re: Associate main.tpl with css ...

the problem i can see is what you'll end up with is either loads of tpl files (basically one for each page on the site) or a very big core.tpl for little advantage since as far as i know the new css will allow for alot of the page to be moved around regardless of the order it appears in the actual html

13

Re: Associate main.tpl with css ...

connorhd: there are lots of things you can do with css but what you cant do is turn a table into a list or a bunch of divs which is what Rod wants. However, that is not a good reason, as you point out, for doubling the number of files used.

Re: Associate main.tpl with css ...

i would have thought 95%+ of users don't want to turn tables into divs

Re: Associate main.tpl with css ...

Connorhd wrote:

the problem i can see is what you'll end up with is either loads of tpl files (basically one for each page on the site) or a very big core.tpl for little advantage since as far as i know the new css will allow for alot of the page to be moved around regardless of the order it appears in the actual html

Dos it allow to ignore some tools, or duplicate entries ?

For example, I would like to get rid of the title system, so it does not appear anywhere. On the other hand, I would like the breadcrumb (index>forum>thread) to appear at the begining and at the end of a thread/posts view.

Is there a simple way to do that (or things like that) now ?

16

Re: Associate main.tpl with css ...

Ignore things, yes {DISPLAY: none}
Duplicate things, no.

Title system?

17 (edited by Jérémie 2005-01-12 19:45)

Re: Associate main.tpl with css ...

Paul wrote:

Ignore things, yes {DISPLAY: none}

Nope, that only hide it from the media specified if the UA handle CSS. Try it in Lynx, or via the cached version from Google, you will see what I mean :-)

Title system?

The "title" you get when you post alot... the ranking system.

18

Re: Associate main.tpl with css ...

It's not only table vs divs : it's to create forums like we want : not only colors or fonts, but our "vision" of a forum, whichi is not sometimes the same like punBB dev team smile

19

Re: Associate main.tpl with css ...

my last argument smile

paul and rickard change some things in viewtopic.php

they say "hayy man, upload this new file, but apply again your modifications"

but if I have had my design modifications in a different file, neither again change the viewtopic.php, and possibility to upload new modifications .........

Re: Associate main.tpl with css ...

can you give an example of what you would want to change that you can't already, i'm rather confused...

also as for your last argument, use hdiffs to edit the files to keep your edits

21

Re: Associate main.tpl with css ...

1. Rickard implements templating

2. Paul pulls Kylie

The probablility of these two scenarios happening is about equal.

Re: Associate main.tpl with css ...

hahaha

"Programming is like sex: one mistake and you have to support it for the rest of your life."

23

Re: Associate main.tpl with css ...

Grrrrrrrrrrrrr smile

Not nice people .... bouhhh bouhhhh smile

VERY LAST ARGUMENT ...

use some of these variables not only on a forum ...

example ... on my whole site, I want mmmmm I don't know ... gggrrr no example ... I want an element ... I can put it on my site only with (for example)        {element1}            hop ... implementation finished ...

mmmmmm well ... nobody likes me sad