Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools

Wiki Documentation

WikiDocumentation

Usage of the Wiki is very straight forward.

1. Formatting

You can use Markdown Syntax to format and structure your input text.

2. Additional Features

Beyond the basic markdown syntax SCT features the following functionality:

2.1. Wiki Links

To link to other wiki pages you can use one of two linking techniques:

2.2. Macros

Macros are a SCT extension to the Markdown language. Their basic syntax is:

{macroname parameter=value}

There is currently no public interface to add 3rd party macros.. but i'm planning on implementing one.

The currently available macros are documented here:

2.2.1. News Macro

The news macro allows you to display threads of a given board category. A simple usage looks like this:

{news category=7 baseURL=/board limit=5}

This would display the latest 5 threads in the board category of the id '7'.

2.2.1.1. Parameters

The news macro supports the following parameters:

2.2.1.2. Template

The News Macro requires a simple template (given by the parameter 'templateName' which is by default wiki/news.html)

An example template might look like this:

{% load sph_extras %}

<ul class="news">
  {% for thread in threads %}
    <li>
      <div class="subject">{{ thread.postdate|sph_date }}: {{ thread.subject }}</div>
      <div class="body">{{ thread.body_escaped }}</div>
      {% if baseURL %}
        <div class="comments"><a href="{{ baseURL }}/thread/{{ thread.id }}/">{{ thread.replyCount }} Comments</a></div>
      {% endif %}
    </li>
  {% endfor %}
</ul>

2.2.2. News RSS Macro

This template renders an RSS link (including RSS icon) to the board rss feed displaying the latest threads in the given category.

{newsrss category=1}

2.2.2.1. Parameters

2.2.3. Include Macro

Allows the inclusion of an external URL into a wiki snip. The file included is also rendered using Markdown !

Example Usage:

{include url=http://yourhell.com/svn/root/django/communitytools/trunk/README start=Directories end=Examples}

The example would include content from the file from the given url starting with a line containing 'Directories' until a line containing the content 'Examples'.

2.2.3.1. Parameters

2.2.4. Include Template Macro

Allows a user to include arbitrary HTML by including a template from djang's templating system. (Ie. only an admin can create HTML content. - or anyone who has access to the template directories, or whereever the templates are stored.)

Example Usage:

{includetemplate templateName=mydir/sometemplate.html}

2.2.4.1. Parameters

All additional parameters will be put into the context of the template as 'params'.

2.2.5. Image Macro

Administrators can add attachments to wiki snips. The Image macro allows to add such attachments as images into the wiki snip.

Example Usage:

{img id=123}

The example would include the image with the attachment Id 123. (The attachment Id is displayed in the list of attachments)

2.2.5.1. Parameters

2.2.6. Attachment List Macro

Creates a list of all attachments of the current wiki snip.

Example Usage:

{attachmentlist}

2.2.6.1. Parameters

2.2.6.2. Template Variables

attachmentlist uses the generic view function object_list but without pagination.

2.2.7. Attachment Macro

Displays a single attachment which is referenced by it's id.

Example Usage:

{attachment id=5}

2.2.7.1. Parameters

2.2.8. Redirect Macro

Redirects from one snip to another. This is useful to create aliases for wiki snips.

Example Usage:

{redirect snip=AnotherSnip}

This does not create an HTTP redirect, but simply loads the other snip. You can also create a chain of redirects (Like RedirectSnip1 redirects to RedirectSnip2 which redirects to RedirectSnip3 .. No idea why this would be of any use.. but it is allowed anyway) - If a loop is detected it breaks the loop at displays the snip the user has requested.

2.2.8.1. Parameters

2.2.8.2. Template Variables

Last Modified: 2008-02-07 19:44:30 by Herbert Poul - [ Snip Changes ] [ Wiki History ]

0 Comments

No comments yet.

Please login to create a new thread.



Powered by Sphene Community Tools