-
Notifications
You must be signed in to change notification settings - Fork 229
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
Possibility to have multiple threads in one page #235
Conversation
* var fos_comment_thread_id = 'a_unique_identifier_for_the_thread'; | ||
* // Set the thread id if you want comments to be loaded via ajax (url to thread comments api) | ||
* // Your thread container must have data-thread-id attribute with requested thread id. | ||
* <div class="thread-contaner" data-thread-id="my_unique_thread_id"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo here
Is this PR still a WIP? I can't imagine this code already works 100%. There are a lot of missing changes. Apart from that the current JS isn't designed for this (imo) and I'm not sure if I want to support this natively in the bundle with the current JS implementation. |
@asm89 for me all is working god. About what missing changes you talking? |
@asm89 - can you answer on my question? |
If we're going to end up doing something to natively support this, I would prefer to change FOS_COMMENT into an reusable class where you call something along the lines of this: var thread = new FOS_COMMENT(thread_container, { url: url }); |
Hello, I am facing the same problem: I want to include many threads on one page. (A bit like Facebook does with FriendStream). So we should work on this feature, there is definitly a usecase. @asm89 could you please ping back what issues with this PR you are seeing (missing updates)? cheers mablae |
I have plans to redo the javascript to support multiple threads, it will just take some time. I dont think this approach is the best one, I would prefer to move to a more object instance approach. |
Sounds great! |
You may have to have a plan for how you register thread.permalink if you have multiple threads on the same page... |
A good point. My current code changes dont take into account using different permalinks. Will address this next time I work on it (and it is almost ready to merge into master!) |
Hi, has there been any progress with this? I'm desperate for this functionality! Many thanks. |
There has been progress but it has stalled for about a month now. I have what I consider to be the 3.0.0-alpha1 branch on my repository, but there is still more work to be done before pushing it. It contains large BC breaks and most users of FOSCommentBundle have probably not constrained their version to 2.0.*.. |
Hi, is it now fixed ? i really want to implement this functionnality. |
@lerminou he has it in this new-javascript branch meaning it has not been released yet, we are still in 2.0.x 👶 |
@merk: Any news on the 3.0.0 branch? |
No sorry, I havent had time to dedicate to tidying it up. I still dont know when I will get a day to sort it out and release it. The current state is at https://github.com/merk/FOSCommentBundle/tree/new-javascript |
any update on this? |
For those interested, I was able to have multiple threads on the same page using the original version of the bundle (without modifying any files):
<div class="fos_comment_thread" data-thread="{{ thread.id }}">
{% include 'FOSCommentBundle:Thread:comments.html.twig' with {
'comments': comments,
'thread': thread
} %}
</div>
var fos_comment_thread_container = $('.fos_comment_thread'); It works because, in |
any update on this? |
Thanks @ahilles107 I did as you suggested. I spent time to understand and apply so the solution for those who are interested (I copy and include comment.js due to I don't use assetic): |
@fundup |
It seems to be DOM selector to insert comments so I think it's used |
I copy the code you shared, but I can't see any comment textarea box. All the thread_containers are empty divs. |
I can't see any comment textarea box. All the thread_containers are empty divs. |
Hi, |
Hi, I found a hack solution for requirement: adding a iframe tag and the src attribute point to a route which load the jquery {% include 'FOSCommentBundle:Thread:async.html.twig' with {'id': 'id'} %} |
Hi, |
|
If you want have multiple threads on one page add the following code at a desired place in the template to load the comments
Your page must have:
fixes #232