Utilities for controlling the font size of an element.

June 29, 2023, 10:04 p.m.

lets

intro-Utilities for controlling the font size of an element.

When the COMMENTS_XTD_MAX_THREAD_LEVEL is greater than 0, comments below the maximum thread level may receive replies that will nest inside each other up to the maximum thread level. A comment in a the thread level below the COMMENTS_XTD_MAX_THREAD_LEVEL can show a Reply link that allows users to send nested comments.

In this section we will enable nested comments by modifying COMMENTS_XTD_MAX_THREAD_LEVEL and apply some changes to our blog_detail.html template.

We can make use of two template tags, render_xtdcomment_tree and get_xtdcomment_tree. The former renders a template with the comments while the latter put the comments in a nested data structure in the context of the template.

We will also introduce the setting COMMENTS_XTD_LIST_ORDER, that allows altering the default order in which the comments are sorted in the list. By default comments are sorted by thread and their position inside the thread, which turns out to be in ascending datetime of arrival. In this example we will list newer comments first.

Let’s start by editing tutorial/settings.py to set up the maximum thread level to 1 and a comment ordering such that newer comments are retrieve first:

Related Topics
utils
Post your comment
...
on 9 months, 1 week
Where are all the articles?
...
lets on 10 months
You can also help by reporting
...
lets on 10 months
be misinterpreted as offensive
...
lets on 11 months, 2 weeks
yesssss
...
lets on 11 months, 2 weeks
yesssss
...
lets on 11 months, 2 weeks
yesssss
...
lets on 11 months, 2 weeks
ghjjjj
...
lets on 1 year, 2 months
hello from form 1
...
lets on 1 year, 2 months

comment from admin

...
Utilities for controlling the font size of an element.

intro-Utilities for controlling the font size of an element.

Last updated 1 year, 2 months ago