Template help

Any trouble you encounter with the Pedias, here's the place to ask for help.
Post Reply
TylerInHiFi
Bruji Friend
Bruji Friend
Posts: 11
Joined: Tue Dec 15, 2009 6:45 am

Template help

Post by TylerInHiFi »

I'm trying to modify FanyIndex to better suit what information I need displayed and I noticed something a bit odd. In CDPedia, I can add something in the Sort Artist field, it will automatically sort using that information without having it displayed. However, when exporting to HTML, this information is lost. I'd like to be able to have the name displayed, but sorted alternately. Example: displayed is "Elvis Presley", but it's sorted as "Presley, Elvis". I attempted doing this with an IF function, but I didn't quite get the result I wanted. Is there any way to make this happen? Right now what I've got for code is:

Code: Select all

<td><div class="nw">[IFsortArtist key:sortArtist ENDsortArtist]</div><div class="nw">[key:artist]</div></td>
That works for sorting order, but it displays "[IFsortArtist key:sortArtist ENDsortArtist]" above every single line. I had it without the second div class in the middle and it displayed the same thing but at the beginning of each line. The weird thing is that doesn't display the actual sort artist data on the artists that do have an alternate sorting order, just the code.

Anybody know how to make it do what I want?
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Template help

Post by Conor »

The code is HTML open/close comments for the "IF", "ENDIF" bits and brackets for the "key" bit. E.g.

Code: Select all

<td><div class="nw"><!--IFsortArtist [key:sortArtist] ENDIFsortArtist--></div><div class="nw">[key:artist]</div></td>
TylerInHiFi
Bruji Friend
Bruji Friend
Posts: 11
Joined: Tue Dec 15, 2009 6:45 am

Re: Template help

Post by TylerInHiFi »

Code: Select all

<td><div class="nw"><!--IFsortArtist [key:sortArtist] ENDIFsortArtist--></div><div class="nw">[key:artist]</div></td>
Gives the result of:
"Presley, Elvis ENDIFsortArtist-->
Elvis Presley"

in the Artist field and groups all names with alternate sort orders to the top of the list.

Code: Select all

<td><div class="nw"><!--IFsortArtist [key:sortArtist] ENDIFsortArtist-->[key:artist]</div></td>
Displays properly but drops that same group to the very bottom of the list.

I'm using FancyIndex and the only thing I've modified is the table header section (to display Artist, Title, Format, Comments, Release, UPC instead of the default) and the table fill section accordingly. I'm not sure what else I could change to make this happen aside from including a "Sort Artist" for every single artist. Which seems a bit like using a shotgun to open a tin can.
User avatar
Conor
Top Dog
Posts: 5346
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Template help

Post by Conor »

Sorry the ending code is just "END". Would be:

Code: Select all

<td><div class="nw"><!--IFsortArtist [key:sortArtist] ENDsortArtist--></div><div class="nw">[key:artist]</div></td>
Not sure about the sorting as I haven't looked into the template, but by adding the sortArtist field first it should fix the sorting.

It might be another option to look into writing a sort function along the lines included in the .js files that are in the images folder for the template that sorts by last name the regular artist field. Although this would require JavaScript knowledge.
Post Reply