abp
abp copied to clipboard
Dynamically Adding Meta Tags
Hi,
Is there any way to set meta tags dynamically from entity for ABP MVC porjects?
Example:
class A{string x; string y;}
<meta property="og:title" content="<A.x>" />
<meta property="og:image" content="<A.y>" />
Create a ViewComponent and add to the layout hooks like that:
Configure<AbpLayoutHookOptions>(options =>
{
options.Add(LayoutHooks.Head.First, typeof(YourViewComponent));
});