Guide to Templates

From Newscloud

Jump to: navigation, search

NewsCloud provides a powerful templating engine based on Smarty to let you customize the look and feel of your Journal and Group pages. Soon, you'll be able to build an entire news site with custom pages.

You can manage your templates in NewsCloud at Site Editor -> Templates page.

You can assign a template to your Journal at the Site Editor -> Journal .

There are a number of download templates and sub-templates that you can view as examples.

No PHP is allowed in our NewsCloud Smarty templates (except by special arrangement - email us), but other than that you can use any documented Smarty feature.

Smarty Documentation

Here are some example templates which show what is possible:

Default NewsCloud Journal
Example 1
Example 2
Example 3
Example 4
Example 5
Example 6
Example 7 
Example 8
Example 9

Contents

View Sample Templates

The following links show you the code for a sample custom NewsCloud journal. It demonstrates how you can easily customize an HTML page to integrate Smarty variables form NewsCloud to display your journal in any way that you wish.

There is a parent template which includes sub-modules of other elements that you might want on your page. The parent page links to a CSS file that you design.

Sample Journal

Sub-modules:

Listing Stories

Comments

About

Links

Friends

Blog

Tag Cloud

What Data is Available to Your Journal Page

$page->title - the title for the page $page->js - an array of javascript links to load on the page for the standard journal $page->css - an array of css links to load on the page for the standard journal

$nav->sort - the current sort for the journal view e.g. mostrecent, mostdiscussed, toprated, mostread $nav->current - the current page of the journal $nav->last - the last page number of the journal

$journal

$journalComments - an array of comments on stories from this journal

$myComments - an array of comments the journal user posted to NewsCloud

$friends - an array of the journal user's friends

$blog - an array of headlines from the journal user's blog

$storyCount - the number of stories on the page

$storyRows - an array of stories from the journal, each element has the following properties:

->title

->imageid

->description

->submit_member

->date

->cntComments

What Data is Available to Your Group Page

Coming soon

How to place ads on Your Journal

Coming soon

List of Default Templates

You can also view these at the Edit Templates page:

default_journal_frame.tpl and default_journal_paging.tpl


default_group_frame.tpl and default_group_paging.tpl

List of Default Sub-Templates

You can also view these at the Edit Templates page:

commentList.tpl

Look at the Comment panels on my Journal.

friendList.tpl

Look at the My Friends panel on my Journal.

simpleStoryList.tpl

Look at the My Blog panel on my Journal.

simpleTagList.tpl

No example right now.

tagCloud.tpl

Look at the Top Interests panel on my Journal.

Personal tools