By Izabela Krzyzanowska on Thursday, 14 April 2016
Posted in Technical Issues
Likes 0
Views 373
Votes 0
Hello

I'm Developer from DJ-Extensions.com team and I have little problem with adding html to stream in integration EasySocial with Dj-Classifieds..
I'm adding stream in this way

$stream = Foundry::stream();
$template = $stream->getTemplate();
$actor = Foundry::user( $row->user_id );

$template->setActor( $actor->id , 'user' );
$template->setTitle( $item_title );
$template->setType( 'full' );
$template->setContent( $item_content );
$template->setContext( $row->id , 'djclassifieds' );
$template->setVerb( 'create' );

$stream->add( $template );

Html in messages is ignored and elements changed to entities http://screencast.com/t/iqJ9Bnmaq .
What I'm doing wrong? What should I change?

Best Regards,
Lukasz Ciastek
Hey Lukasz,

Instead of inserting the contents, you should really use an app to generate contents for the stream. The reason is because inserting contents on the stream could be cached and it is problematic especially when the item no longer exists on the site or if you want to manipulate the contents of the stream.

What you have done is pretty much correct but you only need to create a method called "onPrepareStream" that manipulates the output of the stream.

To give you a better idea of how stream items should be generated, see the app /media/com_easysocial/apps/user/story/story.php
·
Thursday, 14 April 2016 23:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mark

Thank you for this hint , now it works fine .

Best Regards,
Lukasz
·
Wednesday, 27 April 2016 21:56
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Thursday, 28 April 2016 12:22
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post