I have created a template on my MediaWiki wiki which shortcuts linking to some frequently used book titles. One of the parameters controls whether the shortcut template points at my wiki or another one, via a switch case. I'd like to add another option which points to a non-wiki website, where a page for the book "Book Title" has a URL ending in "/book-title/".
To avoid having to specify alternate text or the full link in every individual case, I'd like to transform the title of the book (which is already passed to the template as a parameter) into lower case and replace spaces in the title with dashes, so it can just be inserted at the end of the URL.
Is this possible? How would you do that? I've tried searching the MediaWiki help pages for templates but haven't found anything that seems to do this.