Quote:
Originally Posted by Comfy.n
|
To be clear, you aren't testing the new book details custom column URL feature. Instead you are testing the long-existing L&F / Book details custom authors rule.
The problem is that the L&F / Book details dialog *knows* it is for authors only, and in fact doesn't even have the rest of the metadata. Historically, because L&F / Book details knows it is for authors, to simplify things for the expected use case the author is URL-encoded before it gets to the template. Thas is why the template
Code:
https://www.wikipedia.org/w/index.php?search={author}
works there; the interpolated 'author' is already URL-encoded. This can't be changed without breaking existing custom author links. Note also that you can't make decisions in the template such as "if author == 'John Doe' then" because the author will already be encoded as 'John+Doe'.
If you want to use make_url_extended() there then you must use the variant where you control whether the query value is encoded (again) during URL construction.
Code:
program:
qs = query_string('search', $author, 2);
make_url_extended('https', 'wikepedia.com', '/w/index.php', qs)
You will see in the L&F / Book details template tester result that the author, Niccolò Machiavelli, is URL-encoded. In the normal template tester, where the original metadata is being used, it won't be URL-encoded.
This discrepency is why the new custom column link generation feature offers the item value unencoded, URL-encoded with '+' for spaces, and URL-encoded with %20 for spaces.
Bottom line: you can't use the same template in L&F/ BD as you use in the new custom column web link feature.