View Single Post
Old 03-28-2018, 04:04 AM   #1
Bluez
Junior Member
Bluez began at the beginning.
 
Bluez's Avatar
 
Posts: 7
Karma: 10
Join Date: Jan 2012
Device: Windows 10 Tablet
Question Another 'Send to Disk' Question

I am trying to get my files to save to template using a hierarchy tag structure.

So, example, say I have a recipe book, it would like like this in Calibre:
Title: Favourite Recipes
Author: Various Authors
Tag:600 Technology.640 - Recipes
Fiction:Non-Fiction (Custom column)

and
Title:IT
Author:Stephen King
Tag:800 Literature
Fiction:Fiction

I am trying to save these to disk using a template to split the fiction and non-fiction.

So far, I have got the following:
Code:
program:
	middle = contains(
		field('#fiction'),
		'Non-Fiction', 
		strcat(field('tags'),"/",field('title'),' - ',field('author'),""), 
		strcat(field('author_sort'),'/',field('title'))
	);
	strcat(field('#fiction'),'/',middle)
but, it would be nice to be able to split the tags into a folder structure, eg.
- Non-Fiction\600 Technology\640 - Recipes\Favourite Recipes - Various Authors
- Fiction\King, Stephen\IT

I've tried playing around with {tags:subitems(0,1)||/} but I just cannot get it to work.

Any help would be appreciated.
Bluez is offline   Reply With Quote