User:Willscrlt/UBX/Musicbox/How it works

''This is one of several templates and pages that work together to support and document the template. The main Musicbox documenation explains how to add a Musicbox to your user page, and the Musicbox catalog contains examples of every standard Genre Musicbox.''

The following highly technical information explains how the Musicbox templates work for those that are interested. For everyone else, you may safely ignore this page. The main Musicbox documenation explains how to add a Musicbox to your user page, and the Musicbox catalog contains examples of every standard Genre Musicbox.

Example of a generic Musicbox&#58;

Musicbox template files

 * User:Willscrlt/UBX/Musicbox is the main template that starts the "magic"
 * It determines if the request is a Genre, Artist, Album, Song Title, Custom, or Unique Musicbox
 * Genre Musicboxes are passed to User:Willscrlt/UBX/Musicbox/Genre for additional processing
 * Artist, Album, Song Title, and Custom Musicboxes are passed to User:Willscrlt/UBX/Musicbox/Special for processing
 * Unique Musicboxes are passed directly to User:Willscrlt/UBX/Musicbox/Basic for display
 * User:Willscrlt/UBX/Musicbox/Genre determines the selected Genre
 * Large Genres (Rock/Pop and Jazz) are passed to sub-parsers (User:Willscrlt/UBX/Musicbox/Genre/Rock-Pop and User:Willscrlt/UBX/Musicbox/Genre/Jazz)
 * The other Genres are directly processed and passed to User:Willscrlt/UBX/Musicbox/Basic for display
 * Subparsers directly process large genres and then pass to User:Willscrlt/UBX/Musicbox/Basic
 * User:Willscrlt/UBX/Musicbox/Basic displays the information passed to it from the preceding parser templates


 * In symbolic form this would be represented as:
 * User:Willscrlt/UBX/Musicbox → Musicbox →
 * → Basic for Unique Musicboxes
 * → Genre → Basic for most Genre Musicboxes
 * → Genre → Jazz → Basic for Jazz Genre Musicboxes
 * → Genre → Rock-Pop → Basic for Rock or Pop Genre Musicboxes
 * → Special → Basic for other standard Musicboxes (Artist, etc.)

Everything could all be handled inside a single, enourmous template, but 1) it would be a nightmare to maintain, 2) it would discourage contributions from people wanting to add new Styles and sub-Types of music or updating wikilinks, 3) the performance would probably be slower and a bigger impact on the servers.

Musicbox categories
The categories populated by Musicbox's standard 20 Genres are located under Wikipedians by music genre:


 * 0. n/a — Category:Wikipedians interested in music
 * 1. kid — Category:Wikipedians who listen to childrens music
 * 2. rck — Category:Wikipedians who listen to rock music
 * 3. ltn — Category:Wikipedians who listen to Latin American music
 * 4. pop — Category:Wikipedians who listen to pop music
 * 5. cnt — Category:Wikipedians who listen to country music
 * 6. adc — Category:Wikipedians who listen to adult contemporary music
 * 7. elc — Category:Wikipedians who listen to electronic music
 * 8. hip — Category:Wikipedians who listen to hip hop music
 * 9. wld — Category:Wikipedians who listen to world music
 * 10. hol — Category:Wikipedians who listen to holiday music


 * 11. new — Category:Wikipedians who listen to new age music
 * 12. jzz — Category:Wikipedians who listen to jazz
 * 13. cla — Category:Wikipedians who listen to classical music
 * 14. blu — Category:Wikipedians who listen to blues
 * 15. rnb — Category:Wikipedians who listen to R&B
 * 16. spi — Category:Wikipedians who listen to spiritual music
 * 17. flk — Category:Wikipedians who listen to folk music
 * 18. n/a — Category:Wikipedians interested in music
 * 19. alt — Category:Wikipedians who listen to alternative music
 * 20. snd — Category:Wikipedians who listen to soundtracks or showtunes
 * 21. oth — Category:Wikipedians interested in music


 * #0 is used only if the supplied attributes are unrecognized. #18 is used for artists, albums, and song titles, not for genres.

Additionally, Styles of music and sub-Types are categorized under the most specific category available if they pre-exist. In other words, if you select "big band" as a Style of Jazz you like, and if Category:Wikipedians who listen to big band music already exists (which it did at the time this documenation was written), then you will be added to that category instead of the more generic Category:Wikipedians who listen to jazz. However, to avoid categorizing users in deleted categories, this subcategorizing only is done where a category already exists and the category name matches Musicbox's terminology. An example that would not work is a sub-Type of "reggae music" when the category is named Category:Wikipedians who listen to reggae (the word "music" is not part of the category name, but is in Musicbox; therefore, they do not match and you would not be added to the reggae category but would be added to the generic world music category instead).

This automatic category matching for Styles and sub-Types can be tweaked within the template to fix a category mismatch like the one in the reggae example. It involves editing the appropriate Musicbox parser template and adding a category override attribute.

Musicbox documenation files

 * User:Willscrlt/UBX/Musicbox/doc — The main documentation for Musicbox
 * User:Willscrlt/UBX/Musicbox/How it works — This page; technical details about Musicbox
 * User:Willscrlt/UBX/Musicbox/Catalog — The contents page for the Musicbox catalog of examples and recognized Genres, Styles, and sub-Types displayed on the following subpages:


 * 1. User:Willscrlt/UBX/Musicbox/Catalog/Children's
 * 2. User:Willscrlt/UBX/Musicbox/Catalog/Rock
 * 3. User:Willscrlt/UBX/Musicbox/Catalog/Latin American
 * 4. User:Willscrlt/UBX/Musicbox/Catalog/Pop
 * 5. User:Willscrlt/UBX/Musicbox/Catalog/Country
 * 6. User:Willscrlt/UBX/Musicbox/Catalog/Adult Contemporary
 * 7. User:Willscrlt/UBX/Musicbox/Catalog/Electronic and Dance
 * 8. User:Willscrlt/UBX/Musicbox/Catalog/Hip Hop, Urban, and Dance
 * 9. User:Willscrlt/UBX/Musicbox/Catalog/World and International
 * 10. User:Willscrlt/UBX/Musicbox/Catalog/Holiday


 * 11. User:Willscrlt/UBX/Musicbox/Catalog/New Age
 * 12. User:Willscrlt/UBX/Musicbox/Catalog/Jazz
 * 13. User:Willscrlt/UBX/Musicbox/Catalog/Classical
 * 14. User:Willscrlt/UBX/Musicbox/Catalog/Blues
 * 15. User:Willscrlt/UBX/Musicbox/Catalog/Rhythm and Blues
 * 16. User:Willscrlt/UBX/Musicbox/Catalog/Spiritual and Religious
 * 17. User:Willscrlt/UBX/Musicbox/Catalog/Folk and Traditional
 * 19. User:Willscrlt/UBX/Musicbox/Catalog/Alternative, Inde, and Punk
 * 20. User:Willscrlt/UBX/Musicbox/Catalog/Soundtracks and Showtunes
 * 21. User:Willscrlt/UBX/Musicbox/Catalog/Other music