Skip to content

Server Pro: Setting up templates

Pedro Lopes edited this page Feb 26, 2020 · 15 revisions

Setting up the Templates User

A single Overleaf user is responsible for publishing the curated list of templates that are visible on /templates. To set this, use the ENV var SHARELATEX_TEMPLATES_USER_ID, for instance:

--env SHARELATEX_TEMPLATES_USER_ID=56a8865231faeb5f07d69959

To obtain the user id of the user you wish to publish public templates, log in as the admin user you created when you set up Server Pro, and then go to Admin > Manage Users:

Admin - Manage Users

Then find the user by their email address and click through to their user admin page. There you will find the ID:

User ID is shown in admin panel

Publishing Templates

For each template you want to upload:

  1. Log in as the templates user.

  2. As the templates user, create a project containing the template's source code and make sure it compiles.

  3. In the editor's left-hand menu, choose Publish as Template:

    Publish as Template in the editor menu

All templates published this way from the templates user's account will be listed as templates.

Configuring Links to Templates

Templates on index page

On the templates index page, /templates, templates are nested under folders which the user puts the projects in, e.g. Journals, Reports etc. To see all templates add /all to the URL /templates/all, which can also be used as the default URL if you do not wish to use the folder for grouping.

Template links on project list page

When a user creates a new project they can be shown as linked to templates. These are set via the SHARELATEX_NEW_PROJECT_TEMPLATE_LINKS variable:

SHARELATEX_NEW_PROJECT_TEMPLATE_LINKS='[ {"name":"All Templates","url":"/templates/all"}, {"name":"All Categories","url":"/templates"}, {"name":"reports","url":"/templates/reports"}, {"name":"External","url":"https://somewhere.com/templates/reports"} ]'

ShareLaTeX Template Links

Clone this wiki locally