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

Several authors, authors and categories profile #697

Open mamedovramil opened 2 years ago

mamedovramil commented 2 years ago

It is required to be able to specify several authors for the article, and also when clicking on the author, instead of filtering, receive a link to his profile. For categories, I would also like to follow the link to the page, instead of filtering.

fsbraun commented 2 years ago

@mamedovramil For two of your requests there might be an easy solution available. If you do not want to filter authors or categories you might want to try and adapt the templates, especially templates/djangocms_blog/include/blog_meta.html:

{% if post.author %}
<li>
    {% trans "by" %} <a href="{% url 'PUT HERE THE URL PATTERN NAME OF YOUR AUTHOR PROFILE' post.author %}">{% if post.author.get_full_name %}{{ post.author.get_full_name }}{% else %}{{ post.author }}{% endif %}</a>
</li>
{% endif %}

Similarly in the same file adjust the category link:

{% if post.categories.exists %}
    {% for category in post.categories.all %}
        {% if category.slug %}
            <li class="category_{{ forloop.counter }}"><a href="{% url 'URL PATTERN NAME FOR CATEGORY PROFILE' category %}" class="blog-categories-{{ category.count }}">{{ category.name }}</a>{% if not forloop.last %}, {% endif %}</li>
        {% endif %}
    {% endfor %}
{% endif %}

The easiest way to adapt the templates is to copy them to your project into a valid template path and adjust them for your project.

While this does not provide the option for multiple authors I hope it at least solves your other issues.

mamedovramil commented 2 years ago

@fsbraun thanks a lot, it helped! 2 of 3 questions closed.