标签: sitecore8

向web.config添加事件处理程序会产生错误:配置文件不是格式良好的XML

根据这篇博文,我试图将一个事件添加到我的Sitecore web.config文件中,并完成他正在做的事情.这正是我在我的文件中的方式.

<events timingLevel="custom">
      ...
      <event name="item:added">
        <handler type="BenefitVault.Core.Helpers.SitecoreEvents, BenefitVault" method="OnItemAdded" patch:after="processor[@type='Sitecore.Data.Fields.ItemEventHandler, Sitecore.Kernel']" />
      </event>
      ...
</events>
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试访问我的本地站点时,我收到以下错误.它看起来像语法错误,但我没有看到问题.有任何想法吗?

在此输入图像描述

events templates web-config sitecore sitecore8

1
推荐指数
1
解决办法
250
查看次数

从自定义代码将数据保存到Sitecore Analytics

我已经使用Sitecore几年了,现在希望开始使用Sitecore 8中的体验功能.

我有一个视图,将捕获一些用户提供的数据.如何从自定义代码创建Analytics数据库中的"人员"(不知道正确的Sitecore术语).

sitecore sitecore8

1
推荐指数
1
解决办法
877
查看次数

Glass Mapper缓存价值?

使用Sitecore 8.0u3和Glass-Mapper 3.5.3

我遇到了一个我无法解决的有趣情况.我在某些控制器渲染上看到,简单文本字段(单行,多行)的某些值似乎被缓存.其他控制器渲染似乎没有此问题.

我试图写出表格的介绍文本,如下所示:

<div class="intro">@Editable(m => Model.ContextItem.Intro_Text)</div>
<div>RAW: @Model.ContextItem.Intro_Text</div>
Run Code Online (Sandbox Code Playgroud)

请注意,我添加了第二行用于故障排除.

在这种情况下,结果是:

填写表格联系uss.

RAW:填写表格联系uss.

我更新Sitecore中的文本以删除额外的's',保存并发布.我刷新了我的页面,我看到了这个:

填写表格联系uss.

RAW:填写表格与我们联系.

所以不使用的部分Editable工作正常,但是Editable版本继续显示"旧"值.

我查看了很多设置,包括渲染的可缓存性,站点的可缓存性,Caching.Enabled设置,Caching.HTMLLifetime设置,IIS缓存,发布限制,但似乎都没有影响这个问题.

其他地方的任何想法都在寻找问题的根源?

sitecore sitecore-mvc glass-mapper sitecore8

1
推荐指数
1
解决办法
835
查看次数

Sitecore MVC禁用Web编辑

我想在使用时禁用正在显示的字段的网页编辑,Html.Sitecore().Field(string fieldName, Item item, object params)但我遇到了麻烦.以下引发"参数计数不匹配"错误

@Html.Sitecore()
   .Field(item.InnerField.Name, item.InnerField.Item,
     new Sitecore.Collections.SafeDictionary<string, string>
     {
       {"class", classParam},
       {"disable-web-edit", pageEditorEnabled.ToString()}
     });
Run Code Online (Sandbox Code Playgroud)

我无法使用匿名对象,因为disable-web-edit有连字符.我可能会使用其他一些关键字,但这是字段渲染器使用的iirc.

[TargetParameterCountException: Parameter count mismatch.]
   System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +14255904
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +96
   System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) +37
   Sitecore.Mvc.Helpers.TypeHelper.CopyProperties(Object source, SafeDictionary`2 target) +89
   Sitecore.Mvc.Helpers.SitecoreHelper.BeginField(String fieldName, Item item, Object parameters) +120
   Sitecore.Mvc.Helpers.SitecoreHelper.Field(String fieldName, Item item, Object parameters) +23
Run Code Online (Sandbox Code Playgroud)

sitecore sitecore-mvc sitecore8

1
推荐指数
1
解决办法
3179
查看次数

Sitecore,用户没有"插入外部链接,插入媒体链接等" 更新常规链接字段时

在Sitecore 8.0中,我的用户没有"插入外部链接,插入媒体链接等".更新常规链接字段时.她只是看到一个文本字段来输入一个链接.

我使用Access Viewer查看了Core数据库,并且她的用户帐户对"系统>字段类型>链接类型>常规链接<菜单"下的所有项具有"读取"权限

知道为什么会这样吗?我可以在管理员级帐户下看到这些选项.

sitecore sitecore8

1
推荐指数
1
解决办法
834
查看次数

在Sitecore8.1中使用Glass.Mapper时,"可编辑"上的运行时错误

我安装了Sitecore8.1 MVC和Glass.Mapper.Sc包(来自NuGet).我需要在我的cshtml中使用'Editable'方法,但我不断收到运行时错误:

"可编辑"这个名称在当前上下文中不存在

我是否需要其他DLL,或使用或配置更新等..?

sitecore glass-mapper sitecore8

1
推荐指数
1
解决办法
836
查看次数

如何让Log4Net创建一个简单的file.log,并在新日期开始时将其重命名为file-dd-mm-yyyy.log?

所以我希望今天的日志文件完全清除文件名中的所有日期格式,这样总能找到今天的日志文件很容易.但是,我希望在新的一天开始时,使用日期戳重命名旧的日志文件.

所以日志文件夹看起来像这样:

log.log (< - todays                          logfile)
log-16.02.2016.log
log-15.02.2016.log

logging log4net config sitecore sitecore8

1
推荐指数
1
解决办法
358
查看次数

sitecore中多语言网站的最佳设计

刚开始使用Sitecore.我正在开发一个多语言网站,并希望了解其信息架构的标准设计.该网站有两种语言(英语和日语)的通用设计.图片/产品优惠会改变几页.

用户将从网站的下拉列表中选择语言.网址将是

http://www.example.com/en/index.html
http://www.example.com/ja/index.html

经过一番研究,这是我想出的一个结构,继续进行.

Sitecore
 Content
  en
    index
    gallery
    products
  ja
    index
    gallery
    products
Run Code Online (Sandbox Code Playgroud)

在我们开始构建之前,想知道,如果还有其他更好的方法.谢谢.

asp.net sitecore sitecore8

1
推荐指数
1
解决办法
113
查看次数

如何在Sitecore中获得物品的生命周期

我想在页面上显示菜单项,具体取决于它们的有效日期和日期.但在此之前,想要测试输出.该_Valid to日期设置为3/17/2016 12:00 AM在"关于我们"的项目.

输出是About us--.
获取有效期从&到日期的正确方法是什么.

protected void rpMenu_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
  var mainItem = (Item)e.Item.DataItem;                

  if (mainItem != null)
  {
    Response.Write(mainItem.Name + "-" + mainItem.Fields["Valid to"] + "-");

    //this one did not work too
    Response.Write(mainItem.Name + "-" + mainItem.Fields["_Valid to"] + "-");
  }
}
Run Code Online (Sandbox Code Playgroud)

asp.net sitecore sitecore8

1
推荐指数
1
解决办法
152
查看次数

Sitecore:如何将Field移动到我的一个基本模板而不会丢失数据

假设我的"丰田"模板以"Car"为基础模板.

我想将"挡风玻璃"字段从"丰田"移动到"汽车",但我不希望丰田的所有实例都将其重置为空.

有没有一种安全的方法可以做到这一点?

sitecore sitecore8

1
推荐指数
1
解决办法
408
查看次数