0

I’ve an eXistDB app set up with templating. Is it possible to make HTML Files outside of the app (in a different collection) use the same templating mechanisms to get the page header and styles and so on from my app?

Thank you!

karkraeg
  • 445
  • 4
  • 18

1 Answers1

0

Yes, you can use eXist's HTML templating feature in any of your collections, but as the set up section of the documentation states, you will need to ensure the following modules responsible for handling the templating functionality are in the new collection:

  • controller.xql
  • modules/view.xql

For simplicity's sake, you could just copy these files from your original collection into the target collection, and they should work identically.

Joe Wicentowski
  • 5,159
  • 16
  • 26
  • But I can't use the templating infrastructure from one collection (say `/db/apps/myapp`) with HTML Documents in another collection (`/db/apps/otherapp`)? – karkraeg Apr 16 '19 at 14:52
  • No, because without a controller.xql file in the (ancestor-or-self) collection hierarchy requested by the URL, the handlers for templating will not be called. – Joe Wicentowski Apr 16 '19 at 15:25