Sort the GENRE list

Strappado
Strappado
Offline
0
Hi there I have struggled all day trying to sort the genre list alphabetical in the drop down select list. Is there a easy and fast way to fix this?.. I have almost given up.

All help appericated.
Responses (15)
  • Accepted Answer

    Saturday, December 03 2011, 11:49 AM - #Permalink
    0
    hello

    what's your Music Collection order ID? you don't appear on our system as a customer...

    thanks!

    GErmi
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, January 14 2012, 07:30 PM - #Permalink
    0
    Has a mod to address this been released? With so many other filters automatically sorting alphabetically you would think genres would as well. Can someone provide the file names and code to make this change, please?

    *Yes, I have a paid license.

    Thank you for any assistance.

    [edit] Then again, the tags feature is rather useless for my site so perhaps I'll edit the language files and change "tags" to "genres" then code out the genre sections from the album/artist edit pages. Considering I can remove genres from the search options and that the tags field can be set for multi-select, this may work better anyway. Problem solved!
    The reply is currently minimized Show
  • Accepted Answer

    Monday, January 16 2012, 03:58 PM - #Permalink
    0
    ok! :) so no need for the code, then? :)
    The reply is currently minimized Show
  • Accepted Answer

    Monday, January 16 2012, 04:25 PM - #Permalink
    0
    The sorting code for genres would be much better but my solution works for now. Using the genres field would be better though because the charts modules allow filtering per genre.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, June 21 2012, 03:26 AM - #Permalink
    0
    How would we sort the Genre list to be alphabetical? We have not figured out a solution either.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, June 21 2012, 10:36 AM - #Permalink
    0
    in which page?
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, June 21 2012, 08:01 PM - #Permalink
    0
    In the main area itself and on all pages. For example we wanted the genre list to show alphabetically both in the front end of Joomla and in admin side. This would make it easier for users when entering new artists/material or just searching by genre. We wanted to find a way to sort the genre listing alphabetically to make it easier for users. when a user selects it either in the front or even when adding new material they would be able to select a genre from the list that would be sorted alphabetically.

    hopefully that answers your question. Thanks for your time.

    Degarrin
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 25 2012, 10:11 AM - #Permalink
    0
    ok, I see. well the thing is that you need to modify a few MySQL queries in a few files. are you comfortable with modifying MySQL code?
    for instance, in /models/artist.php line 483 you have to add the statement

    ORDER BY genre_name

    to have it sorted alphabetically. do you know what I mean?
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, June 26 2012, 03:15 AM - #Permalink
    0
    So using your example of /models/artist.php line 483, the SQL would go from this:

    ' SELECT * FROM #__muscol_genres '.
    ' WHERE parents = "0" '


    to this:

    ' SELECT * FROM #__muscol_genres '.
    ' WHERE parents = "0" '
    ' ORDER BY genre_name '


    Is that correct? I am pretty new to SQL, but if you tell me which files I need to update, then yes, I am comfortable enough to go in and modify the SQL.

    Thank You
    Degarrin
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, June 26 2012, 02:00 PM - #Permalink
    0
    yes! that's correct. basically you need to do that in artists.php, albums.php and song.php
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, August 14 2012, 11:04 AM - #Permalink
    0
    Actually, you left out the period at the end of the second line. Should be

    ' SELECT * FROM #__muscol_genres '.
    ' WHERE parents = "0" '.
    ' ORDER BY genre_name '

    Also, in front-end files I believe you should do this to the helpers.php file not song.php. In the back-end (admin side), the files will be the same as Germi provided.



    To also sort sub-genres, edit the same files by changing:

    ' OR parents LIKE "'.$genre->id.'" ) '

    to:

    ' OR parents LIKE "'.$genre->id.'" ) '.
    ' ORDER BY genre_name '
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, August 15 2012, 12:58 AM - #Permalink
    0
    Ah, thank you both. I got pulled off to work on something else, so I haven't had a chance to focus back on this yet, but when I do this information will make things much easier. :cheer:
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 15 2016, 07:04 PM - #Permalink
    0
    so I am working on the same thing I have found the line in artists.php and changed it, and its alphabetical now.
    But I dont have the albums.php just album.php withou this line in it.. and also song.php doesn't have that line..?
    Dit the location chanced in the last MC?

    TIA

    Appie
    • Germinal Camps
      more than a month ago
      sorry.. which is the question? this thread is 4 years old...
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, June 19 2016, 09:22 AM - #Permalink
    0
    [b]sorry.. which is the question? this thread is 4 years old...


    I want to get my genre's alphabetical sorted, but cant find the file albums.php which I need to chance to get my genre sorted.
    And the file song.php doesnt have the line:

    ' SELECT * FROM #__muscol_genres '.
    ' WHERE parents = "0" '.
    ' ORDER BY genre_name '

    So maybe because its indeed an old thread the files got chanced or replaced in later updates from MC?

    Should I make a new topic for it?

    Appie
    • Germinal Camps
      more than a month ago
      this can be found in the file helpers.php, the function is called getGenresData()
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 20 2016, 05:36 PM - #Permalink
    0
    Thanks solved it by editing the helpers.php..

    Appie
    The reply is currently minimized Show
Your Reply