OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?
Category order when adding media? (0 viewing) 

MediaLibary Component Support

Go to bottom Favoured: 0

Category order when adding media?

ldv (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Category order when adding media? 12 Years, 6 Months ago
Karma: 0  
I have a site where I have over 100 categories and subcategories combined. When I go to add media, I have to scroll through ALL of them, in a completely random order. How can I make them appear in alphabetical order, or in a tree structure as they do in the search?
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8230
graph
User Offline Click here to see the profile of this user
Re:Category order when adding media? 12 Years, 6 Months ago
Karma: 101  
In Media Library at time add new media - categories ordered - exactly like you order them at time create categories - in Categories manager
With that you can see real categories structure - at addind new media time.

For change that you need go to file
{yours site}/administrator/components/com_medialibrary/admin.medialibrary.php

and in it find code like :

$query = "SELECT id ,name, parent_id as parent"
. "n FROM #__categories"
. "n WHERE section='com_medialibrary'"
. "n AND published > 0"
. "n ORDER BY parent_id, ordering" ;


and change it to as you wish

thanks,
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
ldv (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Category order when adding media? 12 Years, 4 Months ago
Karma: 0  
I have tried many different variable names for ordering, but none of them seem to work. What is the variable name for sorting by category TITLE? I'd like to sort by title, but I can't seem to find what you have called the title variable. Every time I try to change it, it still just keeps sorting by "ID" instead.
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8230
graph
User Offline Click here to see the profile of this user
Re:Category order when adding media? 12 Years, 4 Months ago
Karma: 101  
Hi,

sorry ordering what ?

In categories - I show how we do select.

If Media - that fill other!

and where ordering for you need change ? that fontend or admin part ?

Thanks,
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
ldv (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
Re:Category order when adding media? 12 Years, 4 Months ago
Karma: 0  
The problem is in the admin backend, when I go to the MediaLibrary component, then "Media" > "New." When I'm adding a video, and selecting a category to add it to, my categories in the dropdown are listed in the order: "Superheroes, Animation, Vampires,..." etc., instead of alphabetical order. I see that they're listed in the order I added the categories, but I'd like to list them alphabetically by title: "Africa, Animation, Artists, British," etc. I will have over 100 categories, so need to be able to find them easily. I've tried to change the code you showed me, but the order stays the same in the backend. I've attached photo.
Logged Logged
Last Edit: 2011/11/16 20:07 By ldv.
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8230
graph
User Offline Click here to see the profile of this user
Re:Category order when adding media? 12 Years, 4 Months ago
Karma: 101  
Hello,

For order Media categories in Media Library - at time edit or create new media like book, video, game or music

You need in file:
{yours site}/administrator/components/com_medialibrary/admin.medialibrary.php

find functions:
editing_book ; editing_video; editing_music; editing_game

and in every so function replace code:
Code:

  $query = "SELECT  id ,name, parent_id as parent"
     . "n FROM #__categories"
     . "n WHERE section='com_medialibrary'"
     . "n AND published > 0"
     . "n ORDER BY parent_id, ordering" ;



to code:
Code:

  $query = "SELECT  id ,name, parent_id as parent"
     . "n FROM #__categories"
     . "n WHERE section='com_medialibrary'"
     . "n AND published > 0"
     . "n ORDER BY name" ;




Before any changes - please backup files

Thanks,
Ordasoft team
Logged Logged
The administrator has disabled public write access.
Go to top
»