djangocms-blog
djangocms-blog copied to clipboard
Two blogs on one site.
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
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 }}" ...
Thank you very match! It work!
@Wekhrlin @quercetum This issue should now be fixed on latest release, as urls now take in consideration the app namespace correctly.
@protoroto I was finally able to install the update and can confirm that it now works perfectly!
@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.