Webcomponents

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.
Read More…

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">.
Read More…

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):
Read More…

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.
Read More…