473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1282
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rex_chaos | last post by:
Hi all, suppose A is an array. With the help of template function find_first_of and find_end, I got two desired elements of array. How can I tell the distance between these two elements?
2
by: Jim West | last post by:
I have a template class (for numerical processing) that was originally written for real data that I need to extend to complex data, and I am running into a problem. The current version (greatly...
2
by: Dave | last post by:
Hello, Thanks for your help on the short problem shown below. Thanks! Dave #include <iostream>
2
by: Dave | last post by:
Hello, Below, I have included a short program that does not compile. The problematic line is indicated with a comment. Comeau produces this error: "ComeauTest.c", line 19: error: type name...
1
by: suzy | last post by:
hi, i have created a aspx page template by creating a template.cs file which inherits from the page class. In this file I override the OnInit event and create a template in the form of a...
1
by: scorpion53061 | last post by:
Hello, I have been asked to write a program and allow the end user to create custom fields in a SQL Server database in addition to the premade fields.
1
by: Adnan | last post by:
Hi! I am newbie in template stuff and I am getting error for the following program #include "stdafx.h" using namespace std;
2
by: martin | last post by:
Hello, Today I fetched the standard Access-2003 template "orders management db" from http://office.microsoft.com/en-au/templates/TC010185481033.aspx?pid=CT101426031033 In de openingform one...
0
by: resurgentnaveen | last post by:
Hi , I am trying to use Active Scaffold in my project and i need this template overriding feature of Active Scaffold. I am following the instructions on the link...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.