Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
If you have many links pointing to the same URL, in printer-friendly page each link shows a different footnote number and the URL gets duplicated in the list at the bottom of the page.
Just modify the function print_friendly_urls
to search for the URL before appending to the array:
function print_friendly_urls($url = 0) {
static $urls = array();
if ($url) {
$url_idx = array_search($url, $urls);
if ($url_idx) {
return ($url_idx + 1);
} else {
$urls[] = $url;
return count($urls);
}
}
return $urls;
}
jpereza
Comments
Comment #1
jcnventura CreditAttribution: jcnventura commentedHello,
Your suggestion works perfectly.
Thanks!
João
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.