Hi, first post! Greetings all. I'd like logged in users to be able to post direct to the wire from the activity stream. Would it be a case of copying the input field block from the wire's php file to to the activity stream's? If so can someone help me out with where I'd find the required block and where to put it?
If this has been covered before then I'm sorry! Can you point me?
Thanks!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- David F. Barrero@dfbarrero
David F. Barrero - 0 likes
- Steve Clay@steve_clay
Steve Clay - 0 likes
- Steve Clay@steve_clay
Steve Clay - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- tomown@tomown
tomown - 0 likes
You must log in to post replies.Hi,
You can try with this code:
<div class="mywireclass">
<?php
$form = elgg_view('forms/wire');
echo elgg_view('input/form', array('body' => $form, 'action' => "action/thewire/add"));
?>
</div>
Bulding the form is easy:
You just want to insert in the right place. Easiest place would be after the page/layouts/content/header view. Make a view and extend that view so yours comes after.
In views/default/my_plugin/after_header.php, echo the form if you're in the "activity" context:
BTW, the thewire_tools plugin does this a little smarter: they put the form before the river filter view, which is only displayed in the river. Identical output, less overhead on other pages.
@tomown There is an existing plugin: http://community.elgg.org/plugins/1250241/3.1/custom-activity
Thanks everyone, got it done.