- edited description
In blog post page, with {% component 'comments' %} it works fine.
the problems come forking in:
{% set comments = comments.comments %} {% set userId = comments.userId %} {% set depth = comments.depth %} ...
Comments (9)
-
reporter -
repo owner Hello! Can you provide more info? I don't understand what does it mean "forking {% component 'comments' %}"
-
reporter Hi Alexey, this is what I mean when I say "forking":
on the CMS > pages > mypage.htm I drag Comments component, the result is:
{% component 'comments' %}
Then in right upper corner I click on the button
, the result is:
{% set comments = comments.comments %} {% set userId = comments.userId %} {% set depth = comments.depth %} {% set rate = comments.options.rate %} <div class="container"> <h3>Comments</h3> <div id="message-wrapper" class="alert alert-info alert-dismissible fade in" role="alert" style="display: none;"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span> </button> <span class="message created success" style="display: none">Your comment has been posted!</span> <span class="message updated success" style="display: none">Your comment has been updated!</span> </div> <div id="comments" {% for key, value in comments.options %} data-{{ key }}="{{ value }}" {% endfor %}> {% partial comments ~ "::comments" comment=comment userId=userId depth=depth rate=rate %} </div> ... <div id="loader" style="display: none"></div> </div>
-
repo owner Hello! Sorry for the late reply. I checked it. You can remove this line.
{% set comments = comments.comments %}
And everything should works fine.
-
reporter Thanks, I have not tried yet. I'll update you soon
-
reporter Hi Alexey, this does not seem to work for me. what I did was change the name of the component and the LengthAwarePaginator. It seemed to me a conflict due to the equal name of the plugin and the component. And now it works fine. Perhaps the problem is, as in the first dump() attached image: {{ component }} NULL, {{ userId }} NULL, {{ rate }} NULL, Unfortunately I'm not an experienced developer and I can't explain well in English
-
repo owner Your can copy /plugin/xeor/comments/components/comments folder to your theme and modify files there. https://octobercms.com/docs/cms/components#overriding-partials
-
reporter Thanks
-
reporter With a new october installation the solution:
Remove this line
{% set comments = comments.comments %}
works fine
- Log in to comment
maybe there is a simple answer