Template functions

Template functions for oc8, wait until stable branch is merged

ref https://github.com/owncloud/core/pull/10947