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

    Thomas J. Rundquist: We use theses scales in out Racial Attitude Survey and Cultural Diversity Test. RAS was reviewed by Mental Measurements Yearbook and the basic concept is in ENTREPRENEUR...
    Mike: I consider re-writing software (a.k.a. refactoring) as the equivalent of simplifying equations in mathematics. IMHO, those who don’t habitually refactor will never produce great...
    Anonymous: While the title of this post is “The 4 P’s of Marketing You Should Ignore”, I only see one of the P’s addressed: promotion. And while it is certainly true that...
    Alexander TheBackpackr.com: Just trying to help :)
    Alexander TheBackpackr.com: Hi there, its a fairly interesting article on type… however, I don’t recall having a Veranda font installed. :) Perhaps you might be making reference to...
    Landing Page Templates: Thanks for the template. Its lovely.
    Alex: That makes no sense….. lets say that I’m running site where VB is my community forum and Support Trio is my Support system… based on what you just wrote, my clients need to...
    Alex: I’m lost a little… can existing Support Trio users login to vBulletin …..is it more like login share? both ways?

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

## KnowledgeBuilder Template Structure ##
When you visit the front page of your [KnowledgeBuilder][1] site you are in the *startup* context. KB loads up the *index.htm* template which in turn (because you’re in the *startup* context) loads *startup.htm* for the internal section. Remember, *index.htm* the the container template for all the pages on your site (with a couple exceptions). This structure can’t be changed, the `index.htm` template is always used first and it is responsible for:

1. Drawing the “frame” of the website
2. Including a *context specific* template, specified in a the [Smarty][2] variable `$content_template`

In the *Default* template set’s `index.htm` line 238 looks like this:
[html num=238]
{ include file=$content_template }

[/html]

Notice the `{ include file=$content_template }`? Thats a [Smarty][2] [*include*][3] statement, the `$content_template` is a variable that holds the name of the content-specific template for whatever context the site is currently in. For example, when viewing an article, `$content_template` has the value `article.htm`, and so line 239 in `index.htm` brings in the contents of the `article.htm` template. Likewise, when looking at a category, the `$content_template` variable has the value `category.htm` and so the contents of the `category.htm` template are brought in. This allows you to maintain a consistant *shell* around the contents of your site.

This structure is about the only one you must keep when designing your own template sets: A central `index.htm` template and various *context specific* templates with the proper names. For reference, here’s a list of the *context* template names:

* category.htm - Used to show the view of a category
* email.htm - Used when emailing an article to someone
* comment.htm - Used when viewing all comments or making a new comment
* article.htm - Used to show a single article
* saved.htm - Used to show/manage your saved articles
* author.htm - Used to view author information about an article
* glossary.htm - Used to show the Glossary terms
* search.htm - Used to show the search page
* similar.htm - Used to show similar articles
* contact.htm - Used to allow the user to ask a question
* login.htm - Used to login for locked content or categories
* startup.htm - Main startup page

*Continue to the next page to get the basics on how to use Smarty markup…*

[1]: http://www.activecampaign.com/kb “KnowledgeBuilder”
[2]: http://smarty.php.net “Smarty”
[3]: http://smarty.php.net/manual/en/language.function.include.php “Smarty Include Function”

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)



Print  |  Bookmark
© 2009 ActiveCampaign,Inc. All rights reserved.