nephila / djangocms-blog

django CMS blog application - Support for multilingual posts, placeholders, social network meta tags and configurable apphooks
https://djangocms-blog.readthedocs.io
BSD 3-Clause "New" or "Revised" License
392 stars 192 forks source link

Two blogs on one site. #692

Closed quercetum closed 7 months ago

quercetum commented 2 years ago

Description

I need two blogs on the site. With non-overlapping news. The articles themselves are displayed correctly. But when the archive is displayed, all links lead to the archive of the first blog, although the number of articles is indicated for the second blog correctly.

Steps to reproduce

Install djangocms-blog, customize. We create settings for two blogs and two categories. We create several articles in two blogs. We add articles and archives to the site. And the archives of both blogs go to the first blog.

Versions

djangocms-blog-1.2.3

Python 3.8.10 Django-3.2.9

Expected behaviour

Each blog should have its own archive.

Actual behaviour

All links of archives lead to the archive of the first blog

Additional information

Wekhrlin commented 2 years ago

I have the same problem.

A workaround which is not very nice, but still works, is to use separate templates for the second instance.

For the archive (plugins/archive.html) you could change <a href="{% url 'djangocms_blog:posts-archive' year=year.grouper %}"> to: <a href="/[your instance]/{{ year.grouper }}">

<a href="{% url 'djangocms_blog:posts-archive' year=year.grouper month=month.date|date:"n" %}"> to: <a href="/[your instance]/{{ year.grouper }}/{{ month.date|date:"n" }}">

the same for plugins/tags.html: <a href="{% url 'djangocms_blog:posts-tagged' tag=tag.slug %}" ... to: <a href="/[your instance]/tag/{{ tag.slug }}" ...

quercetum commented 2 years ago

Thank you very match! It work!

protoroto commented 11 months ago

@Wekhrlin @quercetum This issue should now be fixed on latest release, as urls now take in consideration the app namespace correctly.

Wekhrlin commented 7 months ago

@protoroto I was finally able to install the update and can confirm that it now works perfectly!

protoroto commented 7 months ago

@Wekhrlin Thanks for taking the time to report back! :) I'm glad this is fixed now. @quercetum I'll close this issue, feel free to open a new one if you're experiencing this problem again.