Several people are doing interesting and useful things with templates, plugboards, and composite fields. This thread is a place to put the information.
Plugboards can be accessed from Preferences->Metadata plugboards
You can create your own custom columns from Preferences->Add your own column
A useful tutorial on the calibre template language is to be found
here.
Kindle/Kobo
Metadata: Show series - series Index - Title as Title (Kindle/Kobo) (economix)
Spoiler:
I have been playing around with the Metadata plugboards to get the titles on a Kindle 3 to show series information. I used the following template:
format: mobi
device: kindle2
template:
{series}{series_index:0>2s| - | - }{title}
destination: title
This works very nicely for books that are part of a series e.g.:
Quote:
A Song of Ice & Fire - 01 - A Game of Thrones
A Song of Ice & Fire - 02 - A Clash of Kings
A Song of Ice & Fire - 03 - A Storm of Swords
A Song of Ice & Fire - 04 - A Feast for Crows
|
Metadata: Show series [series index] - title as title (Kindle) (Scott Nielsen)
Metadata: Show author name as Initial and Surname (Kindle) (inspired by brewjono)
Reading/read status custom column (Kindle) (pchrist7, w/ideas from beckywc):
Filename (Save Templates)
Filename: author sort/series/title - version (WinCE/Mobile (Mobipocket))(sweetpea)
Filename: Create file paths grouping authors into [A - D]-like categories (WinCE/Mobile (Mobipocket)) (Sweetpea)
Spoiler:
{author_sort:switch(^[A-D],[A - D],^[E-J],[E - J],^[K-O],[K - O],^[P-T],[P - T],^[U-Z],[U - Z],[Other])}
Filename: Create path based on series index (sweetpea, inspired by Arco Witter)
Spoiler:
If you have a lot of books in a series, and want them in a folder hierarchy like series/00-09/author/title, series/10-19/author/title. You want just author/title if there is no series.
Create a composite column called (for example) #s_index.
Column: #s_dex
Template: {series_index:0>2s}
Save template:
Code:
{series}{#s_dex:switch(0.,00-09,1.,10-19,2.,20-29,3.,30-39,4.,40-49,5.,50-59,6.,60-69,7.,70-79,8.,80-89,9.,90-99,)|/|/}{author}/{title}
Sony Metadata
Metadata: Show author and title for title (Sony) (Sweetpea)
Metadata: Show title [series [series index]] as title, limiting series to 8 letters (Sony) (chaley)
Spoiler:
Put 8 characters of the series plus the series index at the end of the title. The plugboard is:
Code:
format: device-db
device: PRS505
template: {title}{series:<.8s| [|}{series_index:| [|]]}
destination: title
Metadata: Show series - series index - title, with series as initials (Sony) (inspired by speakingtohe)
Metadata: Given a yes/no 'Read' custom column, have the collections display Read, Reading, Unread (Sony) (sweetpea)
Apple iDevice Metadata
Metadata: Several examples (Apple devices) (GRiker)
See this post.
General Metadata
Metadata: Put series into the title, using either initials or a shortened form. Strip leading articles from the series name (any) (inspired by Gary_M_Mugford)
Spoiler:
The solution requires creating three composite columns. The first column is used to remove the leading articles. The second is used to compute the 'shorten' form. The third is to compute the 'initials' form. Once you have these columns, the plugboard selects between them. You can hide any or all of the three columns on the library view.
First column:
Code:
Name: #stripped_series. Template: {series:re(^(A|The|An)\s+,)||}
Second column (the shortened form):
Code:
Name: #shortened. Template: {#stripped_series:shorten(4,-,4)}
Third column (the initials form):
Code:
Name: #initials. Template: {#stripped_series:re([\s]?([^\s])[^\s]+(\s|$),\1)}
Plugboard expression:
Code:
Template:{#stripped_series:lookup(.\s,#initials,.,#shortened,series)}{series_index:0>2s| [|] }{title}
Destination field: title
This set of fields and plugboard produces:
Series: The Lord of the Rings
Series index: 2
Title: The Two Towers
Output: LotR [02] The Two Towers
Series: Dahak
Series index: 1
Title: Mutineers Moon
Output: Dahak [01] Mutineers Moon
Series: Berserkers
Series Index: 4
Title: Berserker Throne
Output: Bers-kers [04] Berserker Throne
Series: Meg Langslow Mysteries
Series Index: 3
Title: Revenge of the Wrought-Iron Flamingos
Output: MLM [03] Revenge of the Wrought-Iron Flamingos
Common composite custom columns
All the recipes below require the creation of a custom column of type 'Column built from other columns', called a composite column. Creation instructions are under the spoiler.
Display the ISBN. Template: {isbn}
Display the formats for a book. Template: {formats}
Display Yes if the book has an EPUB format. Template:{formats:contains(EPUB, Yes,)}
Display the author sort. Template: {author_sort}
Display the title sort. Template: {title_sort}