Welcome, Guest
Username Password: Remember me

Consistent order of media links
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Consistent order of media links

Consistent order of media links 22 Apr 2009 00:23 #799

I decided to make a small customization to my code for both the component and the module, so that if there are multiple media links in each study (which is true for us), that they show up in the same order each time. (Originally they appeared in the order they were uploaded, which in our case is pretty random and looked sloppy.) Since I already did the homework for the modification, if you like it, it should be easy to implement in your upcoming version.

At least in my case I'm happy with using the order of the mime_type ID ascending - that puts the most commonly used audio and video types before text-based types and more obscure things. To do that, it's really simple (these instructions are based on version 6.0.11). In com_biblestudy\views\studieslist\tmpl\default.php on line 1084, you would change:
. ' WHERE #__bsms_mediafiles.study_id = '.$row->id.' AND #__bsms_mediafiles.published = 1 ORDER BY ordering ASC';

to add a secondary ordering criteria:
. ' WHERE #__bsms_mediafiles.study_id = '.$row->id.' AND #__bsms_mediafiles.published = 1 ORDER BY ordering ASC, #__bsms_mediafiles.mime_type ASC';

And for the module, you'd just do the same thing in mod_biblestudy\tmpl\_study.php on line 683. You could do the same thing in the studies details view and maybe other places, but in my case these were the two that were bothering me.

I know that the line numbers and such will be different in the new version you're working on, but I'm sure you can figure out where the key spots are.

It looks beautiful! I recommend it as an improvement.
Joomla 1.5.10, Bible Study 6.0.11

Re:Consistent order of media links 22 Apr 2009 08:04 #801

  • Tom
  • OFFLINE
  • Administrator
  • Posts: 860
Wonderful addition. I added it to the new mediatable function (the common code is now in separate functions starting in version 6.0.12). Looks very good that way.

Tom
"You shall know the truth and the truth shall set you free." JC
  • Page:
  • 1
Time to create page: 0.69 seconds