Forum Discussion
As far as I know , there isn't a way to use the standard dropdown option in your custom thread list. (Because the dropdown actions are tied to the each message id of the thread) . Here are a few work arounds that I can think of ,
1. Include the standard message list , hide it and clone and place the options for each message. Then you would have to manipulate the links of the option a tag , with your message id and check if the desired action takes place. As we are doing the whole thing as custom , it might be better if you could choose the options that are required and hide the rest.
2. What we usually do , is use the standard thread page - because of its in built functionality and context setting .But we have done extensive customization to change the look and feel and add/remove other stats , custom components for each message using jQuery.
3. Choose the features that you would need from dropdown , and create your own custom components to perform the actions , using REST api.
I am not sure , which one of these would suit your requirement . But I hope one of it helps.
Thanks,
Sam
Hi,
just be aware that replacing the out of th box message list would mean that you will lose some feature which cannot be replicated using REST Api:
1. Batch processing
2. Moderation tool.
If you want to customize the message list component you might want to get in touch with our Professional Services team.
Our platform is able to override/suppress the columns in the message list but this customization can be achieved only by backend configuration. By overriding I mean that the content of each column can be replaced by a custom component which would give you enough flexibility without giving up the batch processing and moderation tools.
Thanks,
Nico
- bryanpollack11 years agoAce
I've actually found a way to AJAX in the default Lithium options menu so I can use my custom components but still use the proper built in options menu. Thanks for the help.
- bryanpollack11 years agoAce
It's a bit klugey, but it seems to work ok. I set up my Forum Topic page to have both my custom thread component and the default thread component (message-list), and have the default one hidden from view and set to display only one post.
I've set up my options buttons as follows:
$('#posts').on('click', '.options a', function(e) { var id = $(this).closest('.options').attr('id').replace('actions-', ''); getOptions(id, this); });
Here's my getOptions function:
function getOptions(messageId, me) { if ($(me).siblings('[id^=actionMenuDropDown]').length > 0) { $(me).siblings('[id^=actionMenuDropDown]').toggle(); } else { $.get("/t5/-/-/m-p/" + messageId + "?isAjax", function (res) { var html = $.parseHTML(res); var options = $(html).find('.message-uid-' + messageId + ' [id^=actionMenuDropDown]'); $(me).closest('.options').append(options); }); } }
I have the ?isAjax, because I hide certain things on the page when that is passed in (e.g. header, footer, custom thread component) in order to speed up the page load.
And to hide the options after clicking elsewhere:
$(document).mouseup(function (e){ var container = $('.options [id^=actionMenuDropDown]'); if (!container.is(e.target) // if the target of the click isn't the container... && container.has(e.target).length === 0) // ... nor a descendant of the container { container.hide(); } });
Hope that helps!
Related Content
- 5 years ago