-
Hello, I would like to change the HTML rendering of the The original html.json file: {
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^5.0.0/components/context.jsonld",
"@graph": [
{
"@id": "urn:solid-server:auth:password:HtmlViewHandler",
"@type": "HtmlViewHandler",
"index": { "@id": "urn:solid-server:auth:password:IndexRoute" },
"templateEngine": {
"comment": "Renders the specific page and embeds it into the main HTML body.",
"@type": "ChainedTemplateEngine",
"renderedName": "htmlBody",
"engines": [
{
"comment": "Will be called with specific templates to generate HTML snippets.",
"@type": "EjsTemplateEngine",
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" }
},
{
"comment": "Will embed the result of the first engine into the main HTML template.",
"@type": "EjsTemplateEngine",
"template": "@css:templates/main.html.ejs", <== The part I want to change for `"template": "./my_main.html.ejs"
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" }
}
]
},
"templates": [
{
"HtmlViewHandler:_templates_key": "@css:templates/identity/email-password/login.html.ejs",
"HtmlViewHandler:_templates_value": { "@id": "urn:solid-server:auth:password:LoginRoute" }
},
{
"HtmlViewHandler:_templates_key": "@css:templates/identity/email-password/consent.html.ejs",
"HtmlViewHandler:_templates_value": { "@id": "urn:solid-server:auth:password:ConsentRoute" }
},
{
"HtmlViewHandler:_templates_key": "@css:templates/identity/email-password/forgot-password.html.ejs",
"HtmlViewHandler:_templates_value": { "@id": "urn:solid-server:auth:password:ForgotPasswordRoute" }
},
{
"HtmlViewHandler:_templates_key": "@css:templates/identity/email-password/reset-password.html.ejs",
"HtmlViewHandler:_templates_value": { "@id": "urn:solid-server:auth:password:ResetPasswordRoute" }
}
]
}
]
} In my CSS config {
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^5.0.0/components/context.jsonld",
"import": [
"css:config/app/main/default.json",
"css:config/app/init/initialize-root.json",
....
"css:config/http/handler/default.json",
....
"./override.json"
], And override.json contains the following: {
"@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^5.0.0/components/context.jsonld",
"comment" : {
"@id": "urn:solid-server:auth:password:HtmlViewHandlerOverride",
"@type": "HtmlViewHandler",
"overrideInstance": { "@id": "urn:solid-server:auth:password:HtmlViewHandler" },
},
"@graph": [
{
"@id": "urn:solid-server:auth:password:HtmlViewHandlerOverride", <- EDITED
"@type": "HtmlViewHandler", <- EDITED
"index": { "@id": "urn:solid-server:auth:password:IndexRoute" }, <- EDITED
"templateEngine": {
"comment": "Renders the specific page and embeds it into the main HTML body.",
"@type": "ChainedTemplateEngine",
"renderedName": "htmlBody",
"engines": [
{
"comment": "Will be called with specific templates to generate HTML snippets.",
"@type": "EjsTemplateEngine",
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" }
},
{
"comment": "Will embed the result of the first engine into the main HTML template.",
"@type": "EjsTemplateEngine",
"template": "./my_main.html.ejs", <- EDITED
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" }
}
]
},
"templates": [
{
"HtmlViewHandler:_templates_key": "@css:templates/identity/email-password/login.html.ejs",
"HtmlViewHandler:_templates_value": { "@id": "urn:solid-server:auth:password:LoginRoute" }
},
{
"HtmlViewHandler:_templates_key": "@css:templates/identity/email-password/consent.html.ejs",
"HtmlViewHandler:_templates_value": { "@id": "urn:solid-server:auth:password:ConsentRoute" }
},
{
"HtmlViewHandler:_templates_key": "@css:templates/identity/email-password/forgot-password.html.ejs",
"HtmlViewHandler:_templates_value": { "@id": "urn:solid-server:auth:password:ForgotPasswordRoute" }
},
{
"HtmlViewHandler:_templates_key": "@css:templates/identity/email-password/reset-password.html.ejs",
"HtmlViewHandler:_templates_value": { "@id": "urn:solid-server:auth:password:ResetPasswordRoute" }
}
]
}
]
} Still, the override doesn't work. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
I also did some attempts to override the I found out that if I added an Attempt 1: Adding an
|
Beta Was this translation helpful? Give feedback.
-
Pinging @joachimvh |
Beta Was this translation helpful? Give feedback.
-
As @ixuz mentioned, the object that you want to override needs to have an {
"@id": "ex:myObjectOverride2",
"@type": "Override",
"overrideInstance": { "@id": "urn:solid-server:auth:password:HtmlViewHandler" },
"overrideParameters": {
"@type": "HtmlViewHandler",
"templateEngine": {
"@type": "ChainedTemplateEngine",
"renderedName": "htmlBody",
"engines": [
{
"comment": "Will be called with specific templates to generate HTML snippets.",
"@type": "EjsTemplateEngine",
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" }
},
{
"comment": "Will embed the result of the first engine into the main HTML template.",
"@type": "EjsTemplateEngine",
"template": "./my_main.html.ejs",
"baseUrl": { "@id": "urn:solid-server:default:variable:baseUrl" }
}
]
},
}
} Which replaces the entire template engine in the handler with one that contains your new base template. Note that the This last part is also relevant for you I think @ixuz . The reason you get the array error there (I think, @rubensworks can corroborate), is because you use |
Beta Was this translation helpful? Give feedback.
I also did some attempts to override the
"template"
property in the"engines"
list but I ultimately failed as well... But see my findings below.I found out that if I added an
"@id"
(e.g.urn:solid-server:auth:password:engine
) to the specific engine we want to override, I successfully managed to override the"template"
property.Attempt 1: Adding an
@id
to the specifc engine that we want to override.config/identity/handler/interaction/views/html.json
: