By David Montoya on Monday, 01 June 2015
Posted in Technical Issues
Replies 12
Likes 0
Views 455
Votes 0
How would I go about rearranging the order the Apps are listed in the frontend? I'm not seeing a sorting option in the backend to do this. Is it dependent upon the order of installation? Don't mind doing a DB edit if I have to.
Hello David,

Ah I see. You need to manually add the sorting options inside your /components/com_easysocial/views/dashboard/view.html.php and go to line 46, you should see the following line of code:
$options = array('view' => 'dashboard', 'uid' => $this->my->id, 'key' => SOCIAL_TYPE_USER);

Replace it with,
$options = array('view' => 'dashboard', 'uid' => $this->my->id, 'key' => SOCIAL_TYPE_USER,'sort' => 'title');

The example above will sort the apps by title. You can change the "sort" parameter according to your need by following from the #__social_apps table in your database.

Hope these help.
·
Monday, 01 June 2015 13:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello David,

Correct me I'm wrong here, by right on the frontend there will option for the user to sort the apps list as you can see from the screenshot here, http://screen.stackideas.com/2015-06-01_1151.png . If not, perhaps you can provide us with the screenshot and the ordering type of the apps listing on the frontend view. Please advise.
·
Monday, 01 June 2015 11:52
·
0 Likes
·
0 Votes
·
0 Comments
·
Ah, sorry. Wrong section. I'm referring to the section on the left sidebar of a user's profile, as shown in the included mobile screen capture.
·
Monday, 01 June 2015 12:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Neat, I just learned some more PHP today! I noticed the "ordering" column is currently not being used. Will this potentially be used in future releases?
·
Wednesday, 03 June 2015 04:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, the change doesn't seem to commit no matter which column I select. I've tried clearing both site and browser cache with no visible change. Deleting the line entirely doesn't even seem to affect the site. Could it be something in my template? My PHP is weak so I don't know precicely where to start, but there is this in /themes/igda/dashboard/sidebar.apps.php:

	<div class="es-widget-body">
<?php if( $apps ){ ?>
<ul class="fd-nav fd-nav-stacked" data-dashboard-apps>
<?php foreach( $apps as $app ){ ?>
<li class="app-item<?php echo $appId == $app->id ? ' active' : '';?>"
data-id="<?php echo $app->id;?>"
data-layout="<?php echo $app->getViews( 'dashboard' )->type; ?>"
data-canvas-url="<?php echo FRoute::apps( array( 'id' => $app->getAlias() , 'layout' => 'canvas' ) );?>"
data-embed-url="<?php echo FRoute::dashboard( array( 'appId' => $app->getAlias() ) );?>"
data-title="<?php echo $this->html( 'string.escape' , $user->getName() ) . ' - ' . $app->get( 'title' ); ?>"
data-dashboardSidebar-menu
data-dashboardApps-item>
<a href="javascript:void(0);">
<img src="<?php echo $app->getIcon();?>" class="app-icon-small mr-5" /> <?php echo $app->getAppTitle(); ?>
<div class="label label-notification pull-right mr-10"></div>
</a>
</li>
<?php } ?>
</ul>

<?php } else { ?>
<div class="fd-small">
<?php echo JText::_( 'COM_EASYSOCIAL_DASHBOARD_NO_APPS_INSTALLED_YET' ); ?>
</div>
<?php } ?>
</div>
·
Wednesday, 03 June 2015 05:05
·
0 Likes
·
0 Votes
·
0 Comments
·
*cries* The forum won't let me post tags, even in a code bracket.
Particular code of note on line 28: foreach( $apps as $app

My template is a copy of Wireframe and this file should be unmodded, so line number should be correct.

Currently I believe it's loading by ID, but I don't know if this definition is implicit or explicit. Likely implicit given the sort method provided didn't work in my case.


*edit*

Odd, now the code is displaying properly for me. Oi, browsers.

Also, I noticed an inconsistency between viewing the dashboard and my personal profile:



"Apps" and "Applications" could likely be edited via a language key, but the listing of apps is an odd one.

*edit 2*

Ah-ha! Your edit DOES work, but only on the dashboard. It doesn't affect individual profiles. I'd like it to affect across everything.

*edit 3*

Heh, scratch that, just found it here with the same line edit:

/components/com_easysocial/views/profile/view.html.php

Now to just figure out that weird listing between dashboard and profile...
·
Wednesday, 03 June 2015 05:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello David,

Hm, the change doesn't seem to commit no matter which column I select. I've tried clearing both site and browser cache with no visible change. Deleting the line entirely doesn't even seem to affect the site. Could it be something in my template?

That's probably because of cache on your joomla site that causing the change to not take effect immediately. You need to manually clear the cache after each modifications in order for the change to take effect.

Now to just figure out that weird listing between dashboard and profile...

The ordering can be configure from the file that you have mentioned in your previous reply, /components/com_easysocial/views/profile/view.html.php at line 252. Check the table #__social_apps for your references on the ordering.
·
Wednesday, 03 June 2015 11:38
·
0 Likes
·
0 Votes
·
0 Comments
·
I got the ordering sorted out, but any idea why I only see 3 apps in dashboard and all 5 on profile? Is there a flag on each app in the DB that would determine this, or some kind of XML setting?
·
Wednesday, 03 June 2015 11:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi David Montoya,

Sorry for late reply to this,

It actually depend on the app itself, because not all the app display on dashboard.

Check my screenshot below.

Hope this help.
·
Wednesday, 03 June 2015 23:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm... I'm not 100% sure that's correct. Opening /media/com_easysocial/apps/user/calendar/themes/default, it has the following:

It doesn't have a folder for Dashboard or Profile, but the link definitely shows up in both.
·
Friday, 05 June 2015 03:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Found it!! It'd determined under _social_apps_view table. It needs to have the ID of the app in question and have it, under view, set to dashboard.

There by chance a way of setting this somewhere else, or is just editing the table the easiest way?

At any rate, OCD: managed
*laughs*
·
Friday, 05 June 2015 04:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi David,

I am really sorry for the delay of this reply as it is a weekend for us here.

Yes, that do not easy way to do this, unless you create folder for Dashboard or Profile in your own apps, so when you install the xml file that time, it will store in database. You can download sample app here.

Hope this help.
·
Saturday, 06 June 2015 14:39
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post