使用 URI 创建客户特定的外观

发布于 2024-09-18 15:17:21 字数 335 浏览 1 评论 0原文

有些客户想要定制我的产品品牌,同时让我继续管理和维护网站。我见过人们通过创建特定于客户的 URI 来做到这一点,例如:

    <customer1>.WebSite.com
    <customer2>.WebSite.com
    <customer3>.WebSite.com
    ...

每个 customerX 标识符显然用于加载最符合客户要求的 CSS/HTML 组合。

在 ASP.NET 中这将如何完成?有什么我应该注意的严重问题吗?如果客户严重依赖 JS 和 CSS hack,那么维护这样的产品是否会很困难?

There are customers that want to customize to brand my product, while have me conitue to manage and maintain the site. I have seen people doing this by creating customer specific URIs, such as:

    <customer1>.WebSite.com
    <customer2>.WebSite.com
    <customer3>.WebSite.com
    ...

Each customerX identifier is obviously used to load a CSS/HTML composition that would best match the customer's requirements.

How would this be done in ASP.NET? Any serious gotchas I should be aware of? Is it difficult to maintain such an offering if customers are heavily reliant on JS and CSS hacks?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

海未深 2024-09-25 15:17:22

通常,根据登录使用情况进行自定义比使用这样的域名结构要容易得多。

如果您确实希望走这条路,您需要在 DNS 提供商处设置通配符 DNS 映射,您还需要检查自定义 httpmodule 或某些中的 Request 对象。母版页或基页类,然后设置适当的 CSS 样式表。

如果您在网站上使用 HTTPS,您将面临更多问题。

It's generally much easier to do the customization as a function of the logged in use rather than using domain name structures like this.

If you do wish to go down this path you'll need to set up a wildcard DNS mapping at your DNS provider, you'll also need to examine the Request object either in a custom httpmodule or in some master page or base page class and then set an appropriate CSS stylesheet.

If you are using HTTPS on your site you'll have many more problems to contend with.

少女情怀诗 2024-09-25 15:17:22

JS 和 CSS hack 是什么意思?您应该为每个客户站点加载不同的 CSS 表和 JS 文件。

What do you mean by JS and CSS hacks? You should load different CSS sheets and JS files for each customer site.

枕梦 2024-09-25 15:17:22

我将使用的基本想法:

  • 是拥有一个包含默认样式/内容的主/模板“站点”。

  • 为每个客户设置一个站点,默认将其资源指向主站。

  • 当客户想要自定义它时,请将其复制到他们的网站。将客户站点中的引用更改为他们的资源副本。


您必须注意的一件事是客户搞砸了他们的版本,以及对文件的恶意更改。

The basic idea I would use:

  • Is to have a master/template 'site' which contains the default style/content.

  • Set up a site for each customer that points it's resource by default to the master.

  • When the customer wants to customize it, copy it to their site. Change the references in the customer's site to their copy of the resource.


One thing you'll have to watch out for is the customer screwing up their version, and malicious changes to the files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文