![]() |
#1 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Feb 2020
Device: none
|
Short title template function
Hi everyone, sorry if this has already been answered. I have quite a lot of academic titles in my library and they have really long titles. I want to shorten the titles so they will fit on the covers that I generate for using the generate cover plugin.
I can use {title:shorten(50,,0)} to only give me the first 50 characters of each title, but it's not very aesthetically pleasing - because it cuts off the end of words most of the time. Is there a function I can use to return the first n words of a title (based on separation by spaces) or automatically returns everything before the colon that nearly always sneaks into academic titles? |
![]() |
![]() |
![]() |
#2 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,358
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
{title:sublist(0,4, )} Quote:
Code:
{title:sublist(0,1,:)} Code:
{title:'sublist(sublist($, 0, 1, ':'), 0, 4, ' ')'} |
||
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 9
Karma: 10
Join Date: Feb 2020
Device: none
|
Excellent! Thanks
|
![]() |
![]() |
![]() |
Tags |
custom columns, custom covers, template editor, template language |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Contribution: DDC Headings template function | isra00 | Library Management | 0 | 02-28-2022 01:14 PM |
BuiltinAdd template language function | DyckBook | Editor | 4 | 10-19-2021 04:21 PM |
Using built-in template functions in a custom template function | ilovejedd | Library Management | 4 | 01-28-2018 12:20 PM |
Problem with contains function in save template | MicaOlaAdams | Calibre | 5 | 10-21-2016 10:25 AM |
how to use re() function in Template Program Mode? | msciwoj | Library Management | 3 | 07-07-2016 03:55 PM |