sitecore

Glass Mapper RenderLink link description - default text if empty

二次信任 提交于 2019-12-25 06:20:29
问题 <li>@if (string.IsNullOrWhiteSpace(topLinks.Target.Text)) { topLinks.Target.Text = "EMPTY DESCRIPTION"; } @(RenderLink(topLinks, x => x.Target, isEditable: true)) </li> I need a way to catch it when a Content Editor has set up a link, but not actually put a Link Description in. At the moment it just renders spaces. The above works, but it's clunky and I need to put it everywhere I use a RenderLink . How do I default the text if it's empty? 回答1: I've created an extension method to work around

How to bind link items to a Repeater in Sitecore

倖福魔咒の 提交于 2019-12-25 05:37:49
问题 The content tree is as follows: content -News Listing -Article1 -Article2 -Article3 Each of the Articles is of a Data Template - "News Article" which is as: News Article Article --(Field section) Related Articles --(Multilist - with datasource as '/content/News Listing') Each article has the other 2 articles as its 'Related Articles'. For eg: Article1 has related articles 2&3 and so on. Markup: <h3>Related articles</h3> <asp:Repeater ID="rpArticles" runat="server" ItemType="Sitecore.Data

How to add a class attribute to sitecore MVC image field

南楼画角 提交于 2019-12-25 05:24:35
问题 Using Sitecore mvc field render @Html.Sitecore().Field("FieldName", ContentItem) I would like to add class to image tag like below, <img src="/images/Sample.jpg" class="hidden-xs"> So, How can I add the css class in Site core MVC image field. Thanks in advance. 回答1: You can simply use this one. @Html.Sitecore().Field("FieldName", Model.PageItem, new { @class="large-image", @mw="250" }) 来源: https://stackoverflow.com/questions/36092433/how-to-add-a-class-attribute-to-sitecore-mvc-image-field

Sitecore item will not go into edit mode; any suggestions on how to troubleshoot?

℡╲_俬逩灬. 提交于 2019-12-25 05:23:28
问题 I have several Sitecore items (whose template is connected to an approval workflow) that will not go into Edit mode when clicking "Edit" from the "Review" tab. The same workflow is used elsewhere on the site successfully (the site is more than 3 years old), but clicking Edit in this case doesn't seem to affect the workflow state. I've turned on verbose logging, which provides a lot of detail, but nothing to indicate any error conditions. I've been comparing how this template is configured

Sitecore 6.5 rev. 120247 media urls adding a leading slash

泄露秘密 提交于 2019-12-25 05:14:59
问题 To be able to use Edgecast CDN, we had to write a custom media provider which worked well with before the site was upgraded from 6.5 rev 111230 to 120427. After the upgrade, none of the images showed up on the website. I debugged the code and found a probable cause. In the upgrade following fix was included - By default, media URLs will now be generated relative to the site root (such as /~/media/images/picture.ashx or /virtualFolder/~/media/picture.ashx) instead of relative to the current

Referenced assembly can not read app.config

这一生的挚爱 提交于 2019-12-25 05:07:28
问题 I'm having problems with my unit tests. The problem is: I'm using Sitecore. Another question I asked about this is: Unit Testing Sitecore LicenseManager My problem is that I get the exception: Test method foo.Bar.Framework.Tests.Core.UnitTest1.TestMethod1 threw exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Sitecore.Services.Heartbeat' threw an exception. --->

Referenced assembly can not read app.config

↘锁芯ラ 提交于 2019-12-25 05:07:02
问题 I'm having problems with my unit tests. The problem is: I'm using Sitecore. Another question I asked about this is: Unit Testing Sitecore LicenseManager My problem is that I get the exception: Test method foo.Bar.Framework.Tests.Core.UnitTest1.TestMethod1 threw exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'Sitecore.Services.Heartbeat' threw an exception. --->

What is the best way to join Sitecore Analytics (OMS) Session and Global Session data for conditional rules, reports, etc.?

坚强是说给别人听的谎言 提交于 2019-12-25 04:09:37
问题 I'm a new Sitecore Analytics developer (Sitecore 6.3.1), and I'm wondering what is going on with Sessions and GlobalSessions with regard to storing Profiles data. Upon reading the Analytics Configuration Reference, I see that: Analytics profiles differ from security profiles and analytics tags. Analytics profiles apply to individual sessions in individual Web clients rather than to users or global sessions. I want to accumulate scores for users based on the Global Session, but looking at the

Sitecore: We experienced a technical difficulty while processing your request. Your data may not have been correctly saved

雨燕双飞 提交于 2019-12-25 02:09:45
问题 It is throwing the following exception after submitting the data using Web form created after it is upgraded from Web Form for Marketers 2.1.0 to 2.3.0. Followed the step by step upgrade instructions. Exception in the Log file: 6772 22:24:13 WARN Web Forms for Marketers: an exception: has occured while trying to execute an action. Error/Warning on the UI: Sitecore: We experienced a technical difficulty while processing your request. Your data may not have been correctly saved However, it is

Sitecore - Web Forms for Marketers - Send Mail Editor: No option was shown on the Insert Field drop down list

一个人想着一个人 提交于 2019-12-25 01:41:57
问题 I was blocked when implementing the send mail feature by Web Forms for Marketers. I have checked the user guide before and it said I could use the 'Insert Field dropdownlist' to reference the form values on the send mail editor dialog. My questions: 1. I cannot see any options on the insert field dropdownlist. Should I do any configuration to reach that? 2. I can use [EMail] on the To/CC/BCC/Subject fields to reference the value from form field, but I cannot do the same thing on the content