Quote:
Originally Posted by ownedbycats
Code:
program:
id = list_re($#admintags, ',', 'related:(\d+)', '\1');
strcat('<a href="', 'calibre://book-details/My%20Books/',id, '">', 'Related Book','</a>')
This looks for related:x entries in #admintags, extracts x and then uses strcat to turn it into a link.
If there's multiple ids returned by the list_re how would I create a link for each one instead of calibre://book-details/My%20Books/x,y,z?
|
Something like this, suitably altered for your columns and for the formatting you want.
Code:
program:
ids = list_re($tags, ',', '(.*)', '\1');
links = '';
for id in ids:
links = links & strcat('<a href="', 'calibre://book-details/My%20Books/',id, '">',
'Related Book','</a>', ', ')
rof;
# remove the trailing comma
substr(links, 0, -1)