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

Several authors, authors and categories profile #697

Open
mamedovramil opened this issue Dec 12, 2021 · 2 comments
Open

Several authors, authors and categories profile #697

mamedovramil opened this issue Dec 12, 2021 · 2 comments

Comments

@mamedovramil
Copy link

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
Copy link
Contributor

fsbraun commented Dec 13, 2021

@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
Copy link
Author

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

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