News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Worst tempelate system..

Started by saeros, December 21, 2005, 02:25:45 PM

Previous topic - Next topic

saeros

This is my first post here so be gentle  :P

Well first I had IPB but since the new license system I first converted to phpBB.. Did not like it converted to the SMF. I Like it and my users like it. Recently I have been thinking of making my own skin for my forums. I thought it would be easy or at least it could be done easily. Well I first created copy of the default tempelates. Downloaded them to my computer. Well I opened the index.tempelate.php in Dreamweaver just to find that the tempelate actually is inside few functions which echo the HTML contents. After making skins in IPB and looking the system in phpBB I thought why did they make it so hard in SMF? Is there any good reason why the tempelates where made so? Wouldn't it have been easier to implement those functions so that the tempelates are just php files which have HTML and embedded php tags. That would make it more easier to non programmers to make the themes/skins. The current system is too hard for graphics artist and other a like that just want to use their favorite WYSIWYG editors to create themes. Why does to tempelates has so much of the actual business logic is another thing that I'm wondering. Shouldn't the actual logic be inside the application and the presentation just show that information without worrying about what to show?

Ex. why not like this?
index.tempelate.php

<html>
etc....
somewhere where some data is shown ex. User name: <?php echo $data['userName'];?>
</html>


I'm thinking of building somekind of wrapper around the current system so that I can make the tempelating easier for me and my artists friends.

Tim

Please ignore the button on the left, I'm not one of the SMF design teammembers and consider myself more of a counselour then an actual part of. So this is my - not the team's - point of view

Quote from: saeros on December 21, 2005, 02:25:45 PM
Well I opened the index.tempelate.php in Dreamweaver just to find that the tempelate actually is inside few functions which echo the HTML contents. After making skins in IPB and looking the system in phpBB I thought why did they make it so hard in SMF?
You say hard, I say extremely customizable. I don't know how IPB does it, nor phpBB, but I do know that when I want to add something that only admins or teammembers can see it's extremely easy to do in SMF.

Quote from: saeros on December 21, 2005, 02:25:45 PMThe current system is too hard for graphics artist and other a like that just want to use their favorite WYSIWYG editors to create themes.
I'm very serious here, and this is in no way meant as a flame, but if someone isn't capable to do the very basics of PHP (control structures and loops) they shouldn't be considering themselves artists/designers. We're living in the day and age where as a designer you need to have a very basic ability to do some coding. Particularly when you want to separate content from structure from control by properly using CSS, (X)HTML, and the DOM... I'm coming up on my tenth year on line and went from Notepad to WYSIWYG editors to doing it all by hand. I've always found that I can control every aspect more when doing things that way, rather then have some pesky editor interpret what I want while working at least twice as fast.

QuoteWhy does to tempelates has so much of the actual business logic is another thing that I'm wondering. Shouldn't the actual logic be inside the application and the presentation just show that information without worrying about what to show?
The actual logic is in the application. The templates, as said above, can contain things that are to be shown only in specific locations. They are but a single step more difficult - to use a very big word - then the code in the example you've shown.

QuoteI'm thinking of building somekind of wrapper around the current system so that I can make the tempelating easier for me and my artists friends.
It's pretty easy. I'm by no means a PHP guru,  and I must admit that at first it seemed overcomplicated to me, but in the end it's just a bunch of loop and controlstructures. There isn't a single serious piece of code in sight...
<?php
if($context['user']['is_logged']){
   echo 
'Hi you\'re logged in!';
else{
   echo 
'Hi guest!';
}
Let's be serious here and say that this is the very basic of basics...

mediman

Thanks Tim, you wrote my post.

mediman
My Projects: http://ticker-oase.de 
Please do not PM me with support requests.

Tim


saeros

Thank you Tim for your fast reply.

Here is few comments on what you wrote:
Quote..., but I do know that when I want to add something that only admins or teammembers can see it's extremely easy to do in SMF.
Shouldn't that decision be made application side not in the presentation?
QuoteI'm very serious here, and this is in no way meant as a flame, but if someone isn't capable to do the very basics of PHP (control structures and loops) they shouldn't be considering themselves artists/designers. We're living in the day and age where as a designer you need to have a very basic ability to do some coding.
Not to put more wood on the fire but I do think that graphics artists should not need to know about php. If the graphics artists is required to know about programming then what is there for me to do as an programmer?
QuoteParticularly when you want to separate content from structure from control by properly using CSS, (X)HTML, and the DOM...
You think that properly separating the content from structure means using messy echo statements? Properly using CSS? that is not the case with SMF. At least with the default theme. If the tempelate would only output div tags not tables then I could change the outlook just by changing the CSS file which came with it. By the way I'm using 1.1 RC1 of SMF.

QuoteI'm coming up on my tenth year on line and went from Notepad to WYSIWYG editors to doing it all by hand. I've always found that I can control every aspect more when doing things that way, rather then have some pesky editor interpret what I want while working at least twice as fast.
Where is the extremely customizable tempelating system in SMF you mentioned? If you have to do it all by hand and don't have a alternative way of doing it like using some WYSIWYG editor. What do you mean by going from Notepad to WYSIWYG to doing it all by hand? If you don't at least use notepad then what do you use?

Sorry if I keep attacking you but I do think that the tempelating system in SMF is the worst part of it and something should be done to make it at least cleaner. Currently I'm waiting that in some point of the development the tempelating system should be made modular.  Maybe make the actual tempelating system so that you could chose which system to use or even make your own. For and example look at how Drupal CMS is doing it hxxp:drupal.org/project/Theme%20engines [nonactive]

This is so far the best forum software I have used(and I have used many) and by the user side everything is good.



1MileCrash

i dont know what tim uses. i use context and editplus. But what's hard about it? all you need to know is html. Sure, php is thrown in there also, but it's not like you actually have to know any php whatsoever.


echo' plain <b>html</b>. Yay. ';

The only thing php can't do is tell you how much milk is left in the fridge.



saeros

Quote from: Tippmaster on December 21, 2005, 04:07:56 PM
i dont know what tim uses. i use context and editplus. But what's hard about it? all you need to know is html. Sure, php is thrown in there also, but it's not like you actually have to know any php whatsoever.


echo' plain <b>html</b>. Yay. ';


If I said to graphics artist to use editplus,notepad or other text editor to create theme which basically should be just the way the interface looks I would get very hard looks from them  :'( sorry for the mangled english there. I'm getting bit sleepy here and can't concentrate enough to think a other way of saying it...


<b>html</b>

That is the point I'm trying to make. Those echo statements are just plain messy.


Tim

#7
Quote from: saeros on December 21, 2005, 04:01:37 PM
Shouldn't that decision be made application side not in the presentation?
One of the great strengths of SMF is that you can do pretty much everything you want with it. It's so powerfull, and the application offers so many options of information to display that a designer is in full control of the program at all times. Again you say weakness, I say you don't see the limitless possibilities it offers you. There aren't any restraints.

QuoteNot to put more wood on the fire but I do think that graphics artists should not need to know about php. If the graphics artists is required to know about programming then what is there for me to do as an programmer?
I'm talking about the basics of coding. Control Structures and loops aren't to be considered code. I'm not saying a good designer needs to know how to make the most optimized query to a MySQL database, but that he at least knows how if...else... works ;)

QuoteYou think that properly separating the content from structure means using messy echo statements?
Content from structure is something you do in HTML. SMF's HTML is completely seperated from the actual code.

QuoteProperly using CSS? that is not the case with SMF. At least with the default theme. If the tempelate would only output div tags not tables then I could change the outlook just by changing the CSS file which came with it. By the way I'm using 1.1 RC1 of SMF.
SMF has a legacy HTML code which is at least 4 to 5 years old. Standards were unknown then, CSS was used for background colors. I've just started to advise and trying to steer the designteam into a new world. It takes time to build up HTML and CSS for a forum from scratch. But I can tell you that there is currently an experiment being set up, and from what I heard the only thing you'll need to adjust to completely change everything around is the CSS file.

QuoteWhere is the extremely customizable tempelating system in SMF you mentioned? If you have to do it all by hand and don't have a alternative way of doing it like using some WYSIWYG editor. What do you mean by going from Notepad to WYSIWYG to doing it all by hand? If you don't at least use notepad then what do you use?
It's there, you just haven't found/bothered to look into it. 10 years ago I used Notepad, then moved on to something WYSIWYG, and then found out I worked faster in a text editor with highlighting. I reccomend Editplus...

QuoteSorry if I keep attacking you but I do think that the tempelating system in SMF is the worst part of it and something should be done to make it at least cleaner.
Again if you take some time, look past how difficult it looks you'll see that it's very powerful and that it offers you as a designer complete control. Can you say that you can adjust anything you want in any other program?

Quote from: saeros on December 21, 2005, 04:17:45 PM
If I said to graphics artist to use editplus,notepad or other text editor to create theme which basically should be just the way the interface looks I would get very hard looks from them
In all honesty, if someone does not know HTML and CSS like the back of their hand they should not be calling themselves designers or artists.

Thantos

#8
Take a look at:
http://www.simplemachines.org/community/index.php?topic=61651.0;theme=5
and tell me if any other forum can do that.

I've been around the internet block and for the most part every other forum software has the same looking sites.  Yes they may change the colors or add something fancy around it.  But nothing too different.

One of the reasons simple php was used in the templates is because it gives so much power.  It allows you to completely break the mold and do whatever you want.  Including a div only design if you wish.

Also in your orignal post you are show escaping into and out of php mode.  This is very slow and will increase load times and decrease performance.  One of the things SMF prides itself on is being fairly light weight.

1MileCrash

The only thing php can't do is tell you how much milk is left in the fridge.



saeros

#10
After viewing that maybe I'm starting to change my mind..  :D

IMAGE REMOVED. IT WAS NOT NEEDED ANYMORE.
should it look like that?

QuoteAlso in your orignal post you are show escaping into and out of php mode.  This is very slow and will increase load times and decrease performance.
Wasn't php made for that? It was ment to be an tempelating language. Is there a good benchmark avaible somewhere showing the time difference beetween using methods:

<?php
echo "<html>";
etc...
?>


or

<html>
<?php echo $data?>
etc...


If the performance hit is too high when using the escaping method then I do see the point why to use the method SMF is currently using. (Performance hit is too high if the difference is more then 0.5 to 1.5 seconds on large pages like forum index)

Thantos

Quoteshould it look like that?
Yep thats what that theme looks like.

Sorry I don't have a benchmark.  On a good server the load time can be less then 0.2 seconds.  So an increase of 0.5 would be almost 4 times slower (0.2 to 0.7).

saeros

Thanks for the replies. I'm not totally convinced but I'm hanging on the edge  :P

Is there an suggestion forum  where I could suggest about the modular tempelate system where the SMF provides the data for the tempelates and the tempelate system displays it using the theme assigned to it. This would allow you to use any tempelate(Smarty, PHPTempelate etc..) system with SMF and give the user the ability to make the decision beetween fast tempelates and wysiwyg compatible tempelates.

I'm currently investigating how to implement this with the current system so maybe if I manage to pull it of I will make a mod from it.

Oldiesmann

Adding support for more template engines would only make things more confusing and complicated. Everytime a new version of a particular template engine was released, we'd have to update our code to match this. Plus, those of us on the support team would have to learn these template engines so we could help users with them as well.

SMF's template engine is quite easy to understand once you have a basic understanding of PHP.
Michael Eshom
Christian Metal Fans

Gobo

hi
sorry to butt into the whole convo but I just had to say my piece

I am totally php illiterate and in the beginning when I started using SMF I was like "oh no this template stuff is too much!"
Especially because i was used to the IPB easy template edit options

But after a while I realized that SMF is actually broadning my horizons by making me learn something new and not only that but its really much more customizable

i am very happy with smf simply because it is the only forum system i have encountered so far which allows you to use COMPLETE transformations in your templates....not just table color post color text color changes but like TOTALLY a new site look! And that to me by far demonstrates it awesome power!

Yes indeed to new comers it may seem a little tough at first but with time even im learning new things and I just love the whole system :D

1MileCrash

very well said. ^

sure, it may be easier to change colors in some other software, but making a total transformation would probabally be very complicated, simply because of the same reason. if templates were filled with code to allow wysiwyg, it would be that much harder to allow total customization.
The only thing php can't do is tell you how much milk is left in the fridge.



Advertisement: