大家好,我正在尝试远程调用 SiteCore Item Web API,其中未安装 Sitecore 并且无法从远程计算机调用该服务。我从远程计算机收到 403,但从 Sitecore 计算机收到响应 200。
下面是示例代码片段
namespace SiteCoreApi
{
class Program
{
static void Main(string[] args)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create ("http://dpc/sitecore/api/ssc/item/?path=/sitecore/content/home");
request.Headers["X-Scitemwebapi-Username"] = @"sitecore\admin";
request.Headers["X-Scitemwebapi-Password"] = "b";
try
{
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Console.Write(String.Format("Content length is {0}", response.ContentLength));
Console.Write(String.Format("Content type is {0}", response.ContentType));
// Get the stream associated with the response.
Stream receiveStream = response.GetResponseStream();
// Pipes the stream to a higher level stream reader with the required encoding format.
StreamReader readStream = …
Run Code Online (Sandbox Code Playgroud) 我想在Sitecore配置文件的现有节点中插入一些新节点.
如何修补以下的默认行为:
<event name="publish:end">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<site>website</site>
</sites>
</handler>
</event>
Run Code Online (Sandbox Code Playgroud)
有:
<event name="publish:end">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<site>english</site>
<site>chinese</site>
<site>german</site>
<site>spanish</site>
<site>french</site>
<site>italian</site>
<site>japanese</site>
<site>portuguese</site>
<site>russian</site>
<site>website</site>
</sites>
</handler>
</event>
Run Code Online (Sandbox Code Playgroud) 除了投资TDS或恢复SQL数据库之外,如果有人发布了一些不应该发布的内容,是否可以撤消/回滚Sitecore发布?
我正在使用Sitecore 8.
我在Sitecore有一个网站设置.我的站点地图是sitecore中的一个项目,位于主页下方.
我可以通过输入以下URL来访问我的站点地图:http: //example.com/xmlsitemap 而xmlsitemap是Sitecore中项目的名称.其中有渲染来获取下面给出的XML站点地图:
XmlDocument SiteMap = new XmlDocument();
SiteMap.Load(System.Web.HttpContext.Current.Server.MapPath("~/") + "//SiteMap//Sitemap-" + Sitecore.Context.Site.SiteInfo.Name + ".xml");
return this.Content(SiteMap.InnerXml, "text/xml");
Run Code Online (Sandbox Code Playgroud)
我在sitecore中有多个站点设置.这就是我将sitemap创建为sitecore中的Item的原因.这样它就可以为每个网站获得正确的站点地图.
问题是当我使用URL将此站点地图提交给谷歌时.它也会对站点地图网址建立索引,并且它会显示在实际结果中.
我知道我可以通过添加X-Robot-Tag:noindex来阻止谷歌索引我的站点地图.但我不能这样做,因为它不是网站目录中的项目.
关于如何实现这一点的任何想法?
当我尝试登录Sitecore后端时,我随机收到以下错误.
The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel', but this dictionary requires a model item of type 'Sitecore.ExperienceAnalytics.Client.Mvc.Presentation.ExperienceAnalyticsLineChartViewModel'.
Run Code Online (Sandbox Code Playgroud)
在使用Sitecore Launchpad - >控制面板 - >重建链接数据库构建Sitecore链接数据库后,我遇到了此问题.
当我使用http:// {您的网站} /sitecore/admin/cache.aspx清除Sitecore缓存时,这是错误,有时不会抛出.
反正永远消除这个错误?
我创建了一个异步控制器,但我认为Sitecore 8不支持它。有什么办法可以解决此问题。我尝试了以下操作:http : //kamsar.net/index.php/2015/05/Enabling-Async-in-Sitecore-Controller-Renderings/,但它不起作用。
我正在CM和CD环境中部署我的网站,我使用solr进行搜索我按照Sitecore的所有说明从这个链接配置cm环境:
当我打开cm网站时,我收到错误说sitecore_web_index
未找到:
在上面的链接当我转到文件以启用或禁用Solr部分并单击"Excel电子表格".他们说禁用
Sitecore.ContentSearch.Solr.Index.Web.config:
有关此错误的任何想法?我应该在CM上保持web索引禁用吗?
我正在使用sitecore 8.1 update 2
我正在使用此代码来检索项目:
ISearchIndex SitecoreSearchIndex=ContentSearchManager.GetIndex("sitecore_" + Sitecore.Context.Database.Name + "_index");
using (var context = SitecoreSearchIndex.CreateSearchContext())
{
var culture = Sitecore.Context.Language.CultureInfo;
var predicate = PredicateBuilder.True<SearchResultItem>();
predicate = predicate.And(p => p.Paths.Contains(CommonTextFolderId));
predicate = predicate.And(p => p.TemplateId == CommonTextTemplateId);
predicate = predicate.And(p => p.Language == culture.Name);
var items = context.GetQueryable<SearchResultItem>().Where(predicate);
listCommonTexts = items.Select(p => SitecoreContext.Cast<CommonTextModel>(p.GetItem(), false, false)).ToList();
}
Run Code Online (Sandbox Code Playgroud) 在Sitecore 8中,我想在内容编辑器中设置项目的显示名称.Sitecore 7中有一个工具栏按钮,但它不存在于8中的任何工具栏上.
我需要指定显示名称,因为字符串包含一个&符号.
谢谢,这应该是如此简单,但无法看到如何!
我有一个丰富的文本字段。我想知道是否有方法,以防止在Sitecore的可编辑的使用体验编辑这个富文本字段。
假设我有多个富文本字段,
这些如何来我阻止编辑只横幅的内容,剩下的2场可以从页面编辑器进行编辑
访问查看器中所做的任何更改都会自动反映在安全编辑器中,反之亦然.
sitecore ×10
sitecore8 ×10
c# ×2
sitecore8.1 ×2
asp.net-mvc ×1
asynchronous ×1
controller ×1
sitemap ×1
solr ×1