Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What should be in the main page of a djangocms-blog blog? #541

Open
msmommer opened this issue Mar 6, 2020 · 5 comments · May be fixed by #631
Open

What should be in the main page of a djangocms-blog blog? #541

msmommer opened this issue Mar 6, 2020 · 5 comments · May be fixed by #631
Milestone

Comments

@msmommer
Copy link

@msmommer msmommer commented Mar 6, 2020

Hello,

I installed djangocms-blog (github version with fix by jasujm, as per "migration error" issue), but I am having a lot of trouble understanding how to configure this app properly. (Django version = 2.2.7, django-cms version 3.7.1)

  • The blog page was created and assigned to the blog app, but it used the first template on my templates list, which does not have any blog functionality. So I have a blog page that doesn't do display anything. I can add a "display last posts" plugin, but - is that the right way? I see there is a template in the djangocms_blog/template/ folder. Should I addapt this one?

  • Well, I tried that :-) I wanted to include the menu of the rest of the site, but then show_menu fails, saying it isn't a Blog application query. So clearly I am missing something.

Any hints as well as pointers to appropriate documentation would be greatly appreciated!

@jasujm
Copy link
Contributor

@jasujm jasujm commented Mar 14, 2020

Based on my experience setting up a blog:

The default setup creates a root page "Home" and page "Blog" underneath. The apphook is on the "Blog" page. You can, if you so wish, modify the default behavior and have the blog page be your root (the BLOG_AUTO_SETUP and friends at https://djangocms-blog.readthedocs.io/en/latest/settings.html). You can also have the apphook page at root, and then it will be post listing by default. I don't think either way is right or wrong but depends on what you want. I ended up using the default setup and having a "latest blog posts" plugin on my main page.

As for the templates, the default blog template hijacks the content block on the apphook page. If your parent template doesn't have a content block, or you want more flexibility, you need to customize either the blog template or your parent template.

Sorry, I'm not sure why show_menu would fail without seeing any error messages or code.

Hope this helps!

@yakky
Copy link
Member

@yakky yakky commented Mar 29, 2020

@jasujm thanks for the very comprehensive answer, better than I could have done myself
I'm open to suggestion on how to clarify documentation to help people trying this app to set it up

@yakky yakky added this to the 1.2 milestone May 3, 2020
@09F911029D74E35BD84156C5635688C0
Copy link

@09F911029D74E35BD84156C5635688C0 09F911029D74E35BD84156C5635688C0 commented Jul 23, 2020

Sorry but this is not helping. The setup is very confusing. I got to the point where I made the page, added the app hook, created a blog post but then page displays absolutely nothing. I can add various blog plugins to the placeholder in the template, but that doesn't seem right as every single page shows the same content (click "see more" on post, it changes url but content stays same).

Here's my default and only cms template:

{% extends "base.html" %}
{% load cms_tags sekizai_tags %}

{% block title %}{% page_attribute "page_title" %}{% endblock %}

{% block body %}
{% placeholder "content" %}
{% endblock %}

Config is

CMS_TEMPLATES = [
    ("cms/default.html", "Default template"),
]

What am I missing?

@jasujm
Copy link
Contributor

@jasujm jasujm commented Jul 30, 2020

Here's my default and only cms template:

{% extends "base.html" %}
{% load cms_tags sekizai_tags %}

{% block title %}{% page_attribute "page_title" %}{% endblock %}

{% block body %}
{% placeholder "content" %}
{% endblock %}

Config is

CMS_TEMPLATES = [
    ("cms/default.html", "Default template"),
]

The content needs to be a block, not a placeholder.

@yakky yakky linked a pull request that will close this issue Aug 19, 2020
4 of 5 tasks complete
@yakky
Copy link
Member

@yakky yakky commented Aug 19, 2020

I have added in #631 an improved setup documentation to address both the template changes and the steps required to have the blog on the home page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.