Re: [SMARTY] Re: Smarty's Smartest Practices?
| From: | guido | Date: | Wed, 19 Feb 2003 19:00:55 +0000 |
| Subject: | Re: [SMARTY] Re: Smarty's Smartest Practices? | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7916@lists.php.net to get a copy of this message | ||
Hello Tom,
first off I disagree with the current vote .. I like the look of your
site ;)
I'm a little confused on the CONTENT as you call it .. feel like
sharing the init.php and index files so I could get an understanding?
The one thing I hate is having to make different pages for similar
items just to change the main "zone/block" .. I've tried it a bunch
of ways with a dynamic plugin calling the appropriate block/mod .. but
I'd like to see what somebody else has been thinking...
Wednesday, February 19, 2003, 11:18:35 AM, you wrote:
TS> "Mike Van Lammeren" <mike@emerge2.com> wrote
TS> news:5.1.0.14.0.20030219101105.02b48b70@mail.emerge2.com...
>> Well, no offence to Tom, but I am curious about how people organize the
>> html in their templates. Over the years, we have done projects in ASP,
>> Perl, and most recently, PHP. (They'll get PHP away from me when they pry
>> it from my cold, dead hands!) We've tried a number of approaches when it
>> comes to laying out html templates, but more often than not, we settle on
TS> a
>> single page, which includes every tag from <html> to </html>. We keep this
>> page short, preferably under 100 lines, then include everything else from
>> other files, such as css, javascript, a layer for drop-down menus, etc.
TS> The
>> dynamic content is poured into a number of places, such as the body of the
>> page, a navigation side-bar, etc.
TS> I've done this up to this point as well, but now I've changed to my new way
TS> of doing it... and it works much better
>> If we had hundreds of pages with static bodies, then we would probably go
>> for an arrangement whereby the html making up the body would go in a file
>> which included header and footer files. (What Tom refers to as the "top
TS> and
>> bottom headers" approach.)
TS> What I do, I'm not sure you understand me (or I understand you), is that I
TS> have a file called index.tpl
TS> This fil contains all the basic structure of the site, like tables etc.
TS> Inside index.tpl I have blocks, which can be formed to whatever I like
TS> (Currently I have my menu inside a block and my other boxes (see tsn.dk),
TS> the most importent thing about the way my templates work is that I have a
TS> variable called CONTENT, where all my content from the other files go, these
TS> other files do not contain any stucture of the site, only of the current
TS> page (Like a list of news, nothing else).
TS> This way I can keep my index and entire stucture of the site in -one- file
TS> and change it whenever I want, without EVER having to change the other pages
TS> as well.
TS> The reason why I do not use top and bottom headers is that I cannot work
TS> with them in dreamweaver, they don't allow me to see the site and change a
TS> small thing without me having to slice up the site into bottom and top once
TS> again etc etc.
TS> Also, I include a file I call init.php on all pages, this file connects to
TS> the database and sets up index.tpl ready for parsing.... now, when I do a
TS> new design, I will only have to change init.php and index.tpl, all other
TS> things can run as they always have.... I love templates
TS> see http://build.tsn.dk which is where I am currently
TS> building with PHPLIB
TS> (not started on smarty yet, will start tomorrow) the build site can be slow,
TS> not because of the code I might add :)
TS> Phew, that was a long story, anyway.. any questions?
TS> --
TS> Tom Sommer
TS> www.tsn.dk - www.dreamcoder.dk
--
Best regards,
guido mailto:sguido@rogers.com