Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Comments: from table to div

Started by carlos 7 years ago · 0 replies · 405 views
7 years ago

Hello to all,
I need to add a little bit of css to the comments, at the moment I only have a cell without format. My guess is to change the snippet below from the file comments.html.twig in the folder partials: (But I'm not having success).
It's the that file the one to change?
thanks in advance.
Carlos

TWIG
    {% if grav.twig.comments|length %}

    <h3>{{'PLUGIN_COMMENTS.COMMENTS'|t}}</h3>

    <table>
        {% for comment in grav.twig.comments|array_reverse %}
        <tr>
            <td>
                {{comment.text}}
                <br />
                {{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{comment.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} {{comment.author}}
            </td>
        </tr>
        {% endfor %}
    </table>
{% endif %}

Change the code to something like this, So I can add css format.

TWIG
{% if grav.twig.comments|length %}

    <h3>{{'PLUGIN_COMMENTS.COMMENTS'|t}}</h3>

        {% for comment in grav.twig.comments|array_reverse %}
        <div>
            <p class="p-comment"> {{comment.text}} </p>
            <br/>
            <br/>
            {{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{comment.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} <h4>{{comment.author}}</h4>
        </div>
        {% endfor %}
{% endif %}

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 80 9 hours ago
General · by pamtbaau, 14 hours ago
1 51 13 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago