标签: sitecore7

在sitecore中将数据从一个子布局发送到另一个子布局

我很难在Sitecore 7中构建过滤系统.

我在页面的同一级别有2个子布局.

子布局A是一个侧边栏,其中包含一个复选框列表,并且具有使用所选值填充列表的事件.子布局B显示一组项目.

我想做的是,将填充的列表从子布局A发送到子布局B,以便根据用户选择的内容过滤项目列表.我能够通过Session传递数据来做到这一点,但这不是处理数据的最佳方式.

我已经尝试为子布局A定义一个属性并在那里加载列表,但是我无法从子布局B获得子布局A的确切实例以便读取填充的属性.此外,尝试Page.FindControl("IdOfSomeElementFromSublayoutA")始终在Sublayout B中返回null.尽管我已将Page转换为包含Sublayouts的.aspx页面.

我正在使用Sitecore 7 Update 2.

非常感谢你的时间.

c# asp.net sitecore sitecore7

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

ascx中的Updatepanel刷新整个控件

我有一个sitecore proejct,我已经以ascx用户控件的形式准备了一个子布局.我需要在这个用户控件中设置级联下拉菜单,并根据我发现的UpdatePanel是要走的路.问题是UpdatePanel似乎刷新了整个控件,我不认为这是正确的行为.

我知道SO上有一些类似的问题,但没有一个解决方案适合我.我也开始怀疑这可能是Sitecore的具体问题.

以下是用户控件的代码示例:

    <p><%= MyItem.Text %>" /></p>

    <asp:UpdatePanel ID="LocationFilterUpdatePanel" runat="server">
    <ContentTemplate>

        <asp:DropDownList ID="DDL1" OnSelectedIndexChanged="DDL1_SelectedIndexChanged" runat="server" AutoPostBack="true">

        </asp:DropDownList>


        <asp:DropDownList ID="DDL2"  OnSelectedIndexChanged="DDL2_SelectedIndexChanged" runat="server" AutoPostBack="true">

        </asp:DropDownList>

    </ContentTemplate>
    </asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)

而守则背后:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!System.Web.UI.ScriptManager.GetCurrent(Page).IsInAsyncPostBack)
        {
            var context = new SitecoreContext();
            //Get Model from Sitecore

            DDL1.DataSource = Model.Data;
            DDL1.DataValueField = "Id";
            DDL1.DataTextField = "Name";
            DDL1.DataBind();
        }

    }

    protected void DDL1_SelectedIndexChanged(object sender, EventArgs e)
    {
        var context = new SitecoreContext();
        //Get Model from Sitecore

        DDL2.DataSource = Model.Data;
        DDL2.DataValueField = "Id"; …
Run Code Online (Sandbox Code Playgroud)

asp.net updatepanel sitecore sitecore7

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

如何重写或缩短Sitecore URL

我有Sitecore网站的网址 http://www.abc.com/our-resorts/resort1/career.aspx 但我想缩短网址,如 http://www.abc.com/resort1/career.aspx.知道如何our-resorts从URL中删除.

在此输入图像描述

请Sitecore社区的任何人帮助我....

谢谢

url-rewriting sitecore sitecore7

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

使用Sitecore在网址中强制使用语言前缀

是否有设置强制URL中的语言?就像,如果我浏览到http://www.site.com,我应该被重定向到http://www.site.com/en,因为现在我可以看到没有语言前缀的起始页面.

LinkManager配置为始终放在前缀,以便所有的链接看起来不错,至少.

asp.net-mvc sitecore sitecore7

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

Sitecore ContentSearch LINQ不支持的表达式节点类型:参数

尝试在以下代码块中运行Sitecore ContentSearch LINQ查询的ToList方法时,我收到以下异常消息:

Unsupported expression node type: Parameter. This could be due to ordering of   
expression statements. For example filtering after a select expression like this : 
queryable.Select(i => new { i.Id, i.Title }).Where(i => d.Title > "A"  

public virtual List<SearchResultItem> RunQuery(SearchParam param, bool showAllVersions, bool firstLoad)
{
    Assert.ArgumentNotNull(Index, "Sitecore.SharedSource.Search");
    var resultCollection = new List<SearchResultItem>();

    try
    {
        using (var context = this.Index.CreateSearchContext())
        {
            var result = context.GetQueryable<SearchResultItem>()
                                                .Where(x => HasFullText(x, param.FullTextQuery) &&
                        HasLanguage(x, param.Language) &&
                        HasRelation(x, param.RelatedIds) &&
                        HasTemplate(x, param.TemplateIds) …
Run Code Online (Sandbox Code Playgroud)

linq lucene sitecore sitecore7

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

Sitecore 7搜索索引问题

我想将Sitecore 7中的搜索索引限制为仅扫描内容树的一个节点.

目前结构如下:

  • Sitecore的
    • 内容
      • BaseNode
      • $公司节点

该索引正在索引两个BaseNode&$Company Node,但我只希望它索引$Company Node.

我已经更新了默认/sitecore/content的路径Sitecore.ContentSearch.config,SitecoreContentSearch.Lucene.DefaultIndexConfiguration.config,Sitecore.ContentSearch.Lucene.Index.Master,和Sitecore.ContentSearch.LuceneIndex.Web.config.当我更新<root>要指向的元素/sitecore/content/$CompanyNode时,当我尝试重建索引时,我得到以下异常.

任何想法我需要做什么来限制Lucene只是索引一些项目,而不是一切?

Exception: System.Reflection.TargetInvocationException 
Message: Exception has been thrown by the target of an invocation. 
Source: mscorlib 
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature         sig, Boolean constructor) 
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[]     parameters, Object[] arguments) 
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr,     Binder binder, Object[] parameters, CultureInfo culture) 
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) 
at …
Run Code Online (Sandbox Code Playgroud)

.net c# lucene.net sitecore sitecore7

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

Sitecore - 在zip文件中上传两个具有相同名称但扩展名不同的文件

我想上传2个具有相同名称但扩展名不同的文件,我想将它们放在一个zip文件中,然后使用sitecore将所有文件解压缩到sitecore媒体库中.
我正在使用sitecore 7.2.知道怎么做吗?

sitecore sitecore7

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

部署失败.原因:TDS连接器的版本不正确.

我正在从Visual Studio 2013迁移到Visual Studio 2015.我安装了TDS,可以很好地构建和创建TDS包.最初我有一个错误,抱怨Hedgehog服务dll不存在,通过重新安装TDS消失了.

现在,我唯一的问题是当我尝试部署到我的本地时.构建测试通过正常,但部署选项在TDS项目中失败,并出现以下错误:

C:\ Program Files(x86)\ MSBuild\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.targets(633,5):错误:部署失败.原因:TDS连接器的版本不正确.

之前有没有人看过这个错误,我该如何解决?我仍然可以在本地部署到我的文件夹,因为所有代码都在更改,我也可以创建包,但是让它全部工作真的很棒.

谢谢

sitecore tds sitecore7 visual-studio-2015

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

Sitecore - 如果占位符为空,则隐藏渲染

我有一个相当简单的Sitecore MVC渲染,其中包含一个标题字段和一个占位符:

<section>
    <div class="container">
        <h2 class="m-header"><span>@Html.Sitecore().Field("PromoItemsHeader")</span></h2>

        <div class="l-section grid">
            @Html.Sitecore().Placeholder("PromoItems")
        </div>
    </div>
</section>
Run Code Online (Sandbox Code Playgroud)

我希望此渲染在占位符包含项目时显示在页面编辑模式之外.这似乎应该很简单,但我找不到一个明显/干净的方法.

sitecore sitecore7 sitecore-mvc

3
推荐指数
2
解决办法
2978
查看次数

模板中的Sitecore数据源查询

如何在模板的DataSource中编写查询以生成项目的路径?

如果我在DataSource字段中编写查询并且页面使用模板,则数据源值将是项目的路径作为动态数据源,如屏幕截图.

在此输入图像描述

datasource sitecore sitecore7

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