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

Blog Content not loading properly on click 'read more >>' #678

Open
srinivas-kini opened this issue Jun 17, 2021 · 1 comment
Open

Blog Content not loading properly on click 'read more >>' #678

srinivas-kini opened this issue Jun 17, 2021 · 1 comment

Comments

@srinivas-kini
Copy link

Description

Steps to reproduce

  • Create a new Blog Config.
  • Create a new Blog Category.
  • Create a new Article for that Config and Category and save it.
  • In CMS, create a new page and select the plugin 'Latest Blog Articles' and add it to the page.
  • In the blog preview section on clicking 'read more >>' and navigating to the contents of the individual blog, it does not load the content of the individual blogs.

Versions

djangocms-blog==1.2.3

Expected behaviour

The content of the blogs should be loaded properly.

Additional information

Screenshots
image
image

settings.py

PARLER_LANGUAGES = {
    1: (
        {'code': 'en-us'},
    ),
    'default': {
        'fallbacks': ['en-us'],
    }
}

BLOG_AUTHOR_DEFAULT = True
BLOG_AUTO_NAMESPACE = 'Blog'
BLOG_CATEGORY_PLUGIN_NAME = 'Categories'
BLOG_DEFAULT_OBJECT_NAME = 'Article'

META_USE_TWITTER_PROPERTIES = True
META_USE_GOOGLEPLUS_PROPERTIES = True  # django-meta 1.x+
META_USE_SCHEMAORG_PROPERTIES = True  # django-meta 2.x+

@nubenum
Copy link

nubenum commented Jan 29, 2022

Most likely the same problem as in #52 and #85 and #636 and #354 and #270 and #524 and...

To recap:

Default configuration (BLOG_USE_PLACEHOLDER = True, BLOG_USE_ABSTRACT = True):

Simplified configuration (BLOG_USE_PLACEHOLDER = False, BLOG_USE_ABSTRACT = False):

  • You can write the body directly in the article creation popup.
  • To display a truncated version of the article body instead of an abstract (if BLOG_USE_ABSTRACT = False) in the article overview, you probably want to modify the djangocms_blog/includes/blog_item.html template like so:
<div class="blog-lead">
      {% if not TRUNCWORDS_COUNT %}
          {% render_model post "post_text" "" "" "safe" %}
      {% else %}
          {% render_model post "post_text" "" "" "truncatewords_html:TRUNCWORDS_COUNT|safe"  %}
      {% endif %}
</div>

Bear in mind that the BLOG_USE_{PLACEHOLDER,ABSTRACT} variables in settings.py seem to take effect only for newly created blogs. For existing blogs, you can change these settings via the admin UI: <site name> -> Administration... -> Blog configuration -> <your blog> -> checkboxes under general settings.
Also bear in mind that Latest Blog Articles is not the standard way to add the blog, also see here.

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

No branches or pull requests

2 participants