abp icon indicating copy to clipboard operation
abp copied to clipboard

Dynamically Adding Meta Tags

Open cotur opened this issue 6 years ago • 1 comments

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>" />

cotur avatar Jan 01 '20 11:01 cotur

Create a ViewComponent and add to the layout hooks like that:

Configure<AbpLayoutHookOptions>(options =>
{
    options.Add(LayoutHooks.Head.First, typeof(YourViewComponent));
});

hikalkan avatar Jan 02 '20 10:01 hikalkan