diff --git a/data/doc/documentation.xml b/data/doc/documentation.xml index fbd9e144..17756d7b 100644 --- a/data/doc/documentation.xml +++ b/data/doc/documentation.xml @@ -3396,14 +3396,14 @@ declare function pmf:code($config as map(*), $node as element(), $class as xs:st A IIIF presentation manifest is a JSON structure describing a collection of resources. pb-tify expects to load a single manifest and takes all necessary information from there. If you have an external image database, it may already be able to deliver a manifest. If not, you can easily generate one on the fly by creating an API endpoint. This approach is demonstrated by the Shakespeare example in TEI Publisher, which proceeds as follows: - modules/custom-api.json defines an endpoint /api/iiif/{path} and the corresponding handler in modules/iiif.xql, function iiif:manifest. The path parameter is expected to point to an existing TEI document. + modules/custom-api.json defines an endpoint /api/iiif/{path} and the corresponding handler in modules/iiif.xql, function iiif:manifest. The path parameter is expected to point to an existing TEI document. The XQuery code in function iiif:canvases walks through each pb element in the TEI to output a IIIF canvas for the linked image. Function iiif:manifest adds additional metadata fields like title, language or download links to the manifest. - templates/pages/shakespeare.html includes the pb-tify web component, pointing it to the custom API endpoint: + templates/pages/shakespeare.html includes the pb-tify web component, pointing it to the custom API endpoint: ]]> @@ -3724,6 +3724,11 @@ declare function pmf:code($config as map(*), $node as element(), $class as xs:st The expression passed to url-template may reference any of the default parameters known to TEI Publisher components, in particular path, odd, view or id. Additionally, any parameter supplied to a pb-view via the pb-param element can be referenced. Just have a look at the constructed URLs in the browser to see which parameters are being tracked for a specific page. Within TEI Publisher, URL templates will usually be rather simple. For the full syntax supported check the underlying javascript library. To handle the URL for the documentation example, we set the URL template to documentation/:id?. This injects the parameter as part of the path, e.g. /documentation/api. The ? after the parameter indicates that it is optional. We also do not want the path to the document to appear anywhere (it is always the same in the case), so we add it to url-ignore. The resulting pb-page would thus look as follows: ]]> + + A note on history handling + It is important that only one central text component on the page writes and reads the URL. Usually this will be the main pb-view. Other components, e.g. for the translation, should be made dependent and restore their state based on the state of the main component. If multiple components write their state, browsing back via the browser history may not work properly, or you may see undesired effects due to conflicting parameters. + To prevent a dependent pb-view from writing to the URL, use the attribute disable-history. To make a pb-view load its contents after the main text view, set attribute on-update and make sure, the dependent component listens to the event channel written by the main component. +