This is a helper class that wraps around the code used for:
- Add iOS home page icons and startup images to MVC app for Safari and Mobile Safari
- Using AB_PageMetaInfoModel to generate markup for meta elements
- Using AB_PageLinkInfoModel to generate markup for link elements
- Using AB_PageScriptInfoModel and A4DN.Core.MVC.CMS.Models.GoogleJsonLD to render JSON-LD markup
Typical usage is to create a shared partial template, often named _META_Elements.cshtml, which gets included in layout templates using RenderPartial(). The contents of the template instantiates an AB_SocialMetaModel object and then renders is using Html.DisplayFor(), which makes use of ~/Views/Shared/DisplayTemplates/AB_SocialMetaModel.cshtml and a few other templates to render out the meta, link, and script tags the model describes.
Several rarely-modified values are defined in overloadable properties, so they can be changed by defining a subclass of AB_SocialMetaModel and using that in _META_Elements.cshtml instead. A subclass's constructor can also be used to add additional tags, or remove some that aren't wanted, though this can also be done in _META_Elements.cshtml.
- For meta tags, add new AB_PageMetaEntity objects to ap_PageMetaInfoModel
- For link tags, add new AB_PageLinkEntity objects to ap_PageLinkInfoModel
- For json-ld script tags, add new AB_PageScriptEntity objects to ap_PageScriptInfoModel
Several of the tags draw their values from the HttpContext.Items[] collection; these are typically set in page-specific controllers or views to provide page-specific tags.
- "Meta.Title"
- "Meta.Description"
- "Meta.Keywords"
- "Meta.ModuleImageURL"
- "Meta.OGType" - Facebook Open Graph Type
- "Meta.ScriptModels" - A List of AB_PageScriptInfoModel object for page-specific Google json-ld
For CMS pages and AB_Listing detail entities, these values are set through the Maintenance application's detail displays.