Quote:
Originally Posted by ownedbycats
Also, a related question:
I have two identifiers, ao3 and ffnet. I'd like to change the order their links appear depending on the publisher.
Here's what I have:
Code:
program:
list_join(
', ',
## trimmed out other lines for length
switch_if(
$publisher=='Archive of Our Own', urls_from_identifiers('ao3:' & select($identifiers, 'ao3'), 1),
$publisher=='FanFiction.net', urls_from_identifiers('ffnet:' & select($identifiers, 'ffnet'), 1),
''
), ',',
switch_if(
!$publisher=='Archive of Our Own', urls_from_identifiers('ao3:' & select($identifiers, 'ao3'), 1),
!$publisher=='FanFiction.net', urls_from_identifiers('ffnet:' & select($identifiers, 'ffnet'), 1),
''
), ',',
)
This gets the result I want:
- if both ids are available, both are listed
- If publisher is Archive of Our Own, the ao3 link appears first.
- If publisher is FanFiction.net, the ffnet link appears first.
But is this the best way to do this?
|
The template I posted doesn't give you what you want. It ignores the ordering request. What you did originally is a reasonable solution.