Comment to Adding photos to events (or groups)
-
To add a button which will display post to context form for specific content module you can add RAW block with the following content on "Albums in context" page:
<button class="bx-btn" onclick="bx_add_custom(this)">Add</button> <script> function bx_add_custom (e) { var sModuleUri = 'albums'; var iContextId = -{profile_id}; $.get( sUrlRoot + 'modules/?r=' + sModuleUri + '/get_create_post_form/', { ajax_mode: true, dynamic_mode: true, absolute_action_url: true, context_id: iContextId, custom: {}, _t:(new Date).getTime(), }, function(oData) { if(!oData || !oData.content) return; $(e).parent().html(oData.content); }, 'json' ); } </script>
To adopt it to some other module replace albums in var sModuleUri = 'albums'; string with another module URI.
-
Hello, how did you do the sModuleUri? Did you just put 'discussion' or the full url thank you
-
Hello lance !
For the Discussions, the sModuleUri variable will have the "forum" value.
-
Thank you work!