Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    23
    Plugin Contributions
    0

    Default Implementing Smarty templating

    Before anyone says it: yes I know that the devs have no interest in doing this.

    However, I can't see a good reason why I can't do it as a custom "template" using the override system.

    If I run my ideas through here, maybe someone can tell me why they're doomed to failure?

    Basically, what I want to do is take each file in the default template and split it into two parts: logic and layout. The first part would generate all the data it does already, but instead of directly displaying them would pass the values to a $smarty object, and then call $smarty->display() at the end to pull in the template part.

    This would mean that the granularity of the template design would be the same as the Zen templates, so this wouldn't be as flexible as I would like, but once I get that far I can probably look to improve things.

    To do this i will need to:
    • Insert the Smarty libraries somewhere - what would be a good path to do this?
    • Create my own set of functions (and some Smarty plugins) to be included by the other pages (ie the library would need including once per page) - where best to put that and make sure its included?
    • Create a directory for the Smarty compiled and cached files - where best to put that?
    • Where best to put the Smaryt template files?


    Alternatively tell me why it won't work and I'll avoid wasting my time :-)

    PS: See smarty.php.net for those who have no idea what I'm talking about!

  2. #2
    Join Date
    Dec 2006
    Posts
    2
    Plugin Contributions
    0

    help question Re: Implementing Smarty templating

    I'm wondering if you got anywhere with this? It is something I was looking at doing as well, and found your post.

    Cheers,

    Tom

  3. #3
    Join Date
    May 2006
    Posts
    23
    Plugin Contributions
    0

    Default Re: Implementing Smarty templating

    Quote Originally Posted by simmerz View Post
    I'm wondering if you got anywhere with this? It is something I was looking at doing as well, and found your post.
    Unfortunately lack of time means that it's still on my list of things to do, but hasn't seen any action yet :-(

    If it's something you're looking to do, though, please stay in touch as I might be more inclined to put some time in if I'm not alone!

  4. #4
    Join Date
    Dec 2006
    Posts
    2
    Plugin Contributions
    0

    Idea or Suggestion Re: Implementing Smarty templating

    Quote Originally Posted by more-solutions View Post
    If it's something you're looking to do, though, please stay in touch as I might be more inclined to put some time in if I'm not alone!
    Its certainly something I've been looking at, but not really got the time to delve further until some time in the new year. However, I'm imagining that to start with it would be a "Smarty" template, although I would imagine that in future, it would really need the core variables moved back into the core Zen Cart codebase, and then pushed to Smarty via the template mech.

    Cheers,

    Tom

 

 

Similar Threads

  1. Ez-page templating
    By flipsidenz in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 16 Dec 2010, 04:53 PM
  2. Smarty error
    By lakotasouix in forum Installing on a Windows Server
    Replies: 1
    Last Post: 20 Oct 2008, 04:54 PM
  3. The Smarty Template Engine
    By gtruk9 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 15 Oct 2006, 08:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR