I’m basically automatically pulling, from a separate directory, a manual PDF whose filename matches the pageid of the current page. It works so far, but only if the corresponding PDF is present. If it’s not, or misspelled, nearly the entire page fails to load. Can someone help me make this display a broken link or something more useful than simply breaking the page? Also if I’m just doing this in a weird way that would be good to know
The $manualfilename variable is now using $page->slug() instead of $page->pageid() and I used a Kirby helper e() to run an if/else statement that echo’s the results. You may also wish to wrap the whole url in the e() helper (and remove the false string) instead, so the link will only show up if the file exists.