<https://docs.linkeddatahub.com/extending/change-layout/>
        a       <https://w3id.org/atomgraph/linkeddatahub/document-hierarchy#Item>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1>
                <https://docs.linkeddatahub.com/extending/change-layout/#content>;
        <http://purl.org/dc/terms/created>
                "2026-09-29T09:52:12.702Z"^^<http://www.w3.org/2001/XMLSchema#dateTime>;
        <http://purl.org/dc/terms/creator>
                <https://admin.linkeddatahub.com/acl/agents/5ba81960-d511-4a3b-8b9a-cb5bb278dd95/#this>;
        <http://purl.org/dc/terms/description>
                "How to customize a dataspace's layout and the way its resources are rendered";
        <http://purl.org/dc/terms/title>
                "Change layout";
        <http://rdfs.org/sioc/ns#has_container>
                <https://docs.linkeddatahub.com/extending/>;
        <http://www.w3.org/ns/auth/acl#owner>
                <https://admin.linkeddatahub.com/acl/agents/5ba81960-d511-4a3b-8b9a-cb5bb278dd95/#this> .

<https://docs.linkeddatahub.com/extending/change-layout/#content>
        a       <https://w3id.org/atomgraph/linkeddatahub#XHTML>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n    <p class=\"ldh-body-lg\">How to customize a dataspace's layout and the way its resources are rendered</p>\n    <p>LinkedDataHub's user interface is simply a rendering of the underlying Linked Data resource descriptions, which are exposed via the <a href=\"../../reference/http-api/\" target=\"_blank\">HTTP API</a>.</p>\n    <p>LinkedDataHub provides <a href=\"../../reference/stylesheets/\" target=\"_blank\">XSLT stylesheets</a> that render a default UI layout. When building a dataspace, however, you may want a custom\n        layout. The recommended approach is a new stylesheet that imports the system stylesheet and overrides only the templates you need, reusing the rest of the layout.</p>\n    <div>\n        <h2 id=\"default-layout\">Default layout</h2>\n        <p>The examples below run on a Northwind <a href=\"https://northwind-traders.demo.linkeddatahub.com/orders/10248/\" target=\"_blank\">order document</a>:\n            its graph holds the order (the document's topic) and the order's line items, each carrying its own <code>schema:price</code> line total.</p>\n        <p>Out of the box, the default layout renders the order and each line item as a plain resource description.</p>\n        <img alt=\"A Northwind order document in the default layout, order and line items as generic resource descriptions\" src=\"/uploads/aaffaa280a8b5fb987c482d723bca80fbaa59291\"></img>\n    </div>\n    <div>\n        <h2 id=\"create-stylesheet\">Create a stylesheet</h2>\n        <p>Create a new XSLT 3.0 stylesheet and use <code>&lt;xsl:import&gt;</code> to import the system stylesheet <a href=\"https://github.com/AtomGraph/LinkedDataHub/blob/master/src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/layout.xsl\" target=\"_blank\"><samp>static/com/atomgraph/linkeddatahub/xsl/layout.xsl</samp></a>:</p>\n        <pre>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;xsl:stylesheet version=\"3.0\"\nxmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\nxmlns=\"http://www.w3.org/1999/xhtml\"\nxmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\nxmlns:foaf=\"http://xmlns.com/foaf/0.1/\"\nxmlns:schema=\"https://schema.org/\"\nxmlns:ac=\"https://w3id.org/atomgraph/client#\"\nxmlns:ldh=\"https://w3id.org/atomgraph/linkeddatahub#\"\nexclude-result-prefixes=\"#all\"&gt;\n\n    &lt;xsl:import href=\"https://localhost:4443/static/com/atomgraph/linkeddatahub/xsl/layout.xsl\"/&gt;\n\n    &lt;!-- overriding templates go here --&gt;\n\n&lt;/xsl:stylesheet&gt;</pre>\n        <p>(Imports under the dataspace's <samp>/static/</samp> path resolve to local webapp files, so no HTTP round-trip is made.)</p>\n    </div>\n    <div>\n        <h2 id=\"configure-dataspace\">Configure the dataspace</h2>\n        <p>Either <a href=\"../../user-guide/upload-file/\" target=\"_blank\">upload the XSLT file</a> or mount it using Docker and <samp>docker-compose.override.yml</samp>:</p>\n        <pre>services:\n  linkeddatahub:\n    volumes:\n      - ./files/northwind.xsl:/usr/local/tomcat/webapps/ROOT/static/com/atomgraph/linkeddatahub/northwind/xsl/layout.xsl:ro</pre>\n        <p>Then change the value of <code>ac:stylesheet</code> on the dataspace with base URI <code>https://localhost:4443/</code> to the URL of the stylesheet. The value has to be an absolute URL on the dataspace's own origin:</p>\n        <pre>&lt;urn:linkeddatahub:apps/end-user&gt; a lds:Dataspace ;\n    ...\n    ac:stylesheet &lt;https://localhost:4443/static/com/atomgraph/linkeddatahub/northwind/xsl/layout.xsl&gt; ;\n    ...</pre>\n        <p>You will need to restart LinkedDataHub's Docker service for the new stylesheet to take effect.</p>\n    </div>\n    <div>\n        <h2 id=\"augment-output\">Augment output</h2>\n        <p>Keep the default output using <code>&lt;xsl:apply-imports&gt;</code> or <code>&lt;xsl:next-match&gt;</code> and add new output before/after it.\n            Here the order's rendering gains a computed total, summed over the line items in the graph:</p>\n        <pre>&lt;xsl:template match=\"*[foaf:isPrimaryTopicOf/@rdf:resource = ac:absolute-path(ldh:base-uri(.))][rdf:type/@rdf:resource = 'https://schema.org/Order'][key('resources', schema:orderedItem/@rdf:resource)]\" priority=\"1\"&gt;\n    &lt;xsl:next-match/&gt;\n\n    &lt;h3&gt;Order total&lt;/h3&gt;\n    &lt;p&gt;\n        &lt;xsl:value-of select=\"format-number(sum(key('resources', schema:orderedItem/@rdf:resource)/schema:price), '#,##0.00')\"/&gt;\n        &lt;xsl:text&gt; USD&lt;/xsl:text&gt;\n    &lt;/p&gt;\n&lt;/xsl:template&gt;</pre>\n        <p>The pattern matches resource descriptions that are the primary topic of the requested document (i.e. its order), are typed <code>schema:Order</code>, and have line items present in the RDF graph.</p>\n        <p>With the overriding template, the order page shows the computed total after the order's default description.</p>\n        <img alt=\"The augmented order page with the Order total heading and sum under the order description\" src=\"/uploads/59c543d37a229e1e525a9249008192f53a015d33\"></img>\n    </div>\n    <div>\n        <h2 id=\"override-output\">Override output</h2>\n        <p>To completely change the layout without keeping the default one, use the same logic as for <a href=\"#augment-output\">augmenting</a> it, but do not call <code>&lt;xsl:apply-imports&gt;</code>/<code>&lt;xsl:next-match&gt;</code>.</p>\n    </div>\n    <div>\n        <h2 id=\"suppress-output\">Suppress output</h2>\n        <p>Having summed the line items into a total, you may no longer want each line item rendered as its own resource description, nor the raw\n            <code>schema:orderedItem</code> rows in the order's property list.</p>\n        <p>You can specify an empty template at any level (graph/property/resource) to disable output of that layout mode. This suppresses the line item resources:</p>\n        <pre>&lt;xsl:template match=\"*[@rdf:about = key('resources', key('resources', ac:absolute-path(ldh:base-uri(.)))/foaf:primaryTopic/@rdf:resource)/schema:orderedItem/@rdf:resource]\"/&gt;</pre>\n        <p>The pattern matches resource descriptions that are line items of the current document's primary topic.</p>\n        <p>And this suppresses the property rows:</p>\n        <pre>&lt;xsl:template match=\"*[foaf:isPrimaryTopicOf/@rdf:resource = ac:absolute-path(ldh:base-uri(.))]/schema:orderedItem\" mode=\"ac:PropertyEditor\"/&gt;</pre>\n        <p>The pattern matches <code>schema:orderedItem</code> properties of a resource that is the primary topic of the current document.</p>\n        <p>With the suppressing templates, the order page shows the order and its total, with the line items no longer repeated below.</p>\n        <img alt=\"The order page after suppression — order description and total only, line items hidden\" src=\"/uploads/e168fadd3f737e36e85f0f0107ba057ab8f4e24a\"></img>\n    </div>\n    <p class=\"ldh-body-lg\">Read more about the <a href=\"../../reference/stylesheets/\">XSLT stylesheets</a> or continue with the <a href=\"../build-apps/\">Build apps</a> guide.</p>\n</div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
