Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-18-2012, 01:34 PM   #1
sifuhall
Junior Member
sifuhall began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2012
Device: Kindle Fire
Help with Custom Column

I'm trying to create a custom column that contains the first (and only the first) entry in the tags field.

I've tried using this as the template:
Code:
{tags:subitems(0,1)}
But I get the full tag.

I also tried:
Code:
{list_item(tags, 0, ',') }
But that doesn't work either.

What am I doing wrong?
sifuhall is offline   Reply With Quote
Old 06-18-2012, 05:02 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Subitems creates a list of hierarchical subitems. It does not isolate one entry in a list of entries. To isolate list entries, use list_item or sublist.

I think the following does what you are looking for.
Code:
{tags:'list_item($, 0, ',')'}
Note that the tags stored in the database are almost certainly not in alphabetical order, so the first tag may not be what you think it is. If you want the first item in the sorted list, use
Code:
{tags:'list_item(list_sort($, '0', ','), 0, ',')'}
BTW: your second attempt would work if you used
Code:
program: list_item(field('tags'), 0, ',')
chaley is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom date column from two state column Dopedangel Library Management 7 01-03-2012 08:20 AM
help with custom column Noughty Library Management 4 10-15-2011 05:31 AM
Can custom book data be displayed in a custom column? kiwidude Development 9 03-02-2011 05:35 AM
Need help with this custom Column. Rie142 Library Management 2 02-20-2011 09:51 AM
custom column i need a little help shinken Calibre 3 09-15-2010 03:41 AM


All times are GMT -4. The time now is 02:09 AM.


MobileRead.com is a privately owned, operated and funded community.