How to fix joomsocial core app does not display in sitebar position?



the new version of joomsocial has some error, and someone can not wait will be angry about it. I have write a new own application, and i want it displays in sitebar-top position. Although I choose the position is sidebar-top, or sidebar-bottom it's not display. After that, if i set it is not a core app, and user can cofig by their own app, it can display it these both position. I'm really disappointed.

In the internet, question about joomsocial is hard to find an answer. I decide to find out by myself. Finally I figure out why it's not display. when we set our apps to be core, that means that their positions become sidebar-top-core or sidebar-bottom-core or content-core, but in the view.html.php of profile and in template profile.index.php don't include them. Now I will show you how to fix it.

First, go to com_community/views/profile/view.html.php, find these code, and add the three new position: 'content-core', 'sidebar-top-core', and 'sidebar-bottom-core'

01.// Split the apps into different list for different positon
02.$appsInPositions = array();
03.foreach( $appData as &$app )
04.{
05.if( !in_array($app->position, array('content','content-core', 'sidebar-top','sidebar-top-core', 'sidebar-bottom','sidebar-bottom-core')) ) {
06.$app->position = 'content';
07.}
08.$appsInPositions[$app->position][] = $app;
09.}

then, add three more item in the code below:

1.$contenHTML['content'] = '';
2.$contenHTML['sidebar-top'] = '';
3.$contenHTML['sidebar-bottom'] = '';
4.$contenHTML['content-core'] = '';
5.$contenHTML['sidebar-top-core'] = '';
6.$contenHTML['sidebar-bottom-core'] = '';

and finally, you transfer it to template by these code:

1.->set ( 'contentcore' , $contenHTML['content-core'] )
2.->set ( 'sidebarTopcore' , $contenHTML['sidebar-top-core'] )
3.->set ( 'sidebarBottomcore' , $contenHTML['sidebar-bottom-core'] )
4.->set ( 'content' , $contenHTML['content'] )
5.->set ( 'sidebarTop' , $contenHTML['sidebar-top'] )
6.->set ( 'sidebarBottom' , $contenHTML['sidebar-bottom'] )

All things in view.html.php is done.


Now, please open the com_community/template/profile.index.php, find this code

1.echo $sidebarTop; ?>

and add this

1.echo $sidebarTopcore; ?>
2.echo $sidebarTop; ?>

and like others, we get this:

1.echo $sidebarBottomcore; ?>
2.echo $sidebarBottom; ?>

and

1.echo $contentcore; ?>
2.echo $content; ?>

Now you can try again and see how it runs. Hope this helpful for you.



Responses

0 Respones to "How to fix joomsocial core app does not display in sitebar position?"

Post a Comment

 

Link Liên kết

Thông tin liên hệ

YH: huonggiangdhtn
Skype: tthuonggiang
Return to top of page Copyright © 2010 | joomla extensions jw-extension.net