skype gtalk twitter facebook

Template syntax and sample

The KPCMS Template Engine is based on the Django, we have the same syntax like Django have, if you don’t know any of Django's, Please Click here.

Below is the unique Tags and Filters of KPCMS.

Tags

Tags look like this: {% tag %}.

Content Tags

Before using these below content tags, the first thing: {% load content_tags %}

  1. {% get_latest type as latest_content %}
    Get the latest content of the given type*1;
  2. {% get_picture_news type top "x" as picture_news %}
    Get the given type’s*1 content which has a thumbnail;
  3. {% get_category_list type top "x" as category_list %}
    Get the category list of the given type*1;
  4. {% get_content_list type top "x" as content_list %}
    Get the content list of the given type*1;
  5. {% get_category slug as category %}
    Get the category of the given slug*2;
  6. {% get_content slug as content %}
    Get the specified slug’s*2 content;
  7. {% get_by_flag flag for type top "x" as content %}
    Get the specified flag’s content;
    flag: flag of a content, e.g. ‘TOP’ indicate the top content;
    x: item of contents, 0 indicate the first item content;
  8. {% get_hotest type top "x" as content %}
    Get the hottest content of the given type*1;
    x: item of contents, 0 indicate the first item content;
  9. {% get_ month_hotest type top "x" as content %}
    Get the specified range’s(now/day/week/month) content of the given type*1;
    x: item of contents, 0 indicate the first item content;
  10. {% get_content_stat option for type as stat %}
    Get the statistic information of the given type*1;
    option: option of the statistic, the option ‘count’ is available currently indicate the total item number of content;

*1Parameter type indicate the content’s type, available type is: news, products, download, information, video, album, music, gallery, and other customized types;

*2Parameter slug indicate the content’s slug;

Parameter x, unless specified, indicate the items of the content number, 0 indicate all item;

Menu Tags

Before using these below menu tags, the first thing: {% load menu_tags %}

  1. {% show_menu start_level end_level extra_inactive extra_active template %}
    Display menu that the page is checked the ‘in navigation’ and ‘published’ options;
  2. {% show_breadcrumb level template %}
    Display the breadcrumb;
    template(default="menu/breadcrumb.html"):the breadcrumb’s template;
  3. {% show_menu_below_id "page_id" start_level end_level extra_inactive extra_active template %}
    Display the specified page’s menu of given ‘page_id’;
    page_id: the id of the page, set in the back-end of the Pages;
  4. {% show_sub_menu level template %}
    Display the sub pages as menu of the current page;
    template (default="menu/submenu.html"): the sub menu’s template;

Parameters below, unless specified, they mean the same:

level (default=0): the level about to displayed in the menu, 0 indicate all level;

start_level (default=0): the start level;

end_level (default=100): the end level;

extra_inactive (default=0): indicate how many level will not be displayed;

template(default="menu/menu.html"): the template of the menu;

Filters

  1. Teaser: Get the contents before the PAGE_BREAK(insert while edit the content in the text editor of back-end);
  2. left:"x": Get the specified number of lists or strings from left(the latest list items);
  3. right:"x": Get the specified number of lists or strings from right(the oldest list items);
  4. cut_year:"-": Cut off the date string which eaquls current year(like 2010), default separator ’-’;
SHARE THIS: Bookmark with Delicious Bookmark with Digg Bookmark with Facebook Bookmark with Reddit Bookmark with Google Bookmark with StumbleUpon Bookmark with Furl Bookmark with Technorati Bookmark with /. Bookmark with Yahoo

News & Events

  • 9th / November / 2010 We just published a new theme of KPCMS, hope you like it. more»

  • 30th / July / 2010 KPCMS 3.1 released. more»

  • 16th / July / 2010 Event Description. more»



Forum Posts

  • 19th / July / 2010 Test Subject more»

  • 30th / July / 2010 Free templates #1 more»

  • 2nd / August / 2010 JQuery Updated to 1.4 and site changes... more»

What client say's

"The simple is the best.

Lucase.

Contact us

KPCMS
#146 - #149, Shan Nan Electronic-city
Hanzhong, Shaanxi, 723000
P.R.China
Telephone & FAX: +86 916 2248511
E-mail: company@web916.com