Why can’t I see the blog entries I have made using cmsplugin blog for Django-cms?
I have django-cms setup on a development server (localhost). I installed cmsplugin using the instructions documented here.
When I go to “http://localhost:8000/admin/” Cmsplugin_Blog appears under site administration. From the entries page I am presented with an overview of the entries I have made. Editing an individual entry, I can add a plugin (text) and add text for that entry. I then make sure that the the particular entry is published.
Going to my blog page (CMS->Pages) I then choose cmsplugin_blog and add the latest entries plugin (I can not see any other relevant plugins). Finally I choose advanced settings -> Application -> Blog Apphook (and save). When I preview the blog page I can only see the dates of the last entries and the headings of the entries.
I’m not sure if it’s something I did wrong within my setup so I included the process I went through to set up cmsplugin.
I edited INSTALLED_APPS in settings.py :
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'cms',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.link',
'cms.plugins.file',
'cms.plugins.flash',
'cms.plugins.googlemap',
'cms.plugins.teaser',
'cms.plugins.video',
'cms.plugins.twitter',
'cms.plugins.snippet',
'cms.plugins.inherit',
'cmsplugin_contact',
'cmsplugin_gallery',
'mptt',
'menus',
'south',
'sekizai',
'cmsplugin_blog',
'djangocms_utils',
'simple_translation',
'tagging',
'django.contrib.staticfiles',
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
And also added:
JQUERY_JS = 'https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'
JQUERY_UI_JS = 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js'
JQUERY_UI_CSS ='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/smoothness/jquery-ui.css'
JQUERY_UI = '/path/to/jquery/'
JQUERY_JS = '%sjs/jquery-1.4.4.min.js' % JQUERY_UI
JQUERY_UI_JS = '%sjs/jquery-ui-1.8.9.custom.min.js' % JQUERY_UI
JQUERY_UI_CSS = '%scss/smoothness/jquery-ui-1.8.9.custom.css' % JQUERY_UI
CMSPLUGIN_BLOG_PLACEHOLDERS = ('first', 'second', 'third')
CMS_TEMPLATES = (
('template_1.html', 'Template One'),
('template_2.html', 'Template Two'),
('footer.html','Template Footer'),
('sidebar.html','Template Sidebar'),
('cmsplugin_blog/cmsplugin_blog_base.html','cmsplugin_blog'),
)
I the created a template “cmsplugin_blog/cmsplugin_blog_base.html”:
{% extends "base.html" %}
{% block body %}
{% block left-col %}{% endblock %}
{% block right-col %}{% endblock %}
{% endblock %}
And then ran:
python manage.py syncdb
After having the problem described in my question I created a new template view_detail.html:
{% extends "cmsplugin_blog/cmsplugin_blog_base.html" %}
{% load placeholder_tags cmsplugin_blog_tags simple_translation_tags %}
{% block left-col %}
{{ block.super }}
<h1>{% with object|get_preferred_translation_from_request:request as title %}{{ title }}{% endwith %}</h1>
<p class="date"><span>{{ object.pub_date|date:"d F Y" }}</span></p>
{% with object.placeholders|choose_placeholder:"content" as content %}
{% render_placeholder content %}
{% endwith %}
{% endblock %}
{% block right-col %}
{% render_author_links %}
{% render_month_links %}
{% render_tag_links %}
{% endblock %}
However, when I attempt to use this template in the cms I am not able to add any plugins to the page and I still have the original problem. This is a full copy of my settings.py for reference.
I had the same problem. When I change ‘content’ in the following line in cmsplugin_blog/templates/cmsplugin_blog/entry_detail.html then the ‘first’ placeholder is rendered as blog content:
new line:
I do not have enough experience with django to understand what causes this, hope someone can provide more clues.