Connecting Tech Pros Worldwide Help | Site Map

template concept --help!

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 26th, 2006, 02:55 PM
bryan
Guest
 
Posts: n/a
Default 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!!!!!!!!!


  #2  
Old January 26th, 2006, 02:55 PM
bryan
Guest
 
Posts: n/a
Default Re: template concept --help!

"they can each choose their own" They can choose their own TEMPLATES!
they can choose there own!

  #3  
Old January 26th, 2006, 02:55 PM
bryan
Guest
 
Posts: n/a
Default Re: template concept --help!

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.

  #4  
Old January 26th, 2006, 04:55 PM
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
Default Re: template concept --help!

bryan wrote:[color=blue]
> 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.[/color]

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/

  #5  
Old January 26th, 2006, 04:55 PM
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
Default Re: template concept --help!

bryan wrote:[color=blue]
> 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.[/color]

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/

  #6  
Old January 26th, 2006, 06:15 PM
d
Guest
 
Posts: n/a
Default Re: template concept --help!

"R. Rajesh Jeba Anbiah" <ng4rrjanbiah@rediffmail.com> wrote in message
news:1138297490.723303.70210@g49g2000cwa.googlegro ups.com...[color=blue]
> bryan wrote:[color=green]
>> 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.[/color]
>
> 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)[/color]

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...
[color=blue]
> --
> <?php echo 'Just another PHP saint'; ?>
> Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
>[/color]


  #7  
Old January 26th, 2006, 07:25 PM
bryan
Guest
 
Posts: n/a
Default Re: template concept --help!

What kind of hacks? how much? What way do you have around that?

  #8  
Old January 26th, 2006, 07:35 PM
Chung Leong
Guest
 
Posts: n/a
Default Re: template concept --help!

bryan wrote:[color=blue]
> 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...[/color]

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

  #9  
Old January 26th, 2006, 08:15 PM
bryan
Guest
 
Posts: n/a
Default Re: template concept --help!

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.)

  #10  
Old January 27th, 2006, 12:15 AM
d
Guest
 
Posts: n/a
Default Re: template concept --help!

"bryan" <tekhneek@gmail.com> wrote in message
news:1138306362.857990.260010@z14g2000cwz.googlegr oups.com...[color=blue]
> What kind of hacks? how much? What way do you have around that?[/color]

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 ;)


  #11  
Old January 27th, 2006, 12:15 AM
d
Guest
 
Posts: n/a
Default Re: template concept --help!

"bryan" <tekhneek@gmail.com> wrote in message
news:1138309342.392396.61510@f14g2000cwb.googlegro ups.com...[color=blue]
> 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.)[/color]

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.


  #12  
Old January 27th, 2006, 09:15 AM
Stanch
Guest
 
Posts: n/a
Default Re: template concept --help!

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:[color=blue]
> 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.)[/color]

  #13  
Old January 27th, 2006, 11:25 AM
Geoff Bomford
Guest
 
Posts: n/a
Default Re: template concept --help!

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" <tekhneek@gmail.com> wrote in message
news:1138289950.924189.101240@f14g2000cwb.googlegr oups.com...[color=blue]
> 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...
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.