We are using DXA 2.2 on the .Net project
Need suggestions on how can we extend functionality to map DefaultModelBuilder.MappingData metadata field to Model.
we have this Model class
public class MediaDistribution : EclItem
{
public string HtmlTitle { get; set; }
public string HtmlInnerText { get; set; }
}
on mapping
"paragraph": {
"$type": "ContentModelData",
"description": {
"$type": "RichTextData",
"Fragments": [
{
"$type": "EntityModelData",
"Id": "118640",
"Namespace": "tcm",
"Folder": {
"Id": "74789",
"Title": "F6D"
},
"BinaryContent": {
"Url": "https://dxa.widen.net/content/gkjrtlknvcnx/original/2021dxa-Slavery-and-Human-Trafficking-Statement-for-Jan-2021-to-Dec-2021-_pw.pdf?u=cglmil&",
"FileName": "【2021年度】dxa Slavery and Human Trafficking Statement (for Jan 2021 to Dec 2021) _pw.pdf",
"FileSize": 0,
"MimeType": "pdf"
},
"ExternalContent": {
"Id": "ecl:19-wid-gkjrtlknvcnx-widenFile-file",
"DisplayTypeId": "widenfile",
"TemplateFragment": "<iframe src='https://dxa.widen.net/content/gkjrtlknvcnx' ></iframe>",
"Metadata": {
"Title": "【2021年度】dxa Slavery and Human Trafficking Statement (for Jan 2021 to Dec 2021) _pw.pdf",
"LastAccessedDate": "2022-06-20T00:15:02.000",
"ContentType": "pdf",
"Tags": {
"$type": "String[]",
"$values": [
"gkjrtlknvcnx",
"18058e97-2607-4bc9-912f-36db0767ec7e",
"[]",
"Website",
"None",
"[\r\n \"Other\"\r\n]"
]
},
"Width": "0",
"Height": "0",
"Filename": "【2021年度】dxa Slavery and Human Trafficking Statement (for Jan 2021 to Dec 2021) _pw.pdf",
"CreatedAt": "2022-06-20T00:15:02.000",
"ThumbnailETag": "",
"CanUpdate": "False"
}
},
"Metadata": {
"html-title": "dxa dxa Systems Slavery and Human Trafficking Statement (For Financial Year Ended Dec 31, 2021)",
"html-innerText": "Read \"dxa dxa Systems Slavery and Human Trafficking Statement (For Financial Year Ended Dec 31, 2021)\""
},
"SchemaId": "65530"
}
]
}
we need to read html-title and html-innertext from the above graphql response, however dxa doesn't map this information to Model field if we apply semantics as ["html-title"] and ["html-innerText"].
We tried to add "html-title" field on stub schema metadata, and that is not showing on mappings/schemas.json even after publish the publish setting.
could someone please suggest how can we achieve this