This document shows how Deme can be set up after being installed on a server.
To change who can see the advanced layout tools, you'll need to change Advanced Layout
under Global Permissions
:
- Log in as Admin by clicking on the person icon in the top right of the site, then clicking
Login as
and choosingAdmin
- Go to the site Admin page by clicking its link in the footer
- Go to Global Permissions
- Under
Everyone
, remove theAdvanced Layout
permission by clicking its [-] button and then save. Now the only user who sees the Advanced Layout bar is the Admin. - Let's say we want logged in users to see the Advanced Layout bar but not Anonymous users. First, let's allow all users to see the bar by reenabling
Advanced Layout
underEveryone
by clicking [+] and saving. Now, let's clickAssign a Permission to a User
at the very bottom of the permissions and enterAnonymous
and then clickAdd Collection
. Next, in the newly generated permission area for Anonymous, add aNew Permission
, from its dropdwon menu selectAdvanced Layout
, click [-] to disallow, and then finallySave Permissions
. - Now if you visit the site as an Anonymous user, you'll no longer see the Advaned Layout tools.
- Log in as Admin
- From the Actions menu, Actions > Create (you can also click directly on the [+] icon)
- Choose
New person
- Log in as Admin
- Go to your current site settings. By default, your site will be
Default Site
, which you can get to by searching for it. - Here you'll be able to edit your sites
Title
andLogo
.
- To add an image logo, click the + button and in the popup window, choose a file and create the image document. The popup window will then close and your image's name will show up in the image logo field. Be sure to save for the logo to show up.
- To edit the title, simply add a title and save.
- Log in as Admin
- From the Home Page, press the Edit button
- The Home Page is a Django style template. In this case, all we need to do is keep everything inside the
{% block content %}...{% endblock content %}
tags.
To change how Deme looks, you'll need to change your site's default layout
:
- Log in as Admin
- Add a new
Django template document
or edit an existing one. By default, Deme comes with aSample Layout
. If you're making a new layout, be sure to:
- Set
Override default layout
to true. - Have
{% extends "base_layout.html" %}
be the first line of your new layout.
- Go to your current site settings. By default, your site will be
Default Site
, which you can get to by searching for it. - Edit your site's
Default layout
to your new layout. In our case, this will beSample Layout
. By default, there is also a "Sample Forum Layout" with another look and feel based on http://communityforum.airhealthprojects.org. - Click save and your layout will be updated
To customize your site, you edit the block
s that make up the different sections of the site. To learn more about the syntax and technical details, visit Django's Templates Documentation
To prevent anonymous users from viewing the site, we change what's displayed to them using this code:
{% block body_wrap %}
{% if cur_agent.is_anonymous %}
{% include "demeaccount/required_login_include.html" %}
{% else %}
{{ block.super }}
{% endif %}
{% endblock body_wrap %}
By default, the banner area (block) is left empty. To place content into it, we overwrite the default with the content we want:
{% block banner-section %}
<div class="banner-section">
<h3>Generic website banner text</h3>
</div>
{% endblock banner-section %}
The easiest way to add your own CSS is through using the custom_css
block:
{% block custom_css %}
.page-layout .logo-section a.logo {
background: darkred;
}
...
{% endblock %}
If you have existing CSS files or anything else you need to include inside the <head>
, use the head_append
block.
Tabs can be added to a special section underneath the Banner section. Tabs need special syntax to work:
<div class="tabs-section">
<ul class="nav nav-tabs">
<li {% ifequal full_path "/" %}class="active"{% endifequal %}><a href="/">Welcome</a></li>
...
</ul>
</div>
The {% ifequal full_path "/" %}
syntax highlights that specific tab if you're on the relevant page.
If you don't want a particular block from showing up, you can clear its contents. For example, to remove chat, declare the chat block and leave it empty:
{% block chat %}{% endblock %}
To change the sidebar, overwrite the sidebar-section
block. This is a great way to change the sidebar to link to resources, etc.
<div class="sidebar-section">
<div class="panel">
<div class="panel-heading">
Resources
</div>
<ul>
<li><a href="#">PDF Link Goes Here</a></li>
<li>...</li>
</ul>
</div>
</div>
To prevent non-admins from seeing the footer, we only show the footer to admins.
{% block footer %}
{% if cur_agent.is_admin %}
{{ block.super }}
{% endif %}
{% endblock footer %}