djangocms-blog icon indicating copy to clipboard operation
djangocms-blog copied to clipboard

Two blogs on one site.

Open quercetum opened this issue 3 years ago • 2 comments

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

quercetum avatar Nov 11 '21 14:11 quercetum

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 }}" ...

Wekhrlin avatar Feb 01 '22 15:02 Wekhrlin

Thank you very match! It work!

quercetum avatar Apr 05 '22 12:04 quercetum

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

protoroto avatar Aug 04 '23 08:08 protoroto

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

Wekhrlin avatar Nov 22 '23 10:11 Wekhrlin

@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.

protoroto avatar Nov 22 '23 13:11 protoroto