What I use for sending books to my ereader is the following:
Code:
Elibrary/{author_sort:sublist(0,1,&)}/{title} - {authors:sublist(0,1,&)}
The author_sort:sublist(0,1,&) and authors:sublist(0,1,&) return the first entry in the author sort and author columns where the entries are separated by the &. So basically, the ebooks are stored in the Elibrary directory in subdirectories generated from the author_sort and with a file name generated using the ebook title and the first author name to keep path lengths under control. Since I am using a Kobo ereader, the series is both an option in displaying a list of books and a searchable field.
Please note that a quick search on Google forcing the search to site:mobileread.com found multiple hits that use pretty much the same code.
Have you read through the calibre FAQs? Read the
The calibre template language tutorial?
Without that, you might be able to copy what others write but you will not get far trying to create your own templates to take full advantage of the full capabilities of calibre.