Quote:
Originally Posted by ElMiko
@charley - I'm getting tired of apologizing for my ignorance, but it looks like there's no end to it (my apologies and my ignorance). I don't understand what your post means, much less how to apply it to my problem. If what you're proposing would yield the results I'm looking for above, could you provide me with some additional color on how to do so?
|
chaley, not charley.
Here is a plugboard template that does something like what you want. If it isn't exactly what you want, then I leave it as an exercise for the reader to change it. This template requires no extra custom columns.
Code:
program:
# First remove any leading articles from the series name
stripped = re(field('series'), '^(A|The|An)\s+', '');
# If the series is very long, shorten it. This will be used if the series is one word.
shortened = shorten(stripped, 4, '-', 4);
# Grab the first letter of each word
initials = uppercase(re(stripped, '([^\s])[^\s]+(\s|$)', '\1'));
# compute a title with the series and series index in it. Use initials if the series has a space, otherwise use
# the shortened value. Format the series to 2 digits, and add some separation characters.
full = strcat(
switch(stripped, '.\s' , initials, shortened),
' ',
format_number(field('series_index'), '{0:0>2d}'),
' - ',
field('title')
);
# Select the full value computed above if there is a series, otherwise use only the title.
first_non_empty(
test(field('series'), full, ''),
field('title')
)
The easiest way to put the above into a plugboard is to right-click on the template box and choose 'Open template editor'. Paste the above into the upper box and press OK. Change the template the same way, using the template editor.