Contact Sales  |  1-888-227-5040   |   Contact Support     
Login   |   Our Blog   |   Newsletter

Subscribe By Email

Receive email alerts when new blog posts are available!

Subscribe by RSS

Subscribe to our blog

Follow Us

Follow us on Twitter

The Topics


Recent Comments

    Robert Lincolne: Very excited about this guys, might just have to return to the fold, so to speak! Keen to hear about the SupportTrio release when it comes out. Rob :)
    Charles Novick: Is the 5.o Beta Released with full unencrypted PHP? Thanks
    Allun Edwards: How often do you sent out mass emails - is once a month too much - Allun
    Evan: Social media is a must for affiliate marketers. Soon all affiliates will be using social media to promote.
    annuta: Survey is very nice thing to earn money also, there are many special offers with that things!
    Tanay: Web 2.0 has exposed a new world of Webmarketing for the Affiliates.
    len bullard: I am flabbergasted by business contacts who insist on using their avatar names in email. If you don’t sign it with a real name, I assume your business is just as unreal.
    Elliotte Rusty Harold: Very good advice, which makes me wonder how you missed other basic things like signing your full name to the post so it can be quoted with attribution or including a real,...

Explore the blog


Our Blog Archive

Our Products

1-2-All iSalient KnowledgeBuilder SupportTrio TrioLive SwiftTraction visualEdit

Using Smarty Templates in KnowledgeBuilder

Chris / Aug 04

With the lastest version of [KnowledgeBuilder][1] came a huge change in how much flexibility the system gives you to tailor KB to your site’s look and feel. It used to be that the “public” section of KB was a collection of half HTML half PHP pages that were difficult to understand and edit. About the only thing you could do easily was specify a header and footer and change some colors via the master CSS file. Knowledge Builder 2.5x now uses the Smarty Template Engine to allow you to completely customize how your KB site looks and how the information is presented.
[1]: http://www.activecampaign.com/kb “KnowledgeBuilder”

## Smarty Template Background ##
The Smarty Template Engine ([Smarty][2]) is more of a “presentation framework”, allowing PHP programmers to separate their application’s business logic from the visual display. Smarty accomplishes this by using a light markup language that can be embedded in your HTML to display dynamic data that is generated by the business logic side of your application.

## How we use it ##
A lot of work went into completely separating the logic that manages Categories and Articles in KB from the actual presentation of Categories and Articles. This basically splits KB into two parts: one part that evaluates the current context (viewing an article, viewing a category, making a comment, subscribing to an article, etc) and fetches the correct data for that context, and one part that displays that raw information. The second part is what is now completely customizable by you.

When any given page loads in the public section of [KnowledgeBuilder][1] (non-admin section that is), the last step in the process is to render the template for that page. Templates for KB live in the `templates` directory, in subdirectories for each *template set*. KB is shipped with three templates: *Default*, *Directory*, and *Simple*. If you are upgrading KB please note that the old KB template directories will not be deleted, but you can tell which ones are the old ones because their directory names start with lowercase letters (if you no longer need these, it’s safe to delete them).

> *Choosing a template:*
> You can choose which template set you want to use in the Admin section under Settings.

*Continue to the next page to learn about how KB’s templating system is structured…*

[1]: http://www.activecampaign.com/kb “KnowledgeBuilder”
[2]: http://smarty.php.net “Smarty”

Pages: 1 2 3 4

4 Comments

Tim at 2005-08-04 12:34:04

Very nice write up. The {Debug} is great tool - I wish I had known about this earlier.

tb

 
Chris at 2005-08-04 12:42:25

Yeah, {debug} is your best friend when working on a Smarty based site.

 

Make Your Own Web Site » Make Your Own Web Site…

As a final bid for bringing together community through the library a calendaring system could be implemented which gives all recognized community organizations an opportunity to plug into a central calendar system, hosted by the library; providing a li…

 
Create My Business Plan at 2008-10-30 03:21:46

Smarty Template Engine is really work smartly….i am appreciating it from core.Thanks!!

 
Name
E-mail (Never Shown Publicly)
URL (Optional)
Your Comment (smaller size | larger size)



  Press Inquiries   |  Privacy Policy  |  Site map
© 2009 ActiveCampaign,Inc. All rights reserved.