The code should be included like this, preferably at the top of the page:
{{Lore Wars Trail}}
This will result in the page being added to the Lore-History-Wars and Lore-All Pages categories, and the following trail being added to the top of the page:
< Lore: History: Wars