[campsite-dev] Campsite PHP template engine
  • Hi,

    I investigated both Smarty and PHPTemplate as potential candidates for our new PHP template engine and IMHO we should continue with Smarty. Here are my reasons for not using PHPTemplate engine:

    1. There is no way to define our own tags

    2. Quote: "If you don't know PHP, then PHPTemplate can still be a good choice because only small bits of code are involved. They can just be copy/pasted into your template."

    This means that the web designer will have a hard time detecting syntax errors. Also, don't know how good is the error reporting but I suspect is way behind Campsite.

    3. Needs Drupal to be installed

    4. We would have to borrow the Drupal terms, like 'node'

    5. Poor documentation

    Please let me know what you think or if you think I was wrong in some way.

    Mugur



    ---------------------------------
    How low will we go? Check out Yahoo! Messenger
  • 6 Comments sorted by
  • Sounds like a good analysis to me, so lets stick with Smarty.

    On 4/3/06, Mugur Rus wrote:
    > Hi,
    >
    > I investigated both Smarty and PHPTemplate as potential candidates for our
    > new PHP template engine and IMHO we should continue with Smarty. Here are my
    > reasons for not using PHPTemplate engine:
    >
    > 1. There is no way to define our own tags
    >
    > 2. Quote: "If you don't know PHP, then PHPTemplate can still be a good
    > choice because only small bits of code are involved. They can just be
    > copy/pasted into your template."
    >
    > This means that the web designer will have a hard time detecting syntax
    > errors. Also, don't know how good is the error reporting but I suspect is
    > way behind Campsite.
    >
    > 3. Needs Drupal to be installed
    >
    > 4. We would have to borrow the Drupal terms, like 'node'
    >
    > 5. Poor documentation
    >
    > Please let me know what you think or if you think I was wrong in some way.
    >
    > Mugur
    >
    >
    >
    > ________________________________
    > How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call rates.
    >
    >
  • Smarty is it then.

    Sava



    "Paul Baranowski"
    mail.com> cc:
    Subject: Re: [campsite-dev] Campsite PHP template engine
    04/04/2006 10:55
    AM
    Please respond to
    campsite-dev






    Sounds like a good analysis to me, so lets stick with Smarty.

    On 4/3/06, Mugur Rus wrote:
    > Hi,
    >
    > I investigated both Smarty and PHPTemplate as potential candidates for
    our
    > new PHP template engine and IMHO we should continue with Smarty. Here are
    my
    > reasons for not using PHPTemplate engine:
    >
    > 1. There is no way to define our own tags
    >
    > 2. Quote: "If you don't know PHP, then PHPTemplate can still be a good
    > choice because only small bits of code are involved. They can just be
    > copy/pasted into your template."
    >
    > This means that the web designer will have a hard time detecting syntax
    > errors. Also, don't know how good is the error reporting but I suspect is
    > way behind Campsite.
    >
    > 3. Needs Drupal to be installed
    >
    > 4. We would have to borrow the Drupal terms, like 'node'
    >
    > 5. Poor documentation
    >
    > Please let me know what you think or if you think I was wrong in some
    way.
    >
    > Mugur
    >
    >
    >
    > ________________________________
    > How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call
    rates.
    >
    >




    Invest in Press Freedom: Visit http://www.mdlf.org/invest and buy MDLF's
    Free Press Investment Notes now!
  • i agree with sava: let's stick with smarty. and i haven't researched
    phptemplate but worked with smarty quite a bit now. and it's a beauty.

    At 10:55 04.04.2006, you wrote:
    >Sounds like a good analysis to me, so lets stick with Smarty.
    >
    >On 4/3/06, Mugur Rus wrote:
    > > Hi,
    > >
    > > I investigated both Smarty and PHPTemplate as potential candidates for our
    > > new PHP template engine and IMHO we should continue with Smarty. Here
    > are my
    > > reasons for not using PHPTemplate engine:
    > >
    > > 1. There is no way to define our own tags
    > >
    > > 2. Quote: "If you don't know PHP, then PHPTemplate can still be a good
    > > choice because only small bits of code are involved. They can just be
    > > copy/pasted into your template."
    > >
    > > This means that the web designer will have a hard time detecting syntax
    > > errors. Also, don't know how good is the error reporting but I suspect is
    > > way behind Campsite.
    > >
    > > 3. Needs Drupal to be installed
    > >
    > > 4. We would have to borrow the Drupal terms, like 'node'
    > >
    > > 5. Poor documentation
    > >
    > > Please let me know what you think or if you think I was wrong in some way.
    > >
    > > Mugur
    > >
    > >
    > >
    > > ________________________________
    > > How low will we go? Check out Yahoo! Messenger's low PC-to-Phone call
    > rates.
    > >
    > >


    Micz Flor - micz@mi.cz

    content and media development http://mi.cz
    --------------------------------------------------------
    http://www.campware.org -- http://www.suemi.de
    http://www.redaktionundalltag.de
    --------------------------------------------------------
  • I've been working with smarty on some projects and was impressed and not impressed Wink along the line of these articles:

    recommended Reading: http://revjim.net/index.php?p=10171/
    Smarty vs phpSavant: http://revjim.net/index.php?p=10170/
    recommended Reading: http://www.gadgetopia.com/post/3700
    recommended Reading: http://www.fudnik.com/main/tiki-read_article.php?articleId=7

    What about considering other templating systems?:
    http://phpsavant.com
    http://www.phpxtemplate.org
    http://www.kwasd.nl/expose/
    http://home.leetsoft.com/liquid
    or maybe even FastTemplate
    or stay with your own templating system?

    I would not recommend phpTemplate for campsite either- by the way phpTemplate is not the main Drupal templating system as such but Drupal supports smarty plug&play as well and mainly supports phpTemplate for backwards compatibility and simplicity (see some discussions in the forums at drupal.org).


    What are the other reasons for choosing smarty?
    Is the smarty decision already final? Well it's already distributed with the latest version-

    greetings
    M.Waldis
  • At 16:27 09.04.2006, you wrote:
    >Is the smarty decision already final? Well it's already distributed with
    >the latest version

    without being too deeply involved in the template engine discussion myself,
    i would be interested to hear what you would recommend and why.

    the idea to drop the current campsite engine also has to do with the fact
    that it is being compiled on the server during the installation process.
    therefore the installation procedure requires more rights for the person
    installing it than your usual drag and drop php installation.

    however, most of the campsite templating should remain 'intact', i.e. the
    templates should still work even with the new templating engine. smarty
    seemed to provide a good frame within which this can be achieved by
    programming smarty compatible 'plug ins'.

    the campsite lingo is custom made for the campsite DB and functionality. so
    it will definately need to stay. of course, on a general level, any
    templating engine is always in danger to do too much. i.e. PHP starting as
    a templating engine. and then becoming something else altogether - and now
    there are templating engines built in PHP, i.e. similarity of templating
    inside a templating concept that became too complex Smile

    related to smarty that means that campsite could:

    a) provide a basic frame of templating lingo but still...

    b) smarty would be the framework within which people can expand the
    templating logic, for example base decisions on specific values in field of
    the article type, i.e. a similar use of a field in the article like a flag,
    expanding the *onfrontpage* and *onsection* for example.

    so using smarty as the base, then writing the campsite template logic into
    it, the API for further template features would already be written so to
    speak, because that's how smarty is being used in campsite, i.e. any
    campsite function for smarty is like a working example on how to do it.

    ideally, this would not touch the smarty API so that it would be one big
    load of development off the campsite dev group. right now all new features
    need to be incorporated into the templating engine by mugur who is doing a
    great job keeping up to date with the request. but with smarty and its API
    it would allow to become more felxible and open and even have additional
    plugins that might or might not make it into the sources - but will be
    available on the site.

    given these objectives, what other templating engines would be an option?


    Micz Flor
    ____________________________________
    [Konzept und Entwicklung]
    Redaktion und Alltag - Flor Lay GbR
    ____________________________________
    Pasteurstrasse 8
    10407 Berlin
    t: +49.30.44044999
    f: +49.30.42085272
    e: flor@redaktionundalltag.de
    ____________________________________
    http://www.fluter.de
    http://www.redaktionundalltag.de

    http://www.berlin.de/stadtplan/map.asp?ADR_ZIP=10407&ADR_STREET=pasteurstra%DFe&ADR_HOUSE=8
  • Thanks for the feedback!

    The smarty decision isnt final until we start writing code.

    I took a look at Savant, and it would definitely be a contender for
    our usage. One of the main things we need is to be able to create our
    own template language. Smarty allows us to do that through plugins,
    and it looks like Savant allows you to do it by creating your own
    compiler.

    We are going to continue with our own template language, but we are
    going to switch the implementation of it. The reason being that we
    want to get away from C++ into pure PHP so that Campsite can be
    installed on any system that supports PHP.

    - Paul

    On 4/9/06, collect@gmx.at wrote:
    > I've been working with smarty on some projects and was impressed and not impressed Wink along the line of these articles:
    >
    > recommended Reading: http://revjim.net/index.php?p171/
    > Smarty vs phpSavant: http://revjim.net/index.php?p170/
    > recommended Reading: http://www.gadgetopia.com/post/3700
    > recommended Reading: http://www.fudnik.com/main/tiki-read_article.php?articleId=7
    >
    > What about considering other templating systems?:
    > http://phpsavant.com
    > http://www.phpxtemplate.org
    > http://www.kwasd.nl/expose/
    > http://home.leetsoft.com/liquid
    > or maybe even FastTemplate
    > or stay with your own templating system?
    >
    > I would not recommend phpTemplate for campsite either- by the way phpTemplate is not the main Drupal templating system as such but Drupal supports smarty plug&play as well and mainly supports phpTemplate for backwards compatibility and simplicity (see some discussions in the forums at drupal.org).
    >
    >
    > What are the other reasons for choosing smarty?
    > Is the smarty decision already final? Well it's already distributed with the latest version-
    >
    > greetings
    > M.Waldis
    >