【问题标题】:ASP.NET MVC theme editor on UIUI 上的 ASP.NET MVC 主题编辑器
【发布时间】:2012-06-15 13:32:02
【问题描述】:

我正在构建一个多租户应用程序,允许租户在管理控制面板的 UI 上编辑布局 (HTML)。我以为我可以为用户构建一个编辑器来编辑剃刀视图,但需要对其进行编译才能影响新的剃刀视图。

我研究了一些开源应用程序。我找到了这个http://liquidmarkup.org/ 它是为在 Ruby on Rails Web 应用程序中使用而开发的

在 ASP.NET MVC 中有人对此有任何经验和参考吗?

【问题讨论】:

    标签: asp.net asp.net-mvc multi-tenant


    【解决方案1】:

    不能 100% 确定这是否是您正在寻找的内容,但您可以使用 jQuery 主题(CSS 和标记)开发您的网站,然后为您的客户使用 theme roller

    【讨论】:

      【解决方案2】:

      听起来您可以使用 Jquery 模板 (http://api.jquery.com/category/plugins/templates/) 来满足您的需求。

      这是我的一个项目中的一个随机(非常精简的)示例模板:

      <table>
      <tr>
          <th>Response Status</th>
          <th>Response Reason</th>
      </tr>
      <tr>
          <td>${RepsonseStatus}</td>                
          <td>${ResponseReason}</td>
      </tr>
      

      注意 ${} 标签 - 这些将在运行时替换为 json 数据。

      这里是如何将模板与其数据合并

      //myTemplate can be sent from a server side function
      var myTemplate = SomeFunctionToGetMyTemplate();
      //myData is a javascript object/json from the server
      var myData = SomeFunctionToGetMyData();
      //the html function just replaces the html of the context node (#myTargetDiv) with the //output of the $.tmpl function
      $("#myTargetDiv").html($.tmpl(myTemplate, myData));
      

      Jquery 模板已被正式弃用,但 jquery 还没有正式的替代品(afaik)。对于 jquery 模板,有一些关于复数视觉的有用视频教程。

      【讨论】:

        【解决方案3】:

        Highwire.com 建立在 ASP.NET 之上,但他们为使用 Apache Velocity Platform 的客户端使用自定义模板和自定义 UI 功能。

        http://docs.highwire.com/apiv2/html/

        也许你也可以使用它

        【讨论】:

        • 谢谢,我调查了 Highwire 以了解他们是如何做到的。他们似乎为此建立了自己的框架。 Highwire 看起来像 shopify.com
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-07-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多