Sphene Community Tools


Copyright © 2007-2009 by Herbert Poul
You are not logged in.

Change Language:

AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools



SCT has a few global preferences which can be configured in your settings.py. To avoid name clashes and make it easier to find those settings SCT uses only one dictionary - called SPH_SETTINGS.

You can configure them in your settings.py:

    'django096compatibility': True,

1. Inline documented settings

A few settings are not included on this site - either because i forgot to add them, they are very obscure and never used, etc.

But most of them are documented inline:

If you have further questions feel free to ask in the board.

2. Compatbility

2.1. django096compatibility - True/False

Activates compatibility mode for the django 0.96 release. (Is a Boolean value) (default: False)

3. Community

3.1. Settings for avatars

4. Markdown (Wiki Renderings)

4.1. markdown_number_headings - True/False

Allows you to activate or disable automatic numbering of all headings (default: True)

4.2. markdown_top_heading_level - Integer

Allows you to define with which level the header numbering should start. by default h1 is used. if you set this to 2 it starts with an h2 html tag.

5. Wiki

5.1. wikilink_regexp - String

Configures the regular expression used for finding wikilinks. The default can be found in the subversion repository: http://yourhell.com/svn/root/django/communitytools/trunk/sphenecoll/sphene/sphwiki/wikilink_utils.py (WIKILINK_RE)

6. Board

6.1. board_markup_enabled

List of enabled markup languages for forum posts.


SPH_SETTINGS['board_markup_enabled'] = ( 'bbcode', )

Available options:

The default is still just 'bbcode' because there are several problems with the markdown rendering. (Like: quoting other posts - it is impossible to quote a bbcode post in a markdown post..)

6.2. board_custom_markup

This option works together with board_markup_enabled and can be used to add custom functions which can be used as markup.

For example let's assume we want to create a simple markup function which only wraps the output into a html "pre" tag.

We start by creating a class somewhere in the python path. In my example it's in sphene/custom_renderers.py (For your renderers it makes sense to put them into your own project / application paths)

from sphene.sphboard.renderers import BaseRenderer

class SimpleMarkup(BaseRenderer):
    label = 'Very Simple Markup'
    reference = '<a href="/link/to/some/documentation.html">Very Simple Markup</a>'

    def render(self, text):
        return "<pre>%s</pre>" % body

Now define this markup in your settings.py:

SPH_SETTINGS['board_custom_markup'] = { 'simplemarkup': 'sphene.custom_renderers.SimpleMarkup', }

(The dictionary consists of 1.) the method name including the whole module name and 2.) a label which is displayed to the user.)

To allow users to use this markup we have to enable it, just like any other markup using board_markup_enabled:

SPH_SETTINGS['board_markup_enabled'] = ( 'bbcode', 'simplemarkup', )

This will leave 'bbcode' as the default selection, but users can also select the 'Very simple markup'-markup. - You can of course also define only your custom markup method if you don't want to give your users a choice.

6.3. Heat

See Board/Heat for configuration of how the heat of threads are calculated.

7. Miscellaneous

7.1. wiki_rss_url

Is used by the default wiki showSnip template to create a link to a rss feed.

This should be set to /feeds/wiki/ - which by default lists the latest changes of all wiki snips in the current community group.

Last Modified: 2007-11-01 19:45:13 by Herbert Poul - [ Snip Changes ] [ Wiki History ]


No comments yet.

Please login to create a new thread.

Powered by Sphene Community Tools