Why is a request sent to `/api/version` and `/login` when the page loads?

The webcomponent library needs to figure out with which version of TEI Publisher it is communicating on the server side. It thus sends two requests while initializing: one to an endpoint called /login followed by one to /api/version If the first request returns in a not found, the client can safely assume it is talking to a publisher version > 7. It thus sends a follow up to retrieve the actual version.

Can alternate content be loaded asynchronously?

If you output a lot of alternate blocks within your ODD, e.g. for places, people or terms, it can slow down rendering of the text, in particular, if the content to be shown as alternate requires further processing or is loaded from an external database system via an API. To help with this, the pb-popover webcomponent allows popup content to be loaded asynchronously. pb-popover is the default component which is output for <model behaviour="alternate">.

Changing and Debugging Webcomponents

Sometimes you may want to debug a problem related to one of TEI Publisher’s web components - or you may want to improve a component and test it directly within the TEI Publisher application context. Prerequisites In order to debug or test you need to have a local version of TEI Publisher’s web component library: on your local system you need nodejs and Node’s package manager, npm, installed if you have not already done so, clone the TEI Publisher components library change into the cloned directory and run npm install once start a local server with npm start The last step will bundle the javascript library, generate documentation and then launch a webserver (on port 8000 by default) to serve the sources.

How can I upgrade the version of webcomponents I'm using?

TEI Publisher uses a separate library for the webcomponents, which are the basic building blocks of the user interface. When you install a certain version of TEI Publisher, it will by default use the version of the webcomponent library which was current at the time it was released. You can check which version you are using by looking at the footer of the TEI Publisher entry page (or an app you generated from TEI Publisher):

Can I connect components via custom code?

There might be cases where you would like to make a component react to changes in another component, but TEI Publisher does not provide the necessary connection by default. Components in Publisher mainly communicate via signals sent into channels. You can thus always connect two components via custom code by listening to events sent by a first component and - when received - trigger another component. Let’s assume you would like certain parts of your document to be collapsed initially.