开发者

MVC Multi-Tenant Site - Customising Meta Tags per tenants

开发者 https://www.devze.com 2023-02-05 09:24 出处:网络
I\'m trying to get my head around another issue i\'m facing with my multi-tenant application. I have many pages on my site where I need to customise the meta tags / page titles for each of my pages p

I'm trying to get my head around another issue i'm facing with my multi-tenant application.

I have many pages on my site where I need to customise the meta tags / page titles for each of my pages per tenant.

Where would be the best place to store these meta tags? I can't use a ContentPlaceHolder any more because that would only work for a single tenant.

At the moment I have got them in the DB like so:

MetaTags
  - Url
  - Title
  - Description
  - Keywords

However th开发者_运维技巧is seems a little rigid because the Url field matches the current request path, but the request path might not match all the time:

This works fine:

DB Url: /media/latest/
Request Path: /media/latest/

This doesn't

DB Url: /media/latest/
Request Path: /media/latest/1 (page number)

Can anyone think of a better design / technique for this?

Thanks, Paul


I modified my code to use the controller name and action name instead of the URL which is making things alot easier...I am also caching all the meta tags on application startup for each tenant.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号