468,249 Members | 1,470 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

template concept --help!

I've posted before but no one replied because I think it was confusing.
My problem is that I have a website where users have profile pages, and
they can each chooser their own (i.e. blogger.com) Point of this
question is...how can I make a system where template layouts (e.g, 3
column layout, 2 column, vertical, horizontal) can be created for it so
it's scalable and easy to make "templates" for? I just need some
concepts and methods of how to do this PLEASE!!!!!!!!!! this is holding
up a project and i'm REALLYYY getting annoyed with it...

PLEASE give example code...the system I have now is kind of like
this...
/* SOME SQL QUERIES FOR THE $users array, and manipulation */
$t = new template;
$t->_template_path = $template_path; # /core/templates/blue/
$t->_template = $users['template']; # blue.template
$t->_css_file = $users['style_sheet']; # 'template.css'; etc
$t->_meta = $users['meta_tags']; # users keywords, etc
$t->_title = $users['title']; # title of page "Johns page" etc.
$t->_content = $users['content']; # contains the objects/modules they
want in the main body div
$t->_left_content = $users['left_content'] # left div content (if
turned on)
$t->_right_content = $users['right_content'] # right div content (if
turned on)
$t->render(); # draw everything

inside the template class it basically just gets all the .template
files, arranges them in order does some queries and echoes them... I
need help, is this even a good idea? will this be way too slow? is
there a simpler way to do it? HELP!!!!!!!!!

Jan 26 '06 #1
12 1158
"they can each choose their own" They can choose their own TEMPLATES!
they can choose there own!

Jan 26 '06 #2
Another Idea I had was to have x amount of layouts...and then just .css
files for those layouts...aka choose your layout..choose your style.

Jan 26 '06 #3
bryan wrote:
Another Idea I had was to have x amount of layouts...and then just .css
files for those layouts...aka choose your layout..choose your style.


You're pretty right. Using markers or markups for layouting is
quite old and the current trend is using div based rendering and css
based layout. For the demo of the concepts visit
<http://www.mezzoblue.com/zengarden/alldesigns/> (Note: only the css
file is changed for each layout, but not the HTML)

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jan 26 '06 #4
bryan wrote:
Another Idea I had was to have x amount of layouts...and then just .css
files for those layouts...aka choose your layout..choose your style.


You're pretty right. Using markers or markups for layouting is
quite old and the current trend is using div based rendering and css
based layout. For the demo of the concepts visit
<http://www.mezzoblue.com/zengarden/alldesigns/> (Note: only the css
file is changed for each layout, but not the HTML)

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jan 26 '06 #5
d
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
bryan wrote:
Another Idea I had was to have x amount of layouts...and then just .css
files for those layouts...aka choose your layout..choose your style.
You're pretty right. Using markers or markups for layouting is
quite old and the current trend is using div based rendering and css
based layout. For the demo of the concepts visit
<http://www.mezzoblue.com/zengarden/alldesigns/> (Note: only the css
file is changed for each layout, but not the HTML)


Getting that to work pixel-perfectly across browsers is a nightmare, though.
Javascript and css hacks are always required, which might not be what's
wanted...
--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jan 26 '06 #6
What kind of hacks? how much? What way do you have around that?

Jan 26 '06 #7
bryan wrote:
I've posted before but no one replied because I think it was confusing.
My problem is that I have a website where users have profile pages, and
they can each chooser their own (i.e. blogger.com) Point of this
question is...how can I make a system where template layouts (e.g, 3
column layout, 2 column, vertical, horizontal) can be created for it so
it's scalable and easy to make "templates" for? I just need some
concepts and methods of how to do this PLEASE!!!!!!!!!! this is holding
up a project and i'm REALLYYY getting annoyed with it...


Maybe you should use an existing system like Smarty. Save yourself the
work of documentation.

Jan 26 '06 #8
Smarty is it's own language...way too involved for what I need I need
fast, quick, effective and scalable (smarty is out althought it could
be all of the above, it's too much.)

Jan 26 '06 #9
d
"bryan" <te******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
What kind of hacks? how much? What way do you have around that?


CSS implementations vary greatly across browsers, far more so than HTML.
It's very easy to code pixel-perfect HTML that renders in Firefox, IE,
Safari, Opera, you name it. Try doing that with CSS without javascript or
underscore-hacks in your CSS, and you'll see what I mean ;)
Jan 27 '06 #10
d
"bryan" <te******@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Smarty is it's own language...way too involved for what I need I need
fast, quick, effective and scalable (smarty is out althought it could
be all of the above, it's too much.)


It's very easy to write your own small and quick templating toolkit for
doing exactly that. Just think about it logically, and work out great
methods for caching your templates into something that can be used quickly,
and take it from there.
Jan 27 '06 #11
Erm.. Smarty is fast, quick, very effective and scalable. It's not
really 'too much', it helps a great deal! I've done a system using
smarty where user can choose their preferred skin, all I had to do was
pull the CSV value from db (skinname,skintype,skinlayout) and dump
these values to smarty to pick the correct skins.

Caching is also easy with smarty.

However, Smarty needs some getting used to. You're quite right when you
say it's like learning a new language, but once you're used to it,
you'll wonder how did you even code your websites without it!

bryan wrote:
Smarty is it's own language...way too involved for what I need I need
fast, quick, effective and scalable (smarty is out althought it could
be all of the above, it's too much.)


Jan 27 '06 #12
Why not use a cms - eg Drupal?

PS: I have experimented with Drupal and have decided to hand code my
websites because Drupal (and other cms's) are too fragmented and provide far
more options than I will need, in code that is too difficult to comprehend
because it comes from so many different sources. But, it might be suitable
for you because it is very easy to allow users to select their own style
from a selection of styles that you can provide, add to, and customise.

"bryan" <te******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I've posted before but no one replied because I think it was confusing.
My problem is that I have a website where users have profile pages, and
they can each chooser their own (i.e. blogger.com) Point of this
question is...how can I make a system where template layouts (e.g, 3
column layout, 2 column, vertical, horizontal) can be created for it so
it's scalable and easy to make "templates" for? I just need some
concepts and methods of how to do this PLEASE!!!!!!!!!! this is holding
up a project and i'm REALLYYY getting annoyed with it...

Jan 27 '06 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Rex_chaos | last post: by
2 posts views Thread by Jim West | last post: by
2 posts views Thread by Dave | last post: by
2 posts views Thread by Dave | last post: by
1 post views Thread by suzy | last post: by
1 post views Thread by scorpion53061 | last post: by
1 post views Thread by Adnan | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.