TinyPortal

Development => Feedback => Topic started by: General_Sun on July 22, 2007, 03:48:54 AM

Title: Flexible templating
Post by: General_Sun on July 22, 2007, 03:48:54 AM
The templating right now... is a complete bitch.  ;D I'll show my website here after I'm done with it, but it's insane. I'm not an expert on this, but I imagine that using smarty or Xtemplate or some such would make things much better and much more flexible! Right now this is about as flexible as a block of cement.

;D

I'm thinking, perhaps a different template for front page and the articles? Currently I'm using the tportal template for the front page and SSI for the themes... Hardly ideal!  :o

Edit: It would also be nice if there were less tables and more css,  ;D
Title: Re: Flexible templating
Post by: IchBin on July 22, 2007, 04:20:33 AM
That depends on the theme you use. Perhaps you could explain what is a bitch, and not just complain about it? I don't mind if people want to complain, but I'd rather you tell me what it is you're complaining about like you did with the more css comment. :) IMO, I've never seen such a powerful theming system such as SMF has. You just have to learn how to use it.
Title: Re: Flexible templating
Post by: General_Sun on July 22, 2007, 04:31:38 AM
The coding is too much integrated with the design. One cannot easily swap around code elements without running into design issues and vice-versa. The whole thing's an echo-maze... Some functions are parsed are not parsed as php when they should be... I'm not saying it's impossible, just a lot o harder than it should be.

I'm using the default theme and that is what I'm talking about.
Title: Re: Flexible templating
Post by: IchBin on July 22, 2007, 04:49:00 AM
Thats what I thought at first as well. But you will come to realize the power of it. You can do alot more with it once you learn it.
Title: Re: Flexible templating
Post by: General_Sun on July 25, 2007, 09:23:25 PM
Could you give some examples? What I did with my site... and this is *probably not what you meant, but I took tportal.template, deleted EVERYTHING, and wrote my own design. :P
Title: Re: Flexible templating
Post by: IchBin on July 27, 2007, 01:07:26 AM
While I can't give you code examples for time availability I can give you an example of what can be done. TinyPortal has required the index.template.php file to be altered in order to use the TP features in the theme. Bloc figured out a way with the theme to be able to not have to modify it now. The SMF theme system uses layers. That why when you look at the index.template.php file you see the template_main_above function and the template_main_below function. These two functions are the top and bottom layer of the page. Now when you visit a page like the boardindex, search, profile, all of these template load into the layer template_main() function which is in between the previous mentioned functions. This is a HUGE leap for TP IMO. Not having to alter the theme will make a lot of theme problems disappear. :) Anywho, that gives you basic idea of how the layers work. You can create your own layers as well. If you look at what Bloc has done in some of his more recent themes you can see how he has given you the option to have additional custom pages using this layer system.