output
stringlengths
34
25.7k
instruction
stringlengths
81
31k
input
stringclasses
1 value
Sitecore really should ship with some CSS to make sure that placeholders don't shrink to 0px width. I've had this numerous times, and you can't click on something that's 0px wide. Try adding this to your site's css .scEmptyPlaceholder { min-width: 100px;}
Add Here not Visible in Placeholder in Experience Editor I have a scenario where the Add Here button is not visible for the placeholder I want to add a component to. I have to select other content in the placeholder and use the Go to parent component button to navigate back up to my placeholder. At that point, the appropriate Add Here button is visible and I can add a component. Two notes I think are important, the existing visible items in the placeholder are all at least grandchild descendants of the placeholder in question (they are within other nested placeholders). Also, if I do add a component to the placeholder (a direct child of my placeholder) I at least get an Add Here button directly above the added component but not between any of the other components that make up the nested placeholders. An image might help explain this better: A: The placeholder I want to add a component too but essentially, I can't select this placeholder - no Add Here button shows up. B: Component that is already within the placeholder. It has a placeholder of its own, D. C. Component that is already within the placeholder. It has a placeholder of its own, E. To add another component to A, I have to select content in D or E and use the Go to parent component button to navigate back to A. At that point, the Add Here button shows up and I can add a component to A. What experience editor magic can I do to get the Add Here button show up in placeholder A (instead of only placeholders D and E) when the add component button is clicked in the ribbon?
The SPE Gitbook provides some alternate examples using the $using:VARIABLE syntax. Example: The following will pass the $data object into the scriptblock for remote execution. Import-Module -Name SPE $session = New-ScriptSession -Username michael -Password b -ConnectionUri https://spe.dev.local $data = @{"name"="Michael"} Invoke-RemoteScript -Session $session -ScriptBlock { Write-Output "Hi $(($using:data).name)" } Stop-ScriptSession -Session $session Note: The current version of the remoting module requires you to wrap the $using:data in parenthesis if you want to directly access properties. Otherwise assign it to a variable first.
How to pass arguments to SPE's Invoke-RemoteScript I want to pass some arguments to a script block that will be run on a remote Sitecore instance via SPE remoting. I wrote this script as a test, but it's not working. $session = New-ScriptSession -ConnectionUri "http://sc81up3" -Username admin -Password b Invoke-RemoteScript -Session $session -ScriptBlock { param($name) Write-Output "hi $name" } -Arguments @{"name"="Ben"} Stop-ScriptSession -Session $session This wasn't my first attempt. I tried, just passing "Ben" as the Argument parameter, but that caused an error about not being able to convert a string to a hashtable. When I pass the hashtable as shown above, I don't get an error, but the output is just hi, so it seems the value isn't getting passed. What is the correct way to pass arguments to the script block executed by Invoke-RemoteScript?
You need to add a datasource for the rendering, with the data using the Coveo Search Box Parameters template. So using the syntax @Html.Sitecore().Rendering("RENDERING ID", new { DataSource = "DATASOURCE ID" }) will do it.
Add Coveo rendering statically I'm trying to add a Coveo search box view to my page statically, using @Html.Sitecore().Rendering("ID OF RENDERING"). I created my own copy of the rendering, and also my own copy of the rendering parameters so I could set the ID and search page in the standard values. The resources appear if I add those statically, but the search box view doesn't. The same view does appear if I add it via placeholder. Ideally, I add my header/footer statically so users can't remove them. Is there something I'm missing? It seems like this should be a no-brainer.
There are two ways of doing that: create your theme using Create new Site dialogue create your theme manually 1. Create new Site dialogue Create New Site dialogue lets you create your own theme. To do it you need to switch to Theme tab and check Create new theme checkbox After that your site theme will be created somewhere here: /sitecore/media library/Project/Tenant/Site/My Site Theme 2. Create your theme manually If you want to do it manually you need to repeat script steps. What scaffolding script does is: create new Theme item assign theme base templates copy all content of Basic theme under your new Theme assign your new theme to allowed/compatible themes in your site settings You can configure them here: Without that step, your new theme will not appear in any site options, for example here (device to theme mapping)
How to create a custom theme in SXA? SXA is coming with two predefined themes - Basic and Wireframe. They are stored in /sitecore/media library/Themes media folder and cannot be modified in Creative Exchange. What is the best way to create custom theme that I can apply to my site? I am thinking about using standard Sitecore Copying -> Copy To item menu for Wireframe theme but would like to hear if there is a better option.
With Sitecore Experience Accelerator you can forget about previous methods, however, there is nothing that will block you from using them. Before - NO SXA: you had to decide how your page will look like before you entered content (because the presentation was stored either on SV or somewhere inside different branches) you couldn't easily switch your presentation once you created your item with predefined presentation details. Option for doing that could be changing the template to use a different one with different presentation or manipulate presentation manually. Not so comfortable if we are talking about thousands of pages. Now - SXA: With SXA you can use the same approach, however, what makes it special is the fact that you can treat your items like a data storage and define presentation somewhere else. Why is it cool? Because when you've got your data and presentation decoupled you can easily change presentation details any time you want (there is so called design to template mapping). Notice that all you need to do is to change the value of a single drop down to change the Design of all pages under your site. Of course, you are not forced to define presentation details in one place and data in another. Page designs are sort of set of renderings injected onto your page but are not there in reality. You are able to add your additional renderings even that and page will render merged content at the end. Here are key points: Advantages: flexibility - you can easily switch presentation details without touching templates maintainability - you can build partial designs like normal pages (open Experience Editor and drop renderings), you couldn't manipulate presentation details using previous approaches hierarchy - data templates definition are stored under templates, where designers (presentation designers) should no go to, that's why presentation can be created on so-called Partial Designs, I think it is pretty important to keep things secure. re-usability - as you probably know page designs are build from partial designs. In this case, you can reuse existing presentation parts. Let's say you define single header partial design and then use it on different designs where content part or footer is different.
SXA Page Design vs Page Standard Values vs Page Branch Template Sitecore historically had two options for building reusable page design: Page Standard Values Branch Template Both these options allow to build composition of visual components and later build pages reusing that design. SXA has its own implementation called Page Design: In SXA, you work with reusable pieces of content and layout. A page design in SXA is a group of partial layouts that make up the design of a webpage. For example, you may need a reusable page structure for a blog page. By creating a page design for a blog, you can create a basic template that content authors can use to create content without having to worry about the design of the page. What are the benefits of SXA Page Designs and when should I use each option?
with the release of Sitecore 8.2, Sitecore added a lot of hardening in their packages. after downloading the the toolkit, you can find all hardenings in the cargopayload folder: all the enabled/disabled patchfiles and the transformations. Download the toolkit at: https://dev.sitecore.net/Downloads/Sitecore_Azure_Toolkit/1x/Sitecore_Azure_Toolkit_100.aspx
CD security hardening patch/transform We are hosting our sites in azure web apps and in process of applying security hardening. Wondering if anyone has already written a patch/transform file for below: 1. Deny anonymous users access to key folders 2. Disable client RSS feeds 3. Secure the file upload functionality 4. Improve the security of the website folder 5. Limit access to certain file types 7. Protect PhantomJS 8. Protect media requests
Is not needed because I can see Rebuild Suggested Test Index commmand is using sitecore_suggested_test_index index. Sitecore search indexes required for different types of servers in a scaled environment can be seen in below picture : https://doc.sitecore.net/sitecore_experience_platform/81/setting_up__maintaining/search_and_indexing/indexing/search_indexes_required_in_a_scalable_environment
Do content testing tasks need to run in Delivery environment? In my Sitecore 8.2 installation, i have the following tasks: +---sitecore | \---system | \---Tasks | \---Schedules | \---Content Testing | \---Calculate Statistical Relvancy | \---Rebuild Suggested Tests Index | \---Suspend Corrupted Tests | \---Try Finish Test Since i use Solr for indexing, i'm pretty confident that the Rebuild Suggested Test Index should only trigger on the Authoring environment and therefore needs to be set to Never Publish. Does anybody know whether this needs to be done for the other 3 tasks as well? Or does every Delivery server in a scaled environment need to run those 3 tasks?
You need to define your form properly for file uploads to work. The most important part is to set enctype to multipart/form-data. Normally, you should use the standard Html.BeginForm helper: @using (Html.BeginForm("VacancyDetail", "VacanciesController", FormMethod.Post, new { enctype = "multipart/form-data" })) { <input type="file" name="Resume" /> <button id="btn-save" class="btn btn-highlight" type="submit">Solliciteer direct empty form</button> } If you, for some reason, can't use a fully parameterized Html.BeginForm, use raw HTML instead: <form action="" method="post" enctype="multipart/form-data"> <input type="file" name="Resume" /> <input type="hidden" name="fhController" value="VacanciesController" /> <input type="hidden" name="fhAction" value="VacancyDetail" /> <button id="btn-save" class="btn btn-highlight" type="submit">Solliciteer direct empty form</button> </form> You can find more examples on the Haacked blog.
Sitecore Custom MVC Form with file upload, file always null I have the following model public class VacancyDetailModel { public HttpPostedFileBase Resume {get;set; } } This is my form. @using (Html.BeginForm()) { <input type="file" name="Resume" /> <input type="hidden" name="fhController" value="VacanciesController" /> <input type="hidden" name="fhAction" value="VacancyDetail" /> <button id="btn-save" class="btn btn-highlight" type="submit">Solliciteer direct empty form</button> } This is my controller [HttpPost] //[ValidateFormHandler] public ActionResult VacancyDetail(VacancyDetailModel formModel) { return this.View(model); } When I place a watch on my model, the Resume field is always null.
Currently, for enterprise installations of MongoDB, the Sitecore Best Practice for Disaster Recovery of Mongo rests solely on the Best Practices of MongoDB specifically and are not entirely different for Sitecore applications. That being said... there are some things to consider: Answering Your Specific Question Are people architecting their solutions to offer Recovery Point Objectives (RPO) to a similar level as they would with SQL (so down to minutes of data loss of data) perhaps using something like Mongo Atlas for on-premise, or is 24 hours of xDB data being lost considered acceptable - as you might get as default from Mlabs? RPO objectives are going to be tied directly to the amount of data a particular client is storing in xDB. Default configurations, you would probably get away with RPO of an hour or two, if Sitecore Analytics is being utilized lightly. If lots of custom goals, interations, and contact facets are in play and updated frequently, you may need an RPO that is pretty short, down to 15 minutes. I, personally have not implemented an RPO on mongoDB that is that short. Typically I have used 1 hour as the cut off, which is the same as I use for SQL Server full backups. (SQL Server Transaction logs are cut at 15 minutes in high volume content management implementations) Some off the cuff thoughts: The Sitecore Reporting Database, which is created through aggregation, has a deep connection to the MongoDB database. If MongoDB goes down, or the collection is deleted, this can cause a disconnect in analytics in the reporting database, which, depending on the severity, may require the reporting database to be rebuilt. In addition, in the specific event of a collection being deleted, Sitecore/MongoDB will automatically start building upon a NEW collection almost instantaneously. Which may hide any issues with MongoDB until you start clicking around Experience Profile or Experience Analytics. If MongoDB as a service goes down, the Sitecore Content Delivery servers will cache any interactions and events happening while MongoDB is down, hoping that nothing happens to the Content Delivery servers. AS soon as a MongoDB endpoint is available, Sitecore CD's will flush the cached data received. The other part of your question is asking about specific tools or services. I don't want this answer to come off as too sales-y and I don't have experience with any third party tools outside of the tools that MongoDB provides. Therefore, the rest of this answer is really going to answer your question about MongoDB best practices in general. Background Information on MongoDB DR Best Practices The architecture of mongodb -at a very high level- is not unlike that of SQL Server. Both have a file representation of a binary database/collection. Both have processes for backing up/dumping said databases and collections. So at a high level, you want to make sure that you are performing the same steps for MongoDB that you are for SQL Server. Also, important to note, that how you go about performing these steps can differ depending on both your version level of MongoDB as well as whether you are using MongoDB Cloud or a MongoDB Instance. So then the questions really become, How do you backup MongoDB? How do you restore MongoDB? Are there tools to handle this? The answer to all of these questions can be explained in the following list of tools that are available. In addition, MongoDB also has some really great white papers specifically talking about this subject: MongoDB Operations Best Practices. Backup and Its Role in Disaster Recovery MongoDB Tools MongoDB Cloud Manager MongoDB Cloud Manager continually backs up MongoDB replica sets and sharded clusters by reading the oplog data from your MongoDB deployment. MongoDB Cloud Manager creates snapshots of your data at set intervals, and can also offer point-in-time recovery of MongoDB replica sets and sharded clusters. MongoDB Ops Manager With Ops Manager, MongoDB subscribers can install and run the same core software that powers MongoDB Cloud Manager on their own infrastructure. Ops Manager is an on-premise solution that has similar functionality to MongoDB Cloud Manager and is available with Enterprise Advanced subscriptions. Probably the industry standard of managing MongoDB in general, including Disaster Recovery is to utilize the Mongo Ops Manager that is available in MongoDB Enterprise Advanced. Manual Backup with mongodump mongodump reads data from a MongoDB database and creates high fidelity BSON files which the mongorestore tool can use to populate a MongoDB database. mongodump and mongorestore are simple and efficient tools for backing up and restoring small MongoDB deployments, but are not ideal for capturing backups of larger systems. Backing Up File System Snapshots You can create a backup of a MongoDB deployment by making a copy of MongoDB’s underlying data files. In Summary As you can see, the best practices for protecting MongoDB are not unlike similar procedures that you would use with SQL Server or any other database like collection architecture. More information is readily available at MongoDB's website. In the event that you do have to restore a MongoDB to a point in time, validate that aggregation and processing is functioning normally and that no errors are in the Sitecore logs. If something gets out of sync where there might be more data in the reporting database than in MongoDB, you may be required to rebuild your reporting database. Hope this helps!
MongoDB and Disaster Recovery What are peoples best practices for MongoDB and disaster recovery? What I'm interested in is less around resilience (we have replica sets - and are looking at SaaS solutions too) but more around getting the the Mongo service back after data corruption, for example one a pesky developer deletes MongoDB data from production and it replicates around all the nodes. Are people architecting their solutions to offer Recovery Point Objectives (RPO) to a similar level as they would with SQL (so down to minutes of data loss of data) perhaps using something like Mongo Atlas for on-premise, or is 24 hours of xDB data being lost considered acceptable - as you might get as default from Mlabs? I appreciate this differs on a customer by customer basis I'm just after a feel of what other partners feel is best practice in this space.
You can enable the View tab for your role by assigning Read access to the item /sitecore/content/Applications/Content Editor/Ribbons/Chunks/View in the core database. By default the sitecore/Author role has denied access to this tab. A separate concern is whether your authors should be able to see this tab.
The content tree is hidden by default for all new users I am working on Sitecore.NET 8.1 (rev. 160302), I created a new role and added access rights on several items on it, I also made this role a member of (sitecore\Author), then I created a new user and assigned this new added role to him. When I logged in with the new created user and access the content editor I found that the content tree is hidden and the view tab is not exist on the Ribbon, when I right click on the Ribbon the view is not listed on the options as well so I am not able to show the View tab that contain the "Hidden items" checkbox, so I am able to test that the new added user is now have a privilege on a certain items depend on the roles that was assigned to him, any advise? sample of the access rights
In EXM, when creating a new message, a series of events fire that affect the message being created. For instance, setting the Body field to the correct item. These events are configured by enabling the Sitecore.EmailExperience.ContentManagement.config in the EmailExperience config folder. When issues arise with this functionality, it is normally because of a conflict between other events that might be configured. I would try disabling any custom events first and see if that solves your issue. If the issue goes away, isolate which custom event is causing the issue and identify whether it's an order of events issue, or some other issue.
New messages in EXM 3.3 don't have default values for some reason? I have a Sitecore 8.1 Update 3 instance with a fresh install of EXM 3.3. Everything seems to be set up correctly. I have set it up so the Newsletter message type is available. So I can create a new one time message using the Newsletter message type. However it seems like for some reason Sitecore is not copying over all of the default values for the Newsletter message root whenever I create a new message. For example, I just went in to EXM and created a new Newsletter message called "Test 5". If I go to the content tree I notice that there is a message item at the following location: /sitecore/content/Email Campaign/Messages/2016/10/12T193103/Test 5 So that seems correct. But if I look at the Test 5 item I notice that there is nothing in the Body field. And if I go to /sitecore/content/Email Campaign/Messages/2016/10/12T193103/Test 5/Newsletter Root and look at the Presentation Details I notice that there is nothing defined there. It's like for some reason when Sitecore created the Test 5 item it didn't use any of the default values. Any idea why? EDIT: Also, I looked in my log files and I can't see anything that would explain this.
Although Sitecore has great support for multi-site and multilingual implementation, there is no 'silver bullet' design that works for every situation. Below I described four options we use for our sites. Hopefully you can use one of them or build your own. 1. Separate Site MyWebsite.com |-Page1 |-Page2 MyWebsite.eu |-Page1 |-Page2 Every region gets its own web domain and pages. Content can be shared using data sources. 2. Separate Content MyWebsite.com |-us |-Page1 |-Page2 |-eu |-Page1 |-Page2 Similar to previous option, but now regions are separated as subfolders under the same domain. 3. Shared Content MyWebsite.com |-Page1 |-Page2 With this option all the pages are shared. Region specific content implemented using personalization rules or custom code. 4. Mix of Shared and Separate content MyWebsite.com |-Page1 |-Page2 MyWebsite.eu |-Page1 |-Page2 Shared |-SharedSection1 |-SharedPage1 |-SharedPage2 |-SharedSection2 |-SharedPage3 |-SharedPage4 This is the most advanced scenario and it combines benefits of previous options. Page is accessible only under one site if it is added under site folder. If you want to share the page it should be stored under shared folder. That implementation requires some coding: Link Provider to generate links to shared pages Item Resolver to find shared pages per request (subfolders should help identify if request should be routed to shared folder) Sitemap to generate links to shared pages Canonical Meta Tag to make Google and Bing happy As you can see, in all these scenarios language it is not used for splitting content between regions. Language is used only for translation. If you you decide to use language for defining regions, remember about potential issues: Not every combination of languages and regions are supported. You can find yourself building artificial language like Brazilian English (en-BR). That language cannot be parsed by .NET and you will get an error. For cases like Canadian French (fr-CA) and France French (fr-FR) version specific content is not shared. These are formally two different languages and content should be duplicated or you need to implement language fallback.
Common structure for multi-region, multi-lingual website setup Question on what is the most common or preferred content tree structure for a multi-region, multi-lingual setup. Our current content tree looks like this: MyWebsite.com | |-USA | |-AboutUs.aspx (en) | |-Europe | |-AboutUs.aspx (en, fr-fr, de-de) One thing to note about the current setup: Data sources are not being used so the content on the AboutUs.aspx page under Europe in en can be entirely different than the same page under USA. It is extremely cumbersome to add a new region as the whole content tree for a current region needs to be duplicated and every link updated/changed. What I am looking for validation on is that a content similar to the following is more standard within Sitecore. MyWebsite.com |-AboutUs.aspx (en-us, en-eu, de-de) Data Sources |-AboutUs (en-us, en-eu, fr-fr, de-de) In this example, we have a single language for each region/language combination. If we wanted to add a new region it would be as simple as adding the supporting language. The data source for the page would be maintained in multiple languages but the visible page would only be available in the published versions of the page. In the above example fr-fr is available in the data source but not on the website. If anyone has any insight into this it would be great. Thanks!
You mentioned in comments that you're getting an error—this is because there is no tag in my docker hub repository. I wouldn't know which version of Sitecore latest should be build against: 8.2 or 8.1 update 3, and on the top of that, which version of SolR. So I choose to go with the tag 8.2. So you would have to pull it with the following command: docker pull istern/solr-sitecore:8.2 I will create a latest when I have the time so it is easier to pull, so a big sorry that this wasn't clear from the beginning. Now in regards to running the entire Sitecore setup in a Docker container, you would have to switch to using a Windows container. Note that the Solr container I built is a Linux version. So to answer the initial question, you would have to install the latest beta of Docker found here, choose "Beta": https://docs.docker.com/docker-for-windows/ Make sure your Docker is using Windows containers, and you are running on windows 10 latest update. And yes i have a version Sitecore 8.2 running in docker using Lucene, Windows, Mongo, Sql Express 2016. You cant mix Linux and Windows containers yet. Pbering did a post on setting up Docker and Sitecore. You can find it here: http://invokecommand.net/posts/sitecore-and-docker-today I'm also working on a post on this but this is still just a work in progress. There is a windows mongo image created microsoft see it here https://hub.docker.com/r/microsoft/sample-mongodb/
How do I run MongoDB and SOLR Docker images that work with Windows Server 2016? I'm trying to configure my Sitecore 8.2 instance in a Docker container using Windows Server 2016. I've been able to successfully setup IIS in a Docker container, but am unable to find any containers/layers that contain Windows versions of MongoDB and SOLR, which means that I can't really run Sitecore inside of Docker. Question Has anyone else been able to make this happen? Where do I get the Windows versions of those services for Docker?
Coveo will first add the new items and then send a delete order for the older ones. This mean that you do not need to configure anything in Coveo to be able to query the index while rebuilding. Versions of Coveo for Sitecore 3.0 prior to December 2014 do not have this feature. Upgrading is the only option.
Online index rebuild? I've used Solr for previous Sitecore projects, but I'm looking at Coveo for my latest project. Similar to the Solr core swap: does Coveo provide the ability to rebuild an index, while still maintaining the old version of the index during the rebuild?
I've had this same issue with deployments, the simple fix for us was to set Source Web Project to None on the General tab. This does mean that TDS will not generate code packages, but we do not use those in our build process, we only use TDS to generate Item packages. Also leave the Sitecore Web Url and Sitecore Deploy Folder empty for Release build:
Can I "build" a TDS project without having it attempt to deploy? Is there a way to build TDS projects without it trying to deploy anything? Essentially, I just want to make sure all the files that the scproj files think should be there are actually checked into source control. We are having a fairly consistent issue where certain fields are added to the TDS project but ultimately don't make it into source control. Even with auto-sync enabled. I enabled the Build action (and left Deploy unchecked) on the TDS projects for our CI build configuration, but the build failed with: Deploy failed. Reason: Could not find the TDS service located at 'http://local-dev-url/_DEV/TdsService.asmx'. Please verify that the deployment properties for the current configuration are set correctly. I don't want it to attempt a deploy, I just want the build to validate the structure of the TDS project and fail if files are missing.
You would need to use an XmlTransform to do this. If you look at the Habitat demo site you can see examples of how to do this. Creating the transform file You would add your connection string to a ConnectionStrings.config.transform file - this can live in your project in the App_Config folder. The file is a standard config transform file. Example: <?xml version="1.0"?> <connectionStrings xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <add name="MyDB" connectionString="value for the deployed Web.config file" xdt:Transform="Insert" /> </connectionStrings> Merging the transform If you are using the gulp file from the Habitat example, there is already a task that will apply the transforms in the solution: 04-Apply-Xml-Transform If you are not using that script, you can do the same thing. It calls MSBuild with an applytransform.targets file. The targets file contains: <Project ToolsVersion="14.0" DefaultTargets="ApplyTransform" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(MSBuildToolsVersion)\Web\Microsoft.Web.Publishing.Tasks.dll" /> <Target Name="ApplyTransform"> <ItemGroup> <Transform Include="$(TransformFile)" /> <ConfigsToTransform Include="$(FileToTransform)" Condition="Exists(@(Transform))"> <TransformPath>%(Transform.Identity)</TransformPath> </ConfigsToTransform> </ItemGroup> <Message Text="@(ConfigsToTransform)"></Message> <Message Text="@(Transform)"></Message> <TransformXml Source="$(WebConfigToTransform)\%(ConfigsToTransform.Identity)" Transform="%(ConfigsToTransform.TransformPath)" Destination="$(WebConfigToTransform)\%(ConfigsToTransform.Identity)" Condition="Exists(@(Transform))"/> </Target> </Project> So you can use the MSBuild command line to use that: msbuild applytransforms.xml /t:ApplyTransforms More information about how to set this up is here: https://msdn.microsoft.com/en-us/library/dd465326(v=vs.110).aspx http://helix.sitecore.net/principles/configuration/managing-config-files.html#other-config-files
How or where should I add a required connection string for a feature in Helix? A feature requires adding a new connection string. Which should be the way to do this in Helix?
As per the Sitecore Nuget feed, https://sitecore.myget.org/feed/sc-packages/package/nuget/Sitecore.Services.Client, these are the required assemblies/frameworks needed by the Sitecore.Services.Client assembly: .NET Framework 4.5 (or higher depending on the Sitecore version being used) Sitecore.Kernel Sitecore.Services.Core Microsoft.Extensions.DependencyInjection.Abstractions (= 1.0.0)
Minimum Sitecore references required to implement an API solution using Sitecore.Services.Client framework? I have been doing some reading on Sitecore.Services.Client framework for a project for which I am required to use and consume Sitecore as a data repository. The data in Sitecore will be some Html content blocks as well as some Dictionary items for the pages that are not hosted in Sitecore CMS. What are the minimum Sitecore assemblies I should need to reference in my project?
Sitecore stores language-specific text fields in Solr by adding a suffix that corresponds to the locale name. The field for the cs-cz locale is missing in the index schema, so you'll need to add it. In the schema.xml of every Solr index, insert the following node under <fields>: <dynamicField name="*_t_cs" type="text_general" indexed="true" stored="true" /> If you have any other languages defined in Sitecore, check that their corresponding locale-specific fields are also mapped as dynamic fields. For more information on setting up Solr with Sitecore, check this tutorial: https://sitecore-community.github.io/docs/search/solr/Configuring-Solr-for-use-with-Sitecore-8/#optional-development-step
Error when rebuilding a Solr index: unknown field '__display_name_t_cs' I am getting this error when trying to rebuild my master index in Solr: Job started: Index_Update_IndexName=sitecore_master_index_solr|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state) at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size) at SolrNet.Impl.SolrConnection.CopyTo(Stream input, Stream output) at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters) at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s) at SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd) at Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.AddRange(IEnumerable`1 group, Int32 groupSize) at Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.Commit() at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.PerformRebuild(Boolean resetIndex, Boolean optimizeOnComplete, IndexingOptions indexingOptions, CancellationToken cancellationToken) at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Rebuild(Boolean resetIndex, Boolean optimizeOnComplete) --- End of inner exception stack trace --- 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 (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Jobs.Job.ThreadEntry(Object state) The Solr logs are showing this error: org.apache.solr.common.SolrException: ERROR: [doc=sitecore://master/{bfde3d21-3a67-4938-aa90-33da9caf7bf5}?lang=cs-cz&amp;ver=1] unknown field '__display_name_t_cs'
There's a couple clues here that I think I can attempt to provide some troubleshooting steps in order to answer your question. Now, before getting too far along, because the error is occurring in the publish:end handler all active publishing tasks for the items have already finished which is why it appears the publish was successful. A Few Clues You mention you have a separate publishing instance, so going on the assumption you've configured the Scaling config. The error details out publish:end event handler, which indicates that the issue is within that handler. Running Sitecore 8.1 with Solr Taking a look at publish:end Events In a default configuration for Sitecore 8.1 Update 3, we have the following event handlers for publish:end: <event name="publish:end"> <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache"> <sites hint="list"> <site>website</site> </sites> </handler> <handler type="Sitecore.Publishing.RenderingParametersCacheClearer, Sitecore.Kernel" method="ClearCache" /> <handler type="Sitecore.ContentSearch.Events.PublishingEventHandler, Sitecore.ContentSearch" method="OnFullPublishEndHandler" patch:source="Sitecore.ContentSearch.config" /> <handler type="Sitecore.ContentSearch.Events.PublishingEventHandler, Sitecore.ContentSearch" method="OnPublishHandler" patch:source="Sitecore.ContentSearch.config" /> <!-- ACTIVE TEST CACHE CLEARER This event handler clears data from the ActiveTest cache --> <handler type="Sitecore.ContentTesting.Events.ActiveTestCacheClearer, Sitecore.ContentTesting" method="Process" patch:source="Sitecore.ContentTesting.config" /> <handler type="Sitecore.Social.Client.MessagePosting.Handlers.PublishEndHandler, Sitecore.Social.Client" method="ClearDbMesageCache" patch:source="Sitecore.Social.config" /> </event> By looking at a default configuration, there are a few places where an error might occur. Again, this is the default configuration which means the error may be in any kind of custom code that you've created, if you have a custom publish:end handler. Going on the assumption you don't. Things to Verify The site(s) listed for the HtmlCacheClearer are accurate to your environment. Is SOLR Running at the configured endpoint? Other Potential Causes Not with publish:end specifically, but I have seen weirdness out of ContentTesting. There is a ContentTesting event handler in the stock configuration. If you wanted to rule out, you could disable this handler in the Sitecore.ContentTesting.config file. Are you using Glass? Glass Mapper for Sitecore has a publish:end event that clears the Glass Cache. If, for some reason, this cache was unavailable or missing, theoretically it might cause an error. Need more info? To troubleshoot this further, you'll want to provide the following information: Excerpt of Sitecore Log and Publishing Log file during the publish event. Copy of your publish:end events from /sitecore/admin/showconfig.aspx Hope this helps!
"An error occurred while publishing" I'm getting an exception after every publish from CM, but the publishing is happening correctly. I'm using Sitecore 8.1, Solr Search, and a separate publishing instance.
Basically, it is a kind of difficult sometimes to query the MongoDB directly, I had a similar scenario and following what I did: I created aggregation processor that will be called when you rebuild the analytics database or when aggregation occurs: public class PageEventProcessor : AggregationProcessor { protected override void OnProcess(AggregationPipelineArgs args) { Assert.ArgumentNotNull(args, "args"); var fact = args.GetFact<PageEvent>(); foreach (var page in args.Context.Visit.Pages) { try { foreach (var pEvent in page.PageEvents) { try { var eventkey = new PageEventKey { EventId = pEvent.PageEventDefinitionId, Date = args.DateTimeStrategy.Translate(pEvent.DateTime), ItemId = pEvent.ItemId, PageId = page.Item.Id }; var eventValue = new PageEventValue { Count = 1 }; fact.Emit(eventkey, eventValue); } catch (Exception ex) { } } } catch(Exception ex) { } } } } Classes needed: public class PageEventValue : DictionaryValue { public int Count { get; set; } internal static PageEventValue Reduce(PageEventValue left, PageEventValue right) { var profileValue = new PageEventValue { Count = left.Count + right.Count }; return profileValue; } } public class PageEvent : Fact<PageEventKey, PageEventValue> { public PageEvent() : base(PageEventValue.Reduce) { } } public class PageEventKey : DictionaryKey { public Guid EventId { get; set; } public Guid PageId { get; set; } public Guid ItemId { get; set; } public DateTime Date { get; set; } } Also you need to include the following configuration: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <group groupName="analytics.aggregation"> <pipelines> <interactions> <processor type="DllName.PageEventProcessor, DllName" /> </interactions> </pipelines> </group> </pipelines> </sitecore> </configuration> Hope this help!
How can I create a custom report in Experience Analytics? I'm pretty new at Sitecore, so I don't know if this is possible. I am able to log some custom page events (click on an anchor on the client side) in xDB. I can then query this with Robomongo. But besides that I need to create a report that displays this information. How can I create a new report in Experience Analytics that accesses the information in MongoDB? I have been trying to pass the MongoDB values to a fact table in the Reporting database, but no luck so far.
Background information The answer depends on your environment configuration. If you have a single server setup (i.e. the server is configured as both CD and CM) the solution is simple (read on), if the server roles are split on multiple servers e.g. one CD server, one CM etc. the solution is a bit more complicated. That being said, Sitecore.Modules.EmailCampaign.ClientApi() is the right entry point for working (programmatically) with EXM. On a scaled environment this ensures that if you call e.g. Sitecore.Modules.EmailCampaign.ClientApi .SendStandardMessage(new Guid(MessageId), new XdbContactId(contact.ContactId), true); from a CD server, the dispatch will be made from the CM server as the ClientAPI makes a request to the ecmclientservice.asmx (as defined in the connection string, see configuring EXM in a scaled environment). This is necessary as the CD role is not configured to dispatch, and in most cases you don't want it to be, as this can take up a lot of resources. Unfortunately the ClientAPI does not currently support custom tokens for automated messages. Solution Assuming you have created and activated the following automated (previously known as triggered) message (highlights added for tokens): The method Sitecore.Modules.EmailCampaign.Application.EmailDispatch.EmailDispatch.SendTriggered(Guid messageId, RecipientId recipientId, bool usePreferredLanguage = false, IDictionary<string, object> customPersonTokens = null) supports exactly what you're trying to do, for example: var customPersonTokens = new Dictionary<string, object> { {"meterreading", "your reading" } }; SendTriggered(new Guid(MessageId), new XdbContactId(contact.ContactId), true, customPersonTokens); This will apply both the default tokens (e.g. fullname and email) and the custom tokens, in that order. This can be executed directly on a single server setup, but for the reasons stated above you will need to create an endpoint on the CM server that you can call from the CD server on a scaled setup. The CM server should execute the SendTriggered() message, and the CD server should send the contact id, message id and any custom tokens. Side note about default tokens The default tokens are defined in Sitecore.Modules.EmailCampaign.Core.Personalization.DefaultRecipientPropertyTokenMap() You are unable to add your own facets to this, but you can replace it with your own implementation by changing the following element in Sitecore.EmailExperience.Core.config: <recipientPropertyTokenMap type="Sitecore.Modules.EmailCampaign.Core.Personalization.DefaultRecipientPropertyTokenMap, Sitecore.EmailCampaign" singleInstance="true" />
Passing data to emails sent through EXM We are facing a problem with sending trigger-emails from EXM. We have created a page with a custom HTML form used for meter readings. The business logic is as follows: The user receives an email with a link to the meter reading page He enters the page He enters data related to the reading, along with the meter reading itself He submits the form An email is triggered to be sent, based on the data he entered in the form He is redirected to a different page with The challenge is to get the entered data from the form submission (3 and 4) to be available for EXM when creating the email (5). We have on earlier occasions worked around the problem by saving the form data on the contact in the xDB, and making an assumption that the data is correct when EXM accesses it. In this case we cannot use that approach, because the user might enter multiple meter readings within a short period of time (opening up for challenges with timing, data storage, etc.). After flushing data to the xDB, we currently use the following line of code to send the email through EXM: Sitecore.Modules.EmailCampaign.ClientApi .SendStandardMessage(new Guid(MessageId), new XdbContactId(contact.ContactId), true); Is there a better way to trigger the emails using EXM, where it is possible to pass data directly to EXM (i.e. not saving the data to xDB)?
Explanation This is not an expected behavior. This is a defect in the Sitecore XML patching engine. In the method Sitecore.Xml.Patch.XmlPatchHelper.InsertChild(), there's the following code: case 'i': // this corresponds to patch:instead parent.InsertBefore(child, xmlNode); parent.RemoveChild(xmlNode); So in your case, the new <providers> element is first inserted before the existing <providers> element, and then the old element is removed. The tricky thing is the implementation of the method XmlNode.InsertBefore(newChild, refChild), which is a native XML method in .NET. This method has the following check: if (newChild == refChild) { return newChild; } So if the inserted node is the same in-memory object as the original node, nothing is going to happen. The new node will not be inserted, which means that the Sitecore code at parent.RemoveChild(xmlNode) is going to remove the <providers> node altogether. I debugged through the Sitecore decompiled code and found that if both the original node and the new node have exactly the same data attributes (or no attributes at all), then object.ReferenceEquals(child, xmlNode) returns true. If the attributes differ, then it returns false, which means they are different objects and the replacement will succeed. There's a defect somewhere in XmlPatchHelper that reuses the existing XML node object instead of creating a new one, which results in nothing being inserted, which in turn means the node being patched will be completely removed. This will only happen when using patch:instead. I have registered this as a bug with Sitecore Support. If you want to track the status of the bug, use the reference number 94066. Workarounds It seems that currently you have the following options to work around this defect: Don't delete the existing providers—they won't be used anyway. First delete the whole node using <patch:delete /> and then add it from scratch. Add a bogus attribute to the patch node so that it differs from the original node. Hopefully, this will be fixed by Sitecore at some point.
`patch:instead` removes an element with no attributes I want to patch the configuration for sharedSessionState to use MSSQL instead of memory. The default configuration from Sitecore.Analytics.Tracking.config renders as such: Sitecore.Analytics.Tracking.config <sharedSessionState defaultProvider="InProc"> <providers> <clear/> <add name="InProc" type="System.Web.SessionState.InProcSessionStateStore"/> </providers> <manager type="Sitecore.Analytics.Tracking.SharedSessionState.SharedSessionStateManager, Sitecore.Analytics"> <param desc="configuration" ref="tracking/sharedSessionState/config"/> </manager> <config type="Sitecore.Analytics.Tracking.SharedSessionState.SharedSessionStateConfig, Sitecore.Analytics"> <param desc="maxLockAge">5000</param> <param desc="timeoutBetweenLockAttempts">10</param> </config> </sharedSessionState> The goal is to change the defaultProvider attribute and to replace the InProc provider. I attempt to do this with the following patch file: z.Patch.config <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <tracking> <sharedSessionState defaultProvider="InProc"> <patch:attribute name="defaultProvider" value="mssql" /> <providers patch:instead="providers"> <clear /> <add name="mssql" type="Sitecore.SessionProvider.Sql.SqlSessionStateProvider,Sitecore.SessionProvider.Sql" connectionStringName="sharedsession" pollingInterval="2" compression="true" sessionType="shared"/> </providers> </sharedSessionState> </tracking> </sitecore> </configuration> This patch results in the sharedSessionState correctly changing its defaultProvider, but the providers element is completely missing. At first I thought the patching engine couldn't find the right place to add the element, given that I changed its parent in the same configuration, but fiddling around I discovered that the following patch does include the providers element correctly: z.ModifiedPatch.config <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <tracking> <sharedSessionState defaultProvider="InProc"> <patch:attribute name="defaultProvider" value="mssql" /> <providers customAttribute="whatever" patch:instead="providers"> <clear /> <add name="mssql" type="Sitecore.SessionProvider.Sql.SqlSessionStateProvider,Sitecore.SessionProvider.Sql" connectionStringName="sharedsession" pollingInterval="2" compression="true" sessionType="shared"/> </providers> </sharedSessionState> </tracking> </sitecore> </configuration> The only change introduced in this modified patch is the addition of customAttribute="whatever" to the providers element. Why is it seemingly not possible replace an element with an attribute-less element? Is there a better work-around in general than to add a bogus attribute?
You can setup Domain Controller Firewall to accept connections on the 389 port only from the limited IP addresses and this would add an additional level of the security. Please notice that even if we do not use SSL, the connectionProtection="secure" method allows us to establish the sign-and-seal connection: http://msdn.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.aspx SignAndSeal - the connection to the Active Directory server is secured by digitally signing and encrypting each packet sent to the server. How it works: This secure method allows to try to establish SSL connection through the 636 port, and if failed, the sign-and-seal connection established through the default 389 port.
AD Module over SSL According to https://kb.sitecore.net/articles/886061 the AD module does not fully support SSL: The SitecoreADMembershipProvider provider supports SSL connection. This provider is based on System.Web.Security.ActiveDirectoryMembershipProvider, which provides functionality for SSL connection. The SitecoreADRoleProvider and SitecoreADProfileProvider providers do not support SSL connection. The Directory Notification feature which uses specific connection to the Active Directory domain, also does not support SSL connection. What functionality would I loose/not work (or what is the only functionality that would work) if I configured the the AD connection over https?
As Sitecore Climber mentioned, you could use workflows if you do not need to have a future publish date. Otherwise the Automated Publsiher module might help you, but if you really want something specifically tailored to your needs, it should not be that hard to write that yourself. You could add an agent or use other possible solutions to trigger tasks. There is a blog post here describing on how to extend the existing publish agent with extra parameters e.g. a root item path (as you requested). The trick is actually to look at the implementation and extend where needed. To give you an idea to build on, if you would like to publish only items from a template you would need to do something like this (untested): Add a property to pass the template private readonly string _template; public string Template { get { return this._template; } } You would pass the template in the config like <param desc="template">...</param>. Add parameter to constructor public CustomPublishAgent(string sourceDatabase, string targetDatabase, string mode, string languages, string template) { ... this._template = template; } Write a startPublish function to be used in the run method private void StartPublish(IEnumerable<language> languages) { .... var items = .. // get the items you need based on _template (and other stuff) - preferably use the master index var options = new PublishOptions(database1, database2, PublishMode.SingleItem, languages.FirstOrDefault<language>(), DateTime.Now) foreach (var item in items) { options.RootItem = item; Publisher publisher = new Publisher(options, languages); publisher.PublishAsync(); } } You should be aware that this will start a publish job for each item that is found with you search query. If you want to publish based on several conditions, that will be hard to avoid. But don't do this for too many items at once... End by adding your custom agent in a config patch: <scheduling> <agent type="YourNameSpace.CustomPublishAgent, YourAssembly" method="Run" interval="12:00:00"> <param desc="source database">master</param> <param desc="target database">web</param> <param desc="mode (full or incremental)">smart</param> <param desc="languages">en</param> <param desc="template">..</param> </agent> </scheduling>
Auto publishing for specific items is it possible to configure an auto publish for these scenarios: specific sections of the content tree item template specific items auto publish using the publishing restrictions values configured(from and to) I know we can use publish restrictions but as far as I know it doesn't perform an autopublish itself but configures what the timing you can publish an item(from and to) I've ran across some examples where we can configure a publish agent to run on a specific interval. that's fine but this will perform an publish on the whole database. What I'm looking for is ways to publish specifics(like described on the list above), specially configure an auto publish based on the publishing restrictions configured for the item versions.
Lucene will automatically apply that kind of weighting. It will give each record a &quot;score&quot; based on how well the document matches the term. A lot will be dependent on how you have crafted your search query of course. You can influence the score by boosting. This is the how that affects the query: Lucene allows influencing search results by &quot;boosting&quot; in more than one level: Document level boosting - while indexing - by calling document.setBoost() before a document is added to the index. Document's Field level boosting - while indexing - by calling field.setBoost() before adding a field to the document (and before adding the document to the index). Query level boosting - during search, by setting a boost on a query clause, calling Query.setBoost(). Indexing time boosts are preprocessed for storage efficiency and written to the directory (when writing the document) in a single byte (!) as follows: For each field of a document, all boosts of that field (i.e. all boosts under the same field name in that doc) are multiplied. The result is multiplied by the boost of the document, and also multiplied by a &quot;field length norm&quot; value that represents the length of that field in that doc (so shorter fields are automatically boosted up). The result is decoded as a single byte (with some precision loss of course) and stored in the directory. The similarity object in effect at indexing computes the length-norm of the field. This composition of 1-byte representation of norms (that is, indexing time multiplication of field boosts &amp; doc boost &amp; field-length-norm) is nicely described in Fieldable.setBoost(). Encoding and decoding of the resulted float norm in a single byte are done by the static methods of the class Similarity: encodeNorm() and decodeNorm(). Due to loss of precision, it is not guaranteed that decode(encode(x)) = x, e.g. decode(encode(0.89)) = 0.75. At scoring (search) time, this norm is brought into the score of document as norm(t, d), as shown by the formula in Similarity. Source Out of the box, Sitecore doesn't apply an index time boosting to your custom fields, so it will just apply a score based on how relevant your searchTerm is to the field. If you wanted to see the score, you can use the .GetResult method. public List<Item> GetSearchResults(ISearchIndex index, string searchTerm = &quot;&quot;) { var results = new List<Item>(); using (var searchContext = index.CreateSearchContext()) { if (string.IsNullOrWhiteSpace(searchTerm)) { results = searchContext.GetQueryable<SearchResultItem>().Select(n => n.GetItem()).ToList(); } else { searchTerm = searchTerm.Trim().ToLower(); var query = searchContext.GetQueryable<SearchResultItem>() .Where(n => n.Content.ToLower().Contains(searchTerm) || n.Url.ToLower().Contains(searchTerm) || n.Name.ToLower().Contains(searchTerm) || n.Fields[&quot;tags&quot;].ToString().ToLower().Contains(searchTerm)); var resultsWithScore = query.GetResult(); var firstObject = resultsWithScore.FirstOrDefault(); var score = firstObject.Score; var firstItem = firstObject.Document; results = resultsWithScore.Hits.Select(n => n.Document.GetItem()).ToList(); } } return results; } If you wanted to make Content have a higher importance than Url in the search, then you can boost by field at query time: var query = searchContext.GetQueryable<SearchResultItem>() .Where(n => n.Content.ToLower().Contains(searchTerm).Boost(2f) || n.Url.ToLower().Contains(searchTerm) || n.Name.ToLower().Contains(searchTerm) || n.Fields[&quot;tags&quot;].ToString().ToLower().Contains(searchTerm)); You can use all these features to tune your query. For the basic requirement you outlined above, Lucene should handle that without any extra coding.
Is there a "weighting" involved with Sitecore.ContentSearch.SearchTypes.SearchResultItem? I have the following code to return a List of Items in a Lucene index: public List<Item> GetSearchResults(ISearchIndex index, string searchTerm = "") { var results = new List<Item>(); using (var searchContext = index.CreateSearchContext()) { if (string.IsNullOrWhiteSpace(searchTerm)) { results = searchContext.GetQueryable<SearchResultItem>().Select(n => n.GetItem()).ToList(); } else { searchTerm = searchTerm.Trim().ToLower(); results = searchContext.GetQueryable<SearchResultItem>() .Where(n => n.Content.ToLower().Contains(searchTerm) || n.Url.ToLower().Contains(searchTerm) || n.Name.ToLower().Contains(searchTerm) || n.Fields["tags"].ToString().ToLower().Contains(searchTerm)) .Select(n => n.GetItem()) .ToList(); } } return results; } If searchTerm is not null or empty I would like to sort by a weighting based on the number of occurrences of the search term. Is this at all possible?
Content delivery should be unaffected, as you stated, unless you're doing something custom and accessing analytics data from front-end code. Reporting could be extremely slow, depending on the quantity of data in your DB. Indexes are generally disposable; they aren't the canonical source of any data. Once you rebuild the index as you describe, the index should be accurately updated for whatever data is in the DB. This post by Adam Conn supports the ability to rebuild the analytics index without losing data: https://community.sitecore.net/technical_blogs/b/getting_to_know_sitecore/posts/rebuilding-the-sitecore-analytics-index
What are the consequences of disabling the analytics index? If I were to delete the data from the analytics index, and then disable the observables declared in the in the crawlers defined here, Sitecore.ContentSearch.Lucene.Index.Analytics.config <index id="sitecore_analytics_index" ...> ... <locations hint="list:AddCrawler"> <crawler type="Sitecore.ContentSearch.Analytics.Crawlers.AnalyticsVisitCrawler, Sitecore.ContentSearch.Analytics"> <CrawlerName>Lucene Visit Crawler</CrawlerName> <ObservableName>VisitAggregationObservable</ObservableName> ... </crawler> <crawler type="Sitecore.ContentSearch.Analytics.Crawlers.AnalyticsVisitPageCrawler, Sitecore.ContentSearch.Analytics"> <CrawlerName>Lucene Visit Page Crawler</CrawlerName> <ObservableName>VisitPageAggregationObservable</ObservableName> ... </crawler> <crawler type="Sitecore.ContentSearch.Analytics.Crawlers.AnalyticsVisitPageEventCrawler, Sitecore.ContentSearch.Analytics"> <CrawlerName>Lucene Visit Page Event Crawler</CrawlerName> <ObservableName>VisitPageEventAggregationObservable</ObservableName> ... </crawler> <crawler type="Sitecore.ContentSearch.Analytics.Crawlers.AnalyticsContactCrawler, Sitecore.ContentSearch.Analytics"> <CrawlerName>Lucene Contact Crawler</CrawlerName> ... <observables hint="list:AddObservable"> <observable>ContactAggregationObservable</observable> <observable>ContactChangeObservable</observable> </observables> </crawler> <crawler type="Sitecore.ContentSearch.Analytics.Crawlers.AnalyticsContactTagCrawler, Sitecore.ContentSearch.Analytics"> <CrawlerName>Lucene Contact Tag Crawler</CrawlerName> ... <observables hint="list:AddObservable"> <observable>ContactTagAggregationObservable</observable> <observable>ContactTagChangeObservable</observable> </observables> </crawler> <crawler type="Sitecore.ContentSearch.Analytics.Crawlers.AnalyticsAddressCrawler, Sitecore.ContentSearch.Analytics"> <CrawlerName>Lucene Address Tag Crawler</CrawlerName> ... <observables hint="list:AddObservable"> <observable>AddressAggregationObservable</observable> <observable>AddressChangeObservable</observable> </observables> </crawler> </locations> what functionality would be affected in Sitecore? My understanding is it would only affect reporting and not the actual collection of the analytics data, as that is all collected into the XDB. If, after doing this, I re-enabled the observables and initiated a rebuild of the Reporting Database, would we get this data back in the analytics index and the reports would be available again?
There is no out of the box way to do this, you need to customize Sitecore.Context.SetLanguage function as /// <summary> /// Sets the current language. /// This to extend the sitecore default SetLanguage behavior by adding expiration date for the language cookie /// </summary> /// <param name="language">The language.</param> /// <param name="persistent">if set to <c>true</c>, the value will be persisted (in a cookie).</param> /// <param name="ExpirationDate">The cookie expiration date, presistent should be set to <c>true</c> too </param> public static void SetLanguage(Language language, bool persistent, DateTime ExpirationDate) { Assert.ArgumentNotNull(language, "language"); Context.Items["sc_Language"] = language; if (!persistent) { return; } SiteContext site = Context.Site; if (site != null) { string cookieKey = site.GetCookieKey("lang"); if (WebUtil.GetCookieValue(cookieKey) != language.Name) { WebUtil.SetCookieValue(cookieKey, language.Name, ExpirationDate); } } } I added more details at my blog : http://alkouki.blogspot.com/2016/11/extend-sitecorecontextsetlanguage-to.html
Setting expiry date for Sitecore Language cookie Sitecore does not seem to set the expiry date for the language cookie, Which means it will be stored per "session", meaning If user switch language on the site then closes the browser and open it again, the language will be set back to the default language. Anyone was able to set the expiry date for the language cookie in sitecore?
After some experimentation, I found the cause of the issue. If you look at the IAssetOverviewModelMap code above, you'll see this line: config.Field(f => f.HeaderPrefix).FieldName("AssetOverviewContentHeaderPrefix"); The field name seems kinda long, right? We were prepending the category name onto the field name in order to avoid any duplicate names in items since we do a fair amount of inheritance. That's where the problem lies. When I removed the "AssetOverviewContent" from the field names, everything worked fine. Based on this, I did some more experimentation. I found that field names up to 23 characters long worked just fine. 24 or more and they won't map. I have no idea why this number in particular is the limit, but my guess is that there's some other mapping going on somewhere that's hitting a limit. A little more experimentation also found that mapping using FieldId also doesn't work. Guids are going to be more than 23 characters long, so that makes some sense. However, you can't really do a guid in less than 23 characters so I can't confirm. I may end up looking at the Glass Mapper code sometime soon to see if I can track down the answer. But now that I know there's a problem, I can avoid it.
Glass Mapper not mapping some item properties (I'm using Sitecore 8.1 Update 3 with Glass Mapper.Sc version 4.1.1.66) I've run into an issue where some of the properties of a Sitecore item are not being populated in code through Glass Mapper. The values in our Content Base item (Id, Name, Display Name, typical Sitecore fields) seem to be getting populated correctly, but the child item's fields (I'll call it Overview) aren't mapped at all. They're all strings but they all end up null, even though the Content Base's values look to be correct. We also have child class maps working in other areas of the same, so that may not be the cause here. Earlier in this project, we had an issue with Glass Mapper where field names that included spaces were not being read. However, I've made sure to leave out any spaces in field names, but this doesn't solve the issue. Another possible contributor to the issue is that we have multiple languages on the site, so it's conceivable that language fallback may be complicating things. However, we have fallback enabled and working properly across the site without issues. (EDIT: I have tried applying the VersionCountDisabler, but that didn't help.) I can post code if needed, but for the most part, it's just POCO's and mapping classes. Any ideas on what other parts I should be looking into? EDIT: Adding code Mapping class: namespace TheProject.Sc.Feature.Asset.Model.Configuration { [ExcludeFromCodeCoverage] public class IAssetOverviewModelMap : SitecoreGlassMap<IAssetOverviewModel> { public override void Configure() { Map(config => { ImportMap<IContentBase>(); config.AutoMap(); config.Field(f => f.HeaderPrefix).FieldName("AssetOverviewContentHeaderPrefix"); config.Field(f => f.MarkUnitUnavailableText).FieldName("AssetOverviewContentMarkUnitUnavailableText"); config.Field(f => f.PdfButtonText).FieldName("AssetOverviewContentPdfButtonText"); config.Field(f => f.EditRecordButtonText).FieldName("AssetOverviewContentEditRecordButtonText"); config.Field(f => f.SaveButtonText).FieldName("AssetOverviewContentSaveButtonText"); }); } } } And here's a working mapping, which is called above and does just fine.: namespace TheProject.Sc.Foundation.Model.Configuration { public class IContentBaseMap : SitecoreGlassMap<IContentBase> { public override void Configure() { Map(config => { config.AutoMap(); config.Id(m => m.Id); config.Info(m => m.Name).InfoType(SitecoreInfoType.Name); config.Info(m => m.DisplayName).InfoType(SitecoreInfoType.DisplayName); config.Info(m => m.Path).InfoType(SitecoreInfoType.Path); config.Info(m => m.Url).InfoType(SitecoreInfoType.Url); config.Info(m => m.FullPath).InfoType(SitecoreInfoType.FullPath); config.Info(m => m.TemplateName).InfoType(SitecoreInfoType.TemplateName); config.Info(m => m.TemplateId).InfoType(SitecoreInfoType.TemplateId); config.Field(f => f.Sortorder).FieldName("__Sortorder"); // This line always returns 0, even when Sortorder is set differently }); } } }
I did some research and for simple scenario unpublished content is deleted from the index. In my case, it was Lucene, but that shouldn't be really matter because all relevant code is stored in Sitecore.ContentSearch.dll. Scenario that I executed: Create the Item Publish it In Item Publishing Setting uncheck Publishable check-box Publish Item again Now lets talk about what happens behind the scene when last step from that scenario is executed and how you can trace these actions to see what does not work in your case. Schedule Publishing Publishing Start event is tracked in Core database. Checks EventQueue table in Core to find recent StartPublishingRemoteEvent event. I used SQL query below for that: SELECT TOP 100 * FROM [MySiteSitecore_Core].[dbo].[EventQueue] order by Created desc This is key data from that event: InstanceType - Sitecore.Publishing.StartPublishingRemoteEvent, Sitecore.Kernel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null InstanceData - {&quot;ClientLanguage&quot;:&quot;en&quot;,&quot;EventName&quot;:&quot;publish:startPublishing&quot;,&quot;Options&quot;:[{&quot;CompareRevisions&quot;:false,&quot;Deep&quot;:false,&quot;FromDate&quot;:&quot;/Date(1478021589129)/&quot;,&quot;LanguageName&quot;:&quot;en&quot;,&quot;Mode&quot;:3,&quot;PublishDate&quot;:&quot;/Date(1478051240384)/&quot;,&quot;PublishRelatedItems&quot;:false,&quot;PublishingTargets&quot;:[&quot;{8E080626-DDC3-4EF4-A1D1-F0BE4A200254}&quot;],&quot;RecoveryId&quot;:&quot;c97366e7-7272-4314-9fa3-66accb915a02&quot;,&quot;RepublishAll&quot;:false,&quot;RootItemId&quot;:&quot;ef9ec5da-53ca-453a-b57f-4b8ff33166c5&quot;,&quot;SourceDatabaseName&quot;:&quot;master&quot;,&quot;TargetDatabaseName&quot;:&quot;web&quot;,&quot;UserName&quot;:&quot;sitecore\admin&quot;}],&quot;PublishingServer&quot;:&quot;DESKTOP-3E7ETU9-Sitecore82&quot;,&quot;StatusHandle&quot;:{&quot;instanceName&quot;:&quot;DESKTOP-3E7ETU9-Sitecore82&quot;,&quot;m_handle&quot;:&quot;83a9d418-514c-45fd-ac44-4d4dbc5ec0e9&quot;},&quot;UserName&quot;:&quot;sitecore\admin&quot;} Created - 2016-11-02 01:47:20.387 (UTC timezone) That row contains full definition of publishing process. Publishing Sitecore takes publishing definition from previous steps and based on that definition it finds all the Items to be affected. With that list it executes modifications over these items in Web database. Traces of these modifications stored in EventQueue table but in Web database. We are looking here for DeletedItemRemoteEvent event. This is what I found in my case: Instance Type - Sitecore.Data.Eventing.Remote.DeletedItemRemoteEvent, Sitecore.Kernel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null InstanceData - {&quot;ItemId&quot;:&quot;ef9ec5da-53ca-453a-b57f-4b8ff33166c5&quot;,&quot;ItemName&quot;:&quot;TestItem&quot;,&quot;LanguageName&quot;:&quot;en&quot;,&quot;TemplateId&quot;:&quot;76036f5e-cbce-46d1-af0a-4143f9b557aa&quot;,&quot;VersionNumber&quot;:1,&quot;ParentId&quot;:&quot;110d559f-dea5-42ea-9c1c-8a5df7e70ef9&quot;} Created - 2016-11-02 01:47:20.860 (UTC timezone) With that information Sitecore knows what and how was modified in Web. There is lots of other events to cover other scenarios. These are events that BaseAsynchronousStrategy is looking for: eventQueueQuery.EventTypes.Add(typeof(RemovedVersionRemoteEvent)); eventQueueQuery.EventTypes.Add(typeof(SavedItemRemoteEvent)); eventQueueQuery.EventTypes.Add(typeof(DeletedItemRemoteEvent)); eventQueueQuery.EventTypes.Add(typeof(MovedItemRemoteEvent)); eventQueueQuery.EventTypes.Add(typeof(AddedVersionRemoteEvent)); eventQueueQuery.EventTypes.Add(typeof(CopiedItemRemoteEvent)); eventQueueQuery.EventTypes.Add(typeof(RestoreItemCompletedEvent)); Index Update Sitecore uses OnPublishEndAsynchronousStrategy to update indexes built on top of Web database: <onPublishEndAsync type=&quot;Sitecore.ContentSearch.Maintenance.Strategies.OnPublishEndAsynchronousStrategy, Sitecore.ContentSearch&quot;> <param desc=&quot;database&quot;>web</param> <CheckForThreshold>true</CheckForThreshold> </onPublishEndAsync> With that strategy, Sitecore constantly compares index last update time-stamp and time-stamp of last event in event queue to detect events happened after index being updated. If such events found, Sitecore checks events queue in Web database to see what data was modified. Based on these findings, OnPublishEndAsynchronousStrategy generates list of IndexableInfo objects and later concrete Index provider (Lucene or Solr) pushes data to the Index. The simplest way to find if that happened is to check Crawling log. My log contains these entries (set Debug mode in Log config to see all the entries): 12792 21:47:21 DEBUG [Index=sitecore_web_index] OnPublishEndAsynchronousStrategy executing. 12792 21:47:21 INFO [Index=sitecore_web_index] Updating '1' items from Event Queue. 12792 21:47:21 DEBUG IndexCustodian. IncrementalUpdate triggered on index sitecore_web_index. Data=Count=1 ManagedPoolThread #16 21:47:21 DEBUG [Index=sitecore_web_index] Committing: Add: 0; Update:0; DeleteUnique: 0; DeleteGroup: 1 As you can see, Item was deleted. Group is a 'nickname' for Item ID in Content Search world. I am not sure if this will work for all possible scenarios, but you can use this info to troubleshoot your case. P.S. All above was checked in Sitecore 8.2.
If I unpublish an item will Sitecore update the search index? I have a Sitecore 8.1 / Solr 4.10 instance. I know that if I add a new content item or I delete a content item and then publish, that Sitecore is smart enough to do a partial rebuild of the Solr search index and that those items will either be added to or deleted from the Solr index. But what if I have a content item that is currently published to Web and then I decide to change the publishing restrictions on that item so that it is no longer published? I see that it does get removed from the Web database, but I also see that it seems to still show up in the Solr Web index. Is Sitecore smart enough to know that in that case it should also remove that item from the Solr Web index?
You can use the Sitecore Config Builder tool which is available on the Marketplace. Select the web.config for the solution and then choose where to save the resulting merged config file. This is the same result as you would see if you browsed to /sitecore/admin/showconfig.aspx but it does not require a working Sitecore instance, just the config files. This is extremely useful if you want to see final patched config for a production instance from backups or without having to set it up locally for exmaple. The Config Builder tool is also installed and accessible if you have Sitecore Instance Manager installed:
Is there a way to load the ShowConfig before Sitecore finishes initializing? I am currently setting up a production environment and I keep running into exceptions thrown while the site is initializing, due to configuration/patching issues. The fact that I can't load the ShowConfig is slowing me down and I would be able to troubleshoot and fix these issues a lot faster if I could only see it. Is there any way for me to do this?
The Sitecore config contains the following comments about these two attributes: <!-- content: Database containing items to be edited. database: Database containing items to be used for rendering the site. --> The content attribute defines the database which contains the items that will be edited from within the CMS interface. The default website entry in the <sites> section of config does not have this attribute set. Only the shell and modules_shell entry have the content attribute set to master. The database attribute defines the database to use for rendering the site. The default website entry in the <sites> section of config has this set to web. Note that different site entries may have different values set for the database attribute, for example on the shell site database=core. For a standard installation, the settings should be as follows for custom site entries: Content Management - database = web, content not set Content Delivery- database = web, content not set If you have multiple publish targets that different sites could set this to one of the other "web" type databases if different sites need to use different DBs. Also, if you take a look at /App_Config/Include/LiveMode.config.example then you will see an example that patches the database attribute to use master. This allow you to view the items without requiring publish from master to web. Why does the content need to be specified The reason for the content database attribute and requiring this to be set on the shell site is when you are editing items from the Content Editor the site context is shell. The shell site requires the core database for all it's settings and configuration You may often see code which references context database like so: Database db = Sitecore.Context.ContentDatabase ?? Sitecore.Context.Database; This is commonly used in code when executing in the content editing interface needs to access items in the master database (or whatever is set as content). There is some more details in this article about Content and Databases.
Site Definition XML Attributes for Database and Content There are two attributes in the site definition config XML file that I would like to understand better. If your server (Production) has the content management web site set up separately from the content delivery website, what should the database and content settings be for each of those sites? If your server (Development) only has one single website for both content management and content delivery, what should the database and content settings be in that case? <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <sites> <site name="MySite" database="web" content="web" ... /> </sites> </sitecore> </configuration>
The Shared fields are understandably not included as they don't need to be translated, as by their nature they are shared across all languages. As the Export Languages feature is to serve translation, it doesn't include them. There is no out-of-the-box method to enable Shared field exporting in this feature. Alternatives Before looking at a solution. My initial question is to why you would want this feature? If your primary case is just to export the content from Sitecore and you don't need the exact schema offered by Export Languages, then I would look at alternative options such as: Using serialization to output the items as .item files. OOTB behaviour Using the Sitecore GoodOldWebservice (/sitecore/shell/WebService/service.asmx) which has a Get XML method. OOTB behaviour though you'll want an app to connect to the service, such as SoapUI. Note that the XML format is different to that in Export Languages. Looking at modules such as the Export Item Data module. Not OOTB behaviour but should require no code. Editing the Export Languages behaviour The functionality that performs this export and the resulting XML schema is particular to this feature and can't be easily extended. If you do indeed want to export all the data in the exact same format as this, your best bet is to decompile the Sitecore.Shell.Applications.Globalization.ExportLanguage.ExportLanguageForm in the Sitecore.Client assembly, create a new class from it and alter the behaviour. The part that you would need to change is in the ExportItem method: protected void ExportItem(Job job, XmlTextWriter writer, Item item) { //... code omitted ... foreach (Language language in this._languages) { foreach (Field field in item.Database.GetItem(item.ID, language).Fields) { // This should be replaced with a custom implementation of // ShouldBeTranslated that doesn't check the Shared property if (field.ShouldBeTranslated) { ... } } } } You can then edit \sitecore\shell\Applications\Globalization\ExportLanguage\ExportLanguage.xml to use your replacement form instead by updating the following line to your new class: <WizardForm CodeBeside="Sitecore.Shell.Applications.Globalization.ExportLanguage.ExportLanguageForm,Sitecore.Client" Submittable="false"> Alternatively you can also just extract the code and run it manually if you don't have a need to replace the regular form's behaviour.
Is there a way to include Shared fields during Export Languages feature in 8+? The Export Languages feature is working but we would like to include Shared fields, but it doesn't seem as those are included. Is this possible out-of-the-box or is there some type of workaround that we would need to do in order to get those Shared fields included with the export?
The built-in Sitecore scheduler can certainly be frustrating in its limitations. So using a WebApi endpoint that the task can call is certainly one way of doing things. You should keep security in mind though; if your URL can easily be guessed and doesn't require authentication then anonymous users can potentially trigger it. You should definitely consider some kind of access control (e.g. credentials, tokens, IP restriction). You have a couple of options for triggering it. Off the top of my head, you could install a windows port of curl and use that, you could write your own console application, or you can use PowerShell. My preference would be the latter. You can easily create a simple script as follows: $url = "http://www.example.com" $request = [System.Net.WebRequest]::Create($url) $response = $request.GetResponse() $response.Close() Then you set up the scheduled task to execute your PowerShell script. That will fire off the request to your server. The thing you need to be careful of with this is that web requests can time out; and this can cause your tasks to register as failed. You can execute the task on a separate thread, but this means you can no longer return failure codes to the scheduler. In my opinion, a better option would be to use the Sitecore Powershell Extensions module, and then use the remoting feature to connect and invoke your job on the server. You can then wait on the job, which means that you shouldn't have to work around timeout problems.
Executing Sitecore logic from a Windows Scheduled Task One of the frequent problems that I have seen with Sitecore is the inability to control the exact time that a scheduled task should run. Since the machine's clock will be far more accurate, what I would like to do is call Sitecore from a Windows Scheduled Task. I assume that I am going to need to set up a WebApi endpoint for the Windows Task to call, but how do I write/setup a Windows task to call it? Am I able to make the endpoint accept POST requests, or just GET?
I think your original configuration would work OK. I have had a similar setup, albeit in sc 6.5 pre-page editor worthy sites. So I have just tried this out on a clean install of sc8.2. I setup 3 languages, en, fr-FR and es-ES - the sites resolve as you would expect them to. When logged into the Content Editor, if I select a language, fr-FR for the home item and then click the Experience Editor button, it opens the page up with the French language version selected. Also, once in the Experience Editor, you can click the Versions tab and change the language from there. Here are some screen shots to demo that: The same things worked for the preview mode.
Language-specific sub-domain support One of our clients is requiring that we use language-specific sub-domains instead of sub-folders on their multi-lingual site. They know all of the reasons why this shouldn't be done from an SEO perspective, but still want to go this route. Will Sitecore allow this, natively? Conceptually, they would be looking for something like the following: <site name="website-en" hostname="examplesite.com" rootPath="/sitecore/content/sites/example site" startItem="/home" language="en" ... /> <site name="website-fr" hostname="fr.examplesite.com" rootPath="/sitecore/content/sites/example site" startItem="/home" language="fr" ... /> <site name="website-es" hostname="es.examplesite.com" rootPath="/sitecore/content/sites/example site" startItem="/home" language="es" ... /> The problem is that I am fairly certain that the above will break the SiteResolver for the Experience Editor and Preview mode. I am currently testing in 8.0.1 and while I don't see any errors, when I open EE/Preview the page always loads in the language on the current URL, rather than the language I was editing in on the previous item or in the Content Editor. To make the Content Author's life easier, I would prefer to work around this with as little effort as possible, due to timeline. Does anyone know how I can get this to work?
Delegated Administration with SPE Let's say for example that you wanted to provide a Context Menu option for users to unlock items based on the following criteria. Show when User is in the sitecore\Delegated Admin role Enable when the item is locked In between cooking eggs at home I was able to whip this up. So here is how I built it. Create a new SPE Module with a Context Menu library. Create a new script for unlocking the selected item. Configure a rule for Show and Enable when certain conditions are met. Now the user is able to Lock and Edit. Sample script for Unlock Elevated: $item = Get-Item -Path . # The user should be one granted the appropriate access. $user = Get-User -Id "superuser" New-UsingBlock (New-Object Sitecore.Security.Accounts.UserSwitcher $user) { $item | Unlock-Item } Note: This solution may be better suited as a Ribbon command. You can read more about how to do that here. Turns out Richard Seal apparently had the same idea today and hosted this.
Is it possible to assign the ability to unlock multiple users' items to a non-administrator role? One of the things I have to occasionally do as an administrator is unlock items which a user has forgotten to unlock before leaving on vacation. I've been asked if we could create a role which could perform this function (in order to back me up in this area), but which does not have other admin level functions, e.g. user administration. I've been looking, but not been able to find a way to assign this specific function to a role. Is this possible? Thanks for your help!
You can't put rendering parameters on a placeholder, no. You can put rendering parameters on the rendering that contains the placeholder, though. And, if needed, you could create a "wrapper rendering" that just contained a placeholder and perhaps a wrapper div on which you could put classes, ids or other attributes to make it easier to style with CSS.
Add Rendering parameters to placeholder I know that this might sound strange but, instead of adding rendering parameters to the different controls/modules on the page, I want to be able to add rendering parameters to the placeholder itself. Is this possible? I've tried to add a rendering parameter template to the placeholder template [/sitecore/templates/System/Layout/Placeholder] but, if this is the way to do it, I don't understand how to edit the rendering parameters on the page.
The usual path I take when approaching these things is to use pipeline profiling. Open the pipelines.aspx page and check if your processor is there, at all. If it isn't, you'll need to review your .config patch file. Clear the result set by clicking "Reset". In another tab, make an HTTP request to a page on your site. Refresh pipelines.aspx. The above steps will show you which processors were run for a single page request and how many times. Check if all processors in the httpRequestBegin pipeline have the same execution counts. If some processors have fewer executions, that means that some processor has aborted the pipeline before the execution got to your custom processor. In this case, you'll probably need to insert your processor further up in the pipeline so that it is executed before the aborting processor. If all processors were executed the same amount of times (that is greater than zero), that means that your custom processor was executed. Which in turn means that you didn't use a correct way of checking whether it was executed to begin with.
How can I find out why my custom `httpRequestBegin` processor is not executed? I have inherited a Sitecore website with a public class named GatedPageResolver that inherits the Sitecore.Pipelines.HttpRequest.HttpRequestProcessor class and adds code to look for a Boolean check box value on a Sitecore template. The GatedPageResolver is wired into the execution pipeline so that it is called for every HTTP Request. <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <httpRequestBegin> <processor type="MyCompany.Framework.Pipelines.HttpRequestBegin.GatedPageResolver, MyCompany.Framework" patch:after="processor[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']"/> </httpRequestBegin> </pipelines> </sitecore> </configuration> But, the code does not seem to get called. I have verified the config file code using the Sitecore Config Builder tool. Am I missing something?
Channel determining logic The settings for setting the channel are located in the following configuration file: Include/Channel/Sitecore.Analytics.Channel.config The determineInteractionChannel pipeline is used to set the channel of the current interaction. It contains four out-of-the-box processors: DefaultChannel—uses the "Direct" channel by default. ReferringSite—uses the channel associated with the referring site of the interaction. SearchKeywords—uses the "Organic non-branded search" channel if there are any search keywords associated with the interaction. Keywords are taken from the URL of the first request coming from a search engine, e.g. ?q=some%20keywords. OrganicBranded—uses the "Organic branded search" channel in case any of the search keywords associated with the interaction are present in the Keywords field of the item /sitecore/system/Settings/Analytics/Organic Branded Keywords. Additionally, there's the SetChannel processor registered in the triggerCampaign pipeline. This processor will set the interaction's channel to the channel associated with the campaign being triggered. Answers to your questions What is the algorithm or keywords to differentiate Social channels (Social community, Social mentions, social sponsored posts)?. Is this content managed? These channels will not be set out of the box. To use them, you have two options: Associate a campaign with each of the keywords and trigger it when a user comes from social sites. Create a new determineInteractionChannel processor that will set the channel according to your custom logic. Does Sitecore maintain a dictionary item for this - Tracker.Dictionaries.ReferringSites or is this from the Marketing Control Panel -> Taxonomy -> Online -> Social? This dictionary contains known referring sites that have been used before. The referring sites are stored in MongoDB. If the site visitor is referred to Sitecore from a channel that is not available, how does Sitecore handle this? Is this record also classified or is it rejected? It doesn't work this way. When a visitor comes to the site, the associated channel is determined based on the logic I described above. If the logic cannot infer any channel, it will default to the "Direct" channel.
Marketing channel and subchannel classification - how does it work? How does Sitecore classify the site visitors into different online/offline channels? I understand that Sitecore and other Analytics systems use the ref or referral q keyword for this classification. I looked into the DetermineInteractionChannel pipeline to understand the underlying algorithm, but I can't answer the below questions. What is the algorithm or keywords to differentiate Social channels (Social community, Social mentions, social sponsored posts)?. Is this content managed? Does Sitecore maintain a dictionary item for this - Tracker.Dictionaries.ReferringSites or is this from the Marketing Control Panel -> Taxonomy -> Online -> Social? If the site visitor is referred to Sitecore from a channel that is not available, how does Sitecore handle this? Is this record also classified or is it rejected?
I have managed to solve this I think. In Mongo's dbo.interactions pages are stored in a nested array, and page events are stored as a nested array within each page. Apparently, my mistake was that I've been expecting PageEvents of "Page visited" type to be represented in Path Analyzer as nodes, but what actually gets displayed there are Pages themselves. So now each time a front-end event I'm interested in happens, I'm using a fake page that is "visited" and edit its Tracker.Current.CurrentPage.Url.Path and Tracker.Current.CurrentPage.Item.Id so that it looks like another item (my JavaScript-based page) was being visited. Which is clumsy but hey, it works! :)
How to get a front-end event to show up in Path Analyzer? We're using Angular to handle site's front-end, and I'd like to add some events which happen there, like opening "new" pages based on JavaScript to Path Analyzer. This is how I tried to do it: var pageEventData = new PageEventData("Page Visited", new System.Guid("7DAF6F40-87EA-4594-B977-4994E5B439D3")) { ItemId = new System.Guid("92B09B21-3B5B-43E3-939D-A1C62779AED9"), Data = title, Text = "page "+ title + " was visited" }; Tracker.Current.Session.Interaction.PreviousPage.Register(pageEventData); (where "7DAF6..." is id of /sitecore/system/Settings/Analytics/Page Events/Page visited event and "92B.. " just a random id of one of the page items I use for testing) And this seems wrong, even though the event actually gets registered to Mongo's db.Interactions table as a PageEvent of 'Page visited' type, I don't see it in Path Analyzer. Is there actually a way to simulate a new page being visited and get a new node to be added to Sitecore's Path Analyzer? Here is an example of what gets registered in the db.interactions table: https://gist.github.com/epetrashen/92d2fe0e8b882932e2cf88cebe8868f3
MongoDB supports TTL indexes so you could, for example, configure xDB data retention of 6 months (or however long you'd like). The duration would depend on what all you're doing with the xDB data. I talk about this at https://grantkillian.wordpress.com/2016/08/11/sitecore-and-ttl-index-heresy-for-mongodb/ TTL indexes for MongoDB are documented at https://docs.mongodb.com/manual/core/index-ttl/
What are options for archiving xDB data? I've ran into a number of different scenarios lately around xDB and data retention and archiving. What is the best practice for archiving data in xDB in general? For example, is there a best practice for how long to keep anonymous data? By archiving or outright deleting that data, rebuilding the reporting database will no longer give full historic data, right? For PHI environments that require 8-10 years of data retention, what is the best practice for archiving that data? Another Mongo instance? Encrypted to disk? How is this accomplished?
According to the GitHub repository for Sitecore.Rocks, the only files installed into Sitecore by the Sitecore.Rocks extension are these: Browse.aspx Service2.asmx Service2.asmx.cs (codefile, not deployed) Sitecore.Rocks.Validation.ashx Sitecore.Rocks.Validation.ashx.cs (codefile, not deployed) Reference: https://github.com/JakobChristensen/Sitecore.Rocks/tree/master/src/Sitecore.Rocks.Server/sitecore/shell/WebService And since the .cs files would be compiled into the DLL itself, that confirms your original assumption about what you need to exclude from source control.
How should we update our .gitignore when using Sitecore Rocks? With the switch to Sitecore 8 we've recently begun using Sitecore Rocks for development. Sitecore Rocks adds at least the following files to the site (we're a little backwards still in that our working project directory is currently built on top of the core Sitecore files, but we do at least web publish to a different directory): Website/sitecore/shell/WebService/Browse.aspx Website/sitecore/shell/WebService/Service2.asmx Website/sitecore/shell/WebService/Sitecore.Rocks.Validation.ashx And the following to the project directory: *.csproj.sitecore Since a username is added to the *.csproj.sitecore file I assume that should be excluded, but are there any other Sitecore Rocks-related files that should be excluded from source control?
You could use HangFire. Not only does it supports cron based schedules like SiteCron, but it also features delayed jobs (among other things like a job dashboard, automatic retries, IoC support, support for logging frameworks). Delayed jobs are jobs that will run in the future at an (almost) exact given time. // Delayed job example var jobId = BackgroundJob.Schedule(() => Console.WriteLine("Delayed!"), TimeSpan.FromDays(7)); To publish an item at an exact time, you'll need to let Hangfire know. You can use the item:saved event for this. When it's an item to be published automatically, pass it to Hangfire like this: var jobId = BackgroundJob.Schedule(() => Custom.Publish(itemId), publishDate); With this in place, your item will get published almost instantly. Default interval to check for scheduled jobs is 15 seconds, but it can be changed. There is still one caveat, though. What if the editor changes the publish date? As I see it, you have two options to handle this: In the Publish method, check the item's publish date again and see if it's eligible to get published. Save the jobId in a field of the item (or somewhere with a reference to the item ID). In the item:saved event, run BackgroundJob.Delete(jobId); before you schedule it.
Publish at very specific time I have a request from a customer to publish (some) content at a very specific time. The content will be generated up front (can be day before, we don't actually know) and will get publish restrictions to make sure it is not published before the actual time. I am aware that there is a publish agent that can do this publish, but the problem is that the agent will run every x minutes and if set in minutes the minimum we can set is "1" (and actually client would rather have seconds). But.. I don't want to set the publish agent interval to 1 minute as I have a strong feeling that this will not benefit the performance of the site. Especially knowing that this "specific time" will only happen 2 to 4 times a year. Any ideas on how I can achieve a very punctual (occasional) publish without affecting the site's performance?
Check your Sitecore.Forms.dll version. If you upgraded your Sitecore instance then you also need to upgrade WFFM. Here you can find all WFFM versions - https://dev.sitecore.net/Downloads/Web_Forms_For_Marketers.aspx
WFFM FormDesigner error In Sitecore 8.1, opening FormDesigner gives the following error: [NullReferenceException: Object reference not set to an instance of an object.] Sitecore.Forms.Shell.UI.Controls.FormSettingsDesigner.set_TitleTags(String[] value) +26 Sitecore.Forms.Shell.UI.FormDesigner.LoadControls() +795 Sitecore.Forms.Shell.UI.FormDesigner.OnLoad(EventArgs e) +123 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146 Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +89 Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +594 System.Web.UI.Control.LoadRecursive() +68 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4498 The form is working fine, I think this is an upgrade issue.
There's a straight-forward way to add an Insert button to the Edit Frame of components. Set Experience Editor Buttons Sitecore comes with some Custom Experience Buttons which can be added to renderings. To achieve what you want, add the Insert one to your rendering: When added, you'll see the icon appear in the Edit Frame of the rendering: Set the Insert Options When the Insert button is clicked, it triggers a dialog that allows the user to select a template to insert. The templates that are shown are based on the Insert Options of the datasource template's Standard Values, so you should make sure you add the valid templates there.
Adding a new child item to a datasource for a rendering I have a rendering that has a Datasource Template of a menu container. When I change the datasource of the rendering, I can create a new Menu Container. But I would also like to add a new menu item to that container via the UI. I imagine its a custom button in the ribbon of the rendering and a Edit Frame for the item properties? Are there any guidelines I could follow to accomplish this?
Open the Coveo.SearchProvider.config and look for the coveoanalytics tag. check the database attribute and check it's set to master like this: <site patch:before="*[1]" name="coveoanalytics" virtualFolder="/coveo/rest/v6/analytics" enableTracking="true" database="master" domain="extranet" /> You can patch it on the Coveo.SearchProvider.Custom.config file if you don't want to edit the Coveo.SearchProvider.config file which I recommend you do this way.
Coveo Cloud Not Registering Analytics when Running In Live Mode We are not seeing analytics passed through to Coveo Cloud when we run site in "live" mode. Where the database is set to "master" rather than "web".
There are potentially 3 places in the web.config to modify to extend session timeout: <!-- AUTHENTICATION CLIENT SESSION TIMEOUT Specifies the number of minutes before Sitecore considers user authentication session tickets as expired. This setting is only relevant for users logging in to Sitecore Client and when the Sitecore license has a limited number of concurrent editors. All expired sessions will automatically be removed when a new user tries to log in and the maximum number of concurrent editors has been reached. The default is 60 minutes (1 hour). --> <setting name="Authentication.ClientSessionTimeout" value="180" /> And because Sitecore uses the .NET Membership Provider: <!-- AUTHENTICATION This section sets the authentication policies of the application. Possible modes are "Windows", "Forms", "Passport" and "None" --> <authentication mode="None"> <forms name=".ASPXAUTH" cookieless="UseCookies" timeout="180" /> </authentication> And finally, session state (you shouldn't using out of proc for CM so it should look like this): <!-- SESSION STATE SETTINGS By default ASP .NET uses cookies to identify which requests belong to a particular session. If cookies are not available, a session can be tracked by adding a session identifier to the URL. To disable cookies, set sessionState cookieless="true". Note that Sitecore does not support cookieless sessions <sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="20"/> --> <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="180" />
How do I set session timeouts in Sitecore? How do I increase session timeout for content authors? Authors complain that the default timeout is far too short.
This has been acknowledged as a bug in this version of Sitecore (v8.2 Initial Release). The issue will occur for any field type, used in a Rendering Parameters template, whose value contains XML. The solution provided by Sitecore Support is to update the postServerRequest function in the \sitecore\shell\client\Sitecore\ExperienceEditor\ExperienceEditor.js file. Original Code postServerRequest: function (requestType, commandContext, handler, async) { var token = $('input[name="__RequestVerificationToken"]').val(); jQuery.ajax({ url: "/-/speak/request/v1/expeditor/" + requestType, data: { __RequestVerificationToken: token, data: unescape(JSON.stringify(commandContext)) }, success: handler, type: "POST", async: async != undefined ? async : false }); } Updated Code postServerRequest: function (requestType, commandContext, handler, async) { var token = $('input[name="__RequestVerificationToken"]').val(); var ajaxData = unescape(JSON.stringify(commandContext)); if (commandContext &amp;&amp; commandContext.scLayout){ var obj = JSON.parse(commandContext.scLayout); if (obj &amp;&amp; obj.r &amp;&amp; obj.r.d &amp;&amp; obj.r.d.forEach){ obj.r.d.forEach(function(x,y){ if (x.r &amp;&amp; x.r.forEach) { x.r.forEach(function(a,z){ var val = a["@par"]; if (val &amp;&amp; val.length > 0){ ajaxData = ajaxData.replace(unescape(val), val); } }); } }); } } jQuery.ajax({ url: "/-/speak/request/v1/expeditor/" + requestType, data: { __RequestVerificationToken: token, data: ajaxData }, success: handler, type: "POST", async: async != undefined ? async : false }); } The public reference number given to this bug report is 88222.
Error in Experience Editor when Saving Rendering with Image Field Rendering Parameter I have a rendering that has a custom rendering parameters template. That rendering parameters template contains an image field. When I add the component to the page, add an image to the field, and try to save the page, I get the following error in the Sitecore log: 3200 13:40:13 ERROR After parsing a value an unexpected character was encountered: {. Path 'scLayout', line 1, position 2665. Exception: Newtonsoft.Json.JsonReaderException Message: After parsing a value an unexpected character was encountered: {. Path 'scLayout', line 1, position 2665. Source: Newtonsoft.Json at Newtonsoft.Json.JsonTextReader.ParsePostValue() at Newtonsoft.Json.JsonTextReader.ReadInternal() at Newtonsoft.Json.JsonTextReader.Read() at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Sitecore.ExperienceEditor.Speak.Server.Requests.PipelineProcessorRequest`1.Process(RequestArgs requestArgs) When I debug I get the following error in Visual Studio: System.Web.HttpRequestValidationException occurred Message: Exception thrown: 'System.Web.HttpRequestValidationException' in System.Web.dll Additional information: A potentially dangerous Request.Form value was detected from the client (data="...und Image=<image mediaid="{04D..."). This seems to suggest that my Rendering Parameter value is not getting properly encoded before posting back to Sitecore. Is there any way to resolve this? This is occurring in Sitecore 8.2 Initial Release.
sitecore/media library/Project/New tenant - this is media folder created for your project. In this example your project is called "New tenant" sitecore/media library/Project/New tenant/shared media folder an be used when you have more then one site in the tenant. While using it you can share media across all of the pages within that tenant.
What is the purpose of shared tenant media folder in SXA? SXA creates two media folders for new tenant: What is the purpose of shared folder?
This is a common issue when removing the CoveoResultLink class from your Result Templates. Here is a Knowledge base article on this issue: developers.coveo.com/display/SupportKB/No+Clicks+in+Coveo+Usage+Analytics Coveo JavaScript Framework attach to this HTML Class in order to send the click events. If this class is removed, click events will no longer be registered. Adding multiple classes on a DOM object is not a problem in HTML5, so I would recommend to add your own class if you need to customize the style, but do not remove that base class.
Coveo Cloud Not Recording Click Through Event in Analytics We are not seeing click events registering in the Coveo Cloud analytics. Anyone know what we might be missing?
This is by design in Sitecore MVC, and Sitecore has provided alternative means to reach the same result. Instead of implementing filtering the standard "MVC way", you can hook into pipelines that Sitecore will invoke instead. mvc.actionExecuting: Before invoking an MVC action method mvc.actionExecuted: After invoking an MVC action method mvc.exception: After an unhandled exception in an MVC request mvc.resultExecuting: Before invoking the ExecuteResult() method of an ActionResult mvc.resultExecuted: After invoking the ExecuteResult() method of an ActionResult All of these pipelines are empty by default, but defined in Sitecore.Mvc.config. Additional information: How is Sitecore MVC Different from ASP.NET MVC? Global MVC Filters in the Sitecore ASP.NET CMS Filtering the Output Stream with the Sitecore ASP.NET CMS
Assigning a stream to Response.Filter throws "Filtering is not allowed" I am trying to assign a response filter in the MVC OnActionExecuting event to modify the html outputted by the ActionResult of a Sitecore controller rendering. This works fine with plain MVC. However, in Sitecore, assigning a stream to the Response.Filter throws System.Web.HttpException: Filtering is not allowed. Has anyone successfully implemented this in Sitecore? public class UpperCaseFilterAttribute : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { filterContext.HttpContext.Response.Filter = new UpperCaseFilterStream(filterContext.HttpContext.Response.Filter); } }
The matching is done on the path after /, so your rule should not start with that. Try using just ^(.*)/Pages/(.*).aspx instead, or ^Old/(.*)/Pages/(.*).aspx if you need the Old part there as well. Also, you could probably improve the regex a bit by requiring at least one character in the two wildcard groups and by escaping the . before aspx: ^Old/(.+)/Pages/(.+)\.aspx
IIS redirect for legacy URLs - Sitecore interference I have a site I'm redesigning into Sitecore. The old URLs are at https://[host]/Old/[path(s)]/Pages/[ID].aspx and I want them to be translated to https://[host]/Post/[ID]. I wrote an IIS redirect rule for this that, when I test the URL sample, works to get the [ID] out. When I put the old URL in, though, I get a Sitecore not found message pointing to the old URL, but it drops the .aspx portion and also, if there's a hyphen in the [ID] it disappears in favor of a space. I did add "/old" URL to the "IgnoreUrlPrefixes" setting in Sitecore, so I thought that would basically keep Sitecore out of it. My rule definitions: Requested URL matches the pattern, using regular expressions Pattern: ^/(.*)/Pages/(.*).aspx (the pattern tester in IIS reported success) Action type: Redirect (301), to /Post/{R:2} Any thoughts? Thanks.
The fast answer is that the publisher site is used for publishing related jobs. But, you probably already knew that. Why is publisher used in Publishing? When one pulls the covers back a little on the Publishing process, it's revealed that Publishing utilizes the JobManager to manage publish processes. This is to allow for asynchronous processing to occur within the worker process. This allows Sitecore to perform other tasks and still be able to serve up a web request to an incoming http request. To understand why the publisher site exists is to understand how JobManager works. JobManager utilizes Sitecore.Context to build a pseudo Sitecore Context that the job runs as. Part of this sets Context.Site to a certain site. Essentially providing swim lane for other jobs to process simultaneously. This also allows for priority and preference over other Job tasks. There are actually two other sites that spin off Jobs in addition to publisher. Publisher - For Publishing Scheduler - For Scheduled Task Agents System - For System based jobs. These sites sit at the bottom of the Site Definition because of how Sitecore's site resolution works with regard to most specific to least specific ordering. That's generally why the website site is listed last and right before these three classes. Last but not least, JobManager only allows 1 job per site to run at a time. If you've ever encountered the Publishing: Queued message, this is because someone else currently has a publish job running. Your publish job has been added into the queue for JobManager and will be ran, but in a background context that you can't see. Looking Behind the Curtain To see an example of this publisher site in action, look no further than the Publisher.PublishAsync() class. Below you can see how the method is creating JobOptions() that includes the site to run the Job as. public virtual Job PublishAsync() { this.AssertState(); JobOptions options = new JobOptions(this.GetJobName(), "publish", "publisher", (object) this, "PublishWithResult") { ContextUser = Context.User }; options.ContextUser = Context.User; options.AfterLife = TimeSpan.FromMinutes(1.0); options.AtomicExecution = true; options.ExecuteInManagedThreadPool = Settings.Publishing.ExecuteInManagedThreadPool; options.CustomData = (object) new PublishStatus(); Job job = Context.Job; if (job != null) options.ClientLanguage = job.Options.ClientLanguage; return JobManager.Start(options); }
What's the use of the publisher site? does anyone know what's the use of the publisher site? I imagine it has to do with the publishing but I'm not really sure: <site name="publisher" domain="sitecore" enableAnalytics="false" enableWorkflow="true"/> thanks
Not out of the box. In theory, you will need to override the Content Editor Form. It is found in the following path: website\sitecore\shell\Applications\Layouts\IDE\Editors\Content Editor\IDE Content Editor.xml You will need to change the CodeBeside and set it to your custom namespace. I decompiled the code, and if I am not mistaken, you will need to change the following method to accommodate your requirement: protected virtual Sidebar GetSidebar() { Sitecore.Shell.Applications.ContentManager.Sidebars.Tree result = new Sitecore.Shell.Applications.ContentManager.Sidebars.Tree(); result.ID = "Tree"; result.DataContext = new DataContext() { DataViewName = "Master" }; return (Sidebar) Assert.ResultNotNull<Sitecore.Shell.Applications.ContentManager.Sidebars.Tree>(result); } You can also override the Tree Method to make it take into consideration of the language version you require. In the Tree Class, you will need to override the following method to pass the language version. public virtual string RenderChildNodes(ID parent) { Assert.ArgumentNotNull((object) parent, "parent"); Assert.IsNotNull((object) this.FolderItem, "FolderItem"); Item currentItem = this.FolderItem.Database.GetItem(parent, this.FolderItem.Language); HtmlTextWriter output = new HtmlTextWriter((TextWriter) new StringWriter()); if (currentItem != null) { foreach (Item filterChild in this.FilterChildren(currentItem)) this.RenderTreeNode(output, filterChild, string.Empty, filterChild.ID == this.FolderItem.ID); } return output.InnerWriter.ToString(); }
Filter Content Editor Tree to Only Display Japanese Items Is there a way to filter the content editor tree to only display items in the tree if they have Japanese versions?
When you add a computed index field to the configuration, the section uses a certain method to instantiate resulting .Net objects for each computed field type: <fields hint="raw:AddComputedIndexField"> As we can see here, the method is the AddComputedIndexField function from the IDocumentBuilderOptions interface. Depending on your configuration you should either override the Solr or Lucene document builder. All in all they work kinda same. You should override the: public virtual void AddComputedIndexField(XmlNode configNode) Inside the AddComputedIndexField method it is calling the protected static CreateComputedIndexfield method that actually creates a field instance. You should probably copy its body (use reflector or dotPeek) and add something like Container.GetInstance(typeName) as IComputedIndexField in the end instead of standard reflection code. The document builder can be replaced in the index configuration as follows: <documentOptions type="TypeName, Assembly"> I haven't tested this approach, but it should work. Please, let me know if it worked for you.
Can I use automatic dependency injection with computed search fields in Sitecore 8.1? I am creating a custom computed content search field that has one dependency: ISearchSettings. I'd like it to be injected via constructor: public class CustomField : AbstractComputedIndexField { private readonly ISearchSettings _searchSettings; public CustomField(ISearchSettings searchSettings) { this._searchSettings = searchSettings; } public override object ComputeFieldValue(IIndexable indexable) { /* ... */ } } How can I achieve this with Sitecore 8.1?
The logic of finding how many visits ago a pattern was matched is as follows: Find an interaction that matches a pattern by inspecting Profiles sub-document in Interactions collection in MongoDB. Subtract interaction index from total visit count of the contact: Contacts.System.VisitCount - Interactions.ContactVisitIndex Most likely Contacts.System.VisitCount field in MongoDB was not incremented when some interactions were saved and the count got out of sync. It might have happened due to an error during aggregation, during contact merge or while performing MongoDB operations. AFAIK, you should be able to update VisitCount for the contact and for any related contacts that were created during contact merge.
Experience profile dashboard - confusing visits count numbers Our client uses contact pattern matching and they noticed strange information in the dashboard. Total visits count for the contact (real person) is 157, but several patterns have 'Latest match: -216 visit ago' . How can this happen and what can we do to fix it? Sitecore 8.0 rev. 151127 UPD: image provided.
When I was working on Sitecore 7.2 project long time ago, the fastest way was to serialize the single root item and then clicking Revert Tree on that item. All the descendants were gone and I had to remove only the last item manually. It worked in EventDisabler mode and it was much much faster than deleting items manually.
What is the fastest way to delete thousands of items in the content tree? We are trying to delete tens of thousands of items in the content tree. However, it is taking a VERY long time to do that. We have tried to delete through the Sitecore Experience Editor and it is timing out. We love Sitecore Powershell Extensions (SPE), and have tried to use the Remove-Item cmdlet and that works but still takes a VERY long time...even overnight. What is the fastest way to delete tens of thousands of items from the Sitecore content tree? Your help is much appreciated.
You can disable browser caching by changing this setting in Sitecore to true: <setting name="DisableBrowserCaching" value="true" /> BUT that really is not a good move to make, disabling the browser caching on clients will cause a higher load on your servers when most of the time, you don't need to do that. What you need to do is work out your caching strategy and how long you want things like images to live in the clients browser cache. I normally use a sliding scale based on the age of the content/media item. One thing to keep in mind, once the browser cache has been set, there is nothing you can do about it from the server!! The user will have to manually clear the browser cache to force an update. A simple option would be to use the current context item to set the cache headers. Adding this processor to the renderLayout pipeline will do that: public class BrowserCaching : RenderLayoutProcessor { /// <summary> /// Set browser caching headers. /// /// </summary> /// <param name="args">The arguments.</param> public override void Process(RenderLayoutArgs args) { Assert.ArgumentNotNull(args, "args"); Profiler.StartOperation("Update browser caching headers."); var page = Context.Page; if (page?.Page == null) { return; } SetCacheHeaders(page.Page); if (Context.Item != null) { SetUpdateHeaders(Context.Item, page.Page); } Profiler.EndOperation(); } /// <summary> /// Set caching related headers /// /// </summary> /// <param name="page">The page.</param> private static void SetCacheHeaders(Page page) { if (Context.Site == null &amp;&amp; !Settings.DisableBrowserCaching || Context.Site != null &amp;&amp; !Context.Site.DisableBrowserCaching) { // TODO: Build a sliding scale here based on the age of the Context.Item page.Response.Cache.SetMaxAge(new TimeSpan(0, 0, 30)); return; } Tracer.Info("Adding Http headers to disable caching."); page.Response.Cache.SetNoStore(); page.Response.Cache.SetCacheability(HttpCacheability.NoCache); } /// <summary> /// Set time-of-last-update headers /// /// </summary> /// <param name="item">The item.</param><param name="page">The page.</param> private static void SetUpdateHeaders(Item item, Page page) { var date = item.Statistics.Updated; if (date > DateTime.Now) { date = DateTime.Now; } Tracer.Info("Adding Http header to indicate last modification.", "Date: " + date + "."); page.Response.Cache.SetLastModified(date); } } This code sets the max-age of the response and also sets the last modified date. Browsers should be able to use that to know when to expire the cached copy of the data. As for the sliding scale, you will need to work out what is best for your implementation. As a baseline, I keep young items, so 2-3 hours old or less at around 60 seconds max-age, and then grow that. If a media item is more than a week old, I'm setting the max age in days rather than seconds. Obviously this example only does the current context item, so pages that have lots of Datasources may need to calculate it from the datasource and for media items you will need to add this to the media request pipelines.
Sitecore 7.2 returning 304 Status instead of 200 when a component within a page has been updated Sitecore 7.2 cache issue - we have a page that has a document list component on it. The page is hit and shows the document list with abc title, the document in the media library gets updated to 123 title and published. The abc title will still appear on the page until a shift-refresh is done. We have added meta tags to the layout to try and force (cache-control no-cache etc) but in the chrome dev tools the Status of the request in the Network tab is 304 instead of 200 - after the user does a shift-refresh the status is 200 and the updated doc title is displayed. Any ideas on how to make Sitecore recognize that a component on the page has been changed and it should be a 200 instead of a 304 or worse case force a 200 status everytime?
You should be able to see the 'preview' of the page working as expected before sending content to production. With that said, this seems to be more like a code related issue rather than a cache problem. To investigate CACHING issues please please try these suggestions: Open your domain/sitecore on a private browser (incognito mode). This will disable browsing history and the web cache. Clear your Sitecore cache. Access youdomain/sitecore/admin/cache.aspx page. This page displays details about the caching settings configured. This includes database prefetch, data cache, item cache, HTML cache, etc. To Investigate issues on the Experience Editor please try these suggestions: Open your experience editor and use the Browser Inspector. Go to DEBUG tab on Firefox (or SOURCE on Chrome), select your CSS file and verify if the content of your latest CSS is being load it. Check the CONSOLE tab on the inspector and see if your page loads without errors. I hope that helps you to investigate this issue.
Theme not actualizing in Experience Editor but OK after publishing I'm encountering a little issue : => When I export my theme then edit it and then import it back the CSS modifications do not apply in the Experience Editor (event after opening the editor again, iisreset etc...) => But when I publish my website the correct CSS is applied I checked if there was multiple versions of the Stylesheet in the media library but that's not the case. It seem that the Experience Editor keeps showing the first version of the theme I imported back and when I use the Export feature it generates a corrupt CSS file containing the following HTML lines at the end : But it seems to be the lastest version of the problematic CSS file. I'm using Sitecore 8.2 rev. 160729 and Sitecore Experience Accelerator 1.1 rev. 161004 for 8.2.
You cannot disable this via user access. The only way to hide the target tab is to override the sitecore publish restriction UI. I have written an article on how to achieve this. The url is here. In brief, you will need to override the Sitecore UI Set Publishing. The path to this xml file is found at Website\sitecore\shell\Applications\Content Manager\Dialogs\Set Publishing. When overriding the xml file, you will need to copy the Set Publishing.xml to the folder Override found at Website\sitecore\shell\Override. Then override the Onload method to disable the target tab. You can have a logic to disable it if the user is in certain role
Remove the ability of a role to modify publish targets How can I disable/hide the "Targets" tab of the publishing restrictions dialog for a given role? My role inherits from sitecore\Sitecore Client Publishing and I found that I can disable publishing restrictions altogether by denying read access of my role (in core DB) to: /sitecore/content/Applications/Content Editor/Ribbons/Chunks/Publish Restrictions /sitecore/content/Applications/Content Editor/Ribbons/Chunks/Publish Restrictions/Change However this now prevents users from controlling publish start/end dates and versions etc.
One thing to be aware of, is that in Sitecore's Site Provider, order of sites is incredibly important. If for some reason, your order has become unordered.. and the scheduler site shows up in the list BEFORE other site definitions, then Sitecore will land on the scheduler site as the Site for the current Context. Sitecore's Site Provider processes sites using a Most Specific to Least Specific case. Because the scheduler site has the least amount of requirements, if the sites are out of order, it will chose that site. This is why scheduler, publisher, and system sites show up AFTER the website site in a default config. Things To Check Check your ShowConfig.aspx to see how sites are ordered (if using config patching for Site definition. If using any kind of Multi-site manager or dynamic site module, ensure that your site definitions are putting your site before scheduler. Check to ensure that all site definitions exist. If there isn't a catch all site like website that has a empty hostname attribute, then I could also see how a request gets to the scheduler site. Also check to see if any rogue Scheduler Agents are being processed on the CD. (Likely not, but good to check)
How/Why would the scheduler website log attempts to access it's home page? Looking at the log file on our CD server, I noticed that there are loads of warnings getting logged every millisecond for a document not found redirect for the home page of the scheduler website: 9376 09:20:17 WARN Request is redirected to document not found page. Requested url: /, User: sitecore\Anonymous, Website: scheduler The scheduler is indeed a node of the sites section (this is a multi-site solution), third from the bottom and after all the actual public facing sites but has nothing more than name, domain and enable tracking set to false. <site name="scheduler" enableTracking="false" domain="sitecore"/> The only way I can even imagine the site getting accessed is by specifying via query string sc_site=scheduler but that still doesn't explain the frequency that it is getting logged.
If you are using the HtmlContentInBodyWithRequestsProcessor, this text is most likely indexed in the content of your page. Since the September release (4.0.402), Coveo for Sitecore has two new parameters that you can set to ignore parts of your HTML content by adding the StartCommentText and EndCommentText nodes in your configuration: <processor type="Coveo.SearchProvider.Processors.HtmlContentInBodyWithRequestsProcessor, Coveo.SearchProviderBase"> <StartCommentText>BEGIN NOINDEX</StartCommentText> <EndCommentText>END NOINDEX</EndCommentText> </processor> You can then add the nodes like so in your HTML page: <!-- BEGIN NOINDEX --> <p>This section will not be indexed.</p> <!-- END NOINDEX --> <p>This section will be indexed.</p> For more information, refer to this page. This processor is an implementation of the CleanHtmlContentInBodyProcessor coded by our Coveo for Sitecore guru @jflheureux. If you are using an earlier version, you can add this processor to your code and reference it in your configuration after the HtmlContentInBodyWithRequestsProcessor. Another solution would be to add conditional rendering for this page section. Coveo for Sitecore uses the Coveo Sitecore Search Provider user agent. It could be detected and used to hide the sections you don't want to be indexed. A third solution would be to define a special device and layout combination for that user agent, but it requires to duplicate the layouts and controls, and is quite harder to maintain than the other two solutions. Hope this helps :)
Exclude piece of content from Coveo My pages have a bit at the top of each with a privacy notification window, that the individual user dismisses with a click. However, this is getting indexed into Coveo and, being at the top, shows as the text for each search item on a result page. The content renders from a particular template/field. Is there a way to exclude either this field, template, or its rendering on the page from Coveo's crawl?
You can index external sources like blogs etc using Coveo. In addition to the items of your Sitecore Content Tree, a search interface built upon Coveo for Sitecore components can return results coming from external systems. (i.e. external to Sitecore). There is a specific section in a Coveo Search component that allows you to specify which sources in Coveo Enterprise Search (CES) should feed the search interface with their indexed items. This example will show you how a search interface could mix search results coming from Sitecore and from external web pages. You would need appropriate licensing depending on if you are using the cloud version or on-prem. The content you are trying to index should be browsable like a blog feed etc. https://developers.coveo.com/display/public/SitecoreV4/Configuring+an+External+Source https://developers.coveo.com/display/public/SitecoreV4/Enabling+the+External+Source+in+Sitecore https://developers.coveo.com/display/public/SitecoreV3/Displaying+External+Content+in+a+Search+Interface
Crawling external data in Coveo I have a DAM system that houses thousands of PDFs, and I am using Coveo for my site search. I want to allow these PDFs to be searchable from my site- how can I get them into an index? The only options I can think of: create a data provider and use that for crawling duplicate all the media into my media library to be crawled Is there a better way?
You have it right, the Page refers to the fully rendered HTML Markup of the page. This would include all renderings on that page that are not ajax'd in after the page load in the browser. media, CSS and JavaScript MAY still be cached, but it doesn't mean they WILL be cached. You have to setup the cache control headers for static assets outside of Sitecore. You can do this in IIS via the web.config file. Add a section under system.webServer: <system.webServer> <staticContent> <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" /> </staticContent> </system.webServer> In this example all static files will have a max age response header set to 1 day. Remember that this only suggests to the browsers how long they should cache the content for. Browsers do always follow it, for example if Chrome has the dev tools open, there is an option to disable the browser caching there.
What does the DisableBrowserCaching setting actually disable? I have configured and tuned site caches many times, but I feel like I still don't fully understand what the DisableBrowserCaching setting does. I have read all of the docs and I have done a little research on the Cache-Control: no-cache, no-store Pragma: no-cache headers, but it seems like everything I read assumes that I already know what it is that I'm looking to disable caching for. Sitecore's documentation states the following: When DisableBrowserCaching is true, Sitecore sets the following HTTP headers for each requested item (excluding media items): Cache-Control: no-cache, no-store Pragma: no-cache These HTTP headers instruct Web clients, including edge-caching devices, not to cache the page. Web clients can cache CSS, media, and other resources used by the page From what I can tell, this is saying that media, CSS, JS, etc. will still be cached, but the "page" won't be. What I am struggling to find is confirmation on what exactly the "page" is. It looks like the "page" is supposed to refer to the actual HTML of the page. This would make sense, since Sitecore defaults DisableBrowserCaching="true", and a Sitecore site doesn't often include pages that have entirely static HTML. Can anyone help to clarify this setting for me and maybe provide a situation or two when it would be set to false?
One reason for this behavior may be having an httpCookies domain setting in web.config that doesn't match the domain you are using to login to the Sitecore client, or having httpCookies requireSSL set to true while login in on http instead of https.
Unable to login to sitecore CM I am seeing this strange behavior in sitecore CM. Recently, I am not able to login to sitecore. When I use the correct username and password, sitecore just refreshes and the login page is shown again. Please find the fiddler trace below for the same. Based on the fiddler logs , it looks like a redirect is causing the issue. I checked the redirect config, but I don’t see any specific entry for sitecore. If I give a wrong username and password, error message is thrown as expected. Can you please guide me on this.
It's not officially supported, but I can tell you that it does work :) There are some circumstances with scaling the system to multiple instances that can run into trouble based on the way that the instances share file-system resources (Lucene doesn't like that) but if you have Solr - which you should on any scale-out model anyway - it should be ok. We've run 7.2, 7.5, and 8 on Web Apps for ages without any specific issues that we're aware of. Just be aware, since it is not officially supported, if you run into an issue and you contact support about it, they may not be willing to fix it. FWIW, since your Sitecore licenses probably only entitle you to a fixed number of CD servers, there's little advantage to using Web Apps anyway. They are almost exactly the same price as VMs.
How to deploy Sitecore 7.2 Using Azure Web Apps I am planning to move existing Sitecore 7.2 website into azure. I have read several blogs and most of them are about cloud service. Can we deploy Sitecore 7.2 using Azure Web App service? Any consideration we need to take in account?
The geo lookup isn't fast enough to work for a first page. It's not even really worth trying. If you must have it, you can hook into the GeoIP lookup service directly, or you can ajax in your content, to give the service a change to lookup the IP without destroying the user experience. Some CDNs (like Akamai) can add headers to requests that will identify the geo location of the visitor - you can personalise on that more reliably than the ip lookup in most cases. If you're looking to do language switching, consider using the Accept-Language header instead. This tells you the language of the browser, which is better than assuming language based on location (if I travel to Japan I still view the web in English). Of course you can also fall back to HTML5 geolocation and combine that with AJAX. It's probably more reliable than the GeoIP anyway.
How can I personalize based on geolocation for first page load? Typically, during the start of a new session, Sitecore uses an agent to asynchronously lookup the geo data of the visitor - but this means that geo-based personalization isn't available on the first page load. How do change this default Sitecore behavior to do the lookup before the first page load? What are the performance ramifications?
Not sure what version of Sitecore you are on, but this is a bit of code from the Sitecore Launch site. It identifies the user and adds the out of the box xDB facets. This is Sitecore 8.1.0.151207. public static void SetVisitTagsOnLogin(string domainUser, bool IsNewUser) { string name = Sitecore.Context.User.Profile.FullName; if (name == String.Empty) name = Sitecore.Context.User.LocalName; Tracker.Current.Contact.Tags.Add("Username", domainUser); Tracker.Current.Contact.Tags.Add("Full name", name); Tracker.Current.Contact.Identifiers.AuthenticationLevel = AuthenticationLevel.PasswordValidated; Tracker.Current.Session.Identify(domainUser); if (IsNewUser) { IContactPersonalInfo personalFacet = Tracker.Current.Contact.GetFacet<IContactPersonalInfo>("Personal"); personalFacet.FirstName = GetFirstName(name); personalFacet.Surname = GetSurName(name); IContactEmailAddresses addressesFacet = Tracker.Current.Contact.GetFacet<IContactEmailAddresses>("Emails"); IEmailAddress address; if (!addressesFacet.Entries.Contains("work_email")) { address = addressesFacet.Entries.Create("work_email"); address.SmtpAddress = GetEmailAddressFromUser(domainUser); addressesFacet.Preferred = "work_email"; } } } private static string GetFirstName(string fullname) { if (fullname.Contains(' ')) return fullname.Substring(0, fullname.IndexOf(" ")); return fullname; } private static string GetSurName(string fullname) { if (fullname.Contains(' ')) return fullname.Substring(fullname.IndexOf(" ") + 1); return String.Empty; } private static string GetEmailAddressFromUser(string username) { if (username.Contains('\\')) return username.Substring(username.IndexOf("\\") + 1); return String.Empty; }
Experience Profile always shows anonymous or unknown as Name I'm creating a small POC to learning Sitecore personalization, and I'm trying to create contacts. I have a register form where I will create extranet users and login form. The experience profile page always showing anonymous even I login also. Then I try to identify contacts using this code after login code. Sitecore.Analytics.Tracker.Current.Session.Identify(UserName); and I can see the current contact by Sitecore.Analytics.Tracker.Current.Contact.Identifiers.Identifier But when I look into experience profile it is showing as "unknown" . How this contacts make work? Is there any detailed documentation available for it? Sitecore Version : Sitecore.NET 8.2 (rev. 160729)
This is possible with the IIS rewrite module. This example comes from the Microsoft iis.net site: to rewrite http://localhost/pag342 to: http://localhost/page2?id=342 you would need find a pattern by using a regular expression (^pag/([0-9]+) (this finds 342) and redirect it using an action: page2?id={R:1} A detailed guide on exactly your problem can be found here: https://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module
Sitecore Url Rewrite Module map source url with out query string parameters to destination url with query string parameters I have a situation where i need to map a source url with out query string parameters to a internal destination url with query string, Lets say /pag1 to /page2?Id=1 is this possible? it work if i insert external link but not with internal, I have tried to modify the raw value of the link but with no luck. Update: Using IIS rewrite module is not an option as the content editor needs to change the maps frequently in Sitecore, without deploying a config change or recycling the app pool. They update a .csv that contains the mapping, then run a command which reads the .csv file entries, parse them, and create a corresponding mapping item in sitecore.
Same instance for multiple services I believe this can only be achieved with code registration: var implementation = new ServiceImplementation(); serviceCollection.AddSingleton<IService>(provider => implementation); serviceCollection.AddSingleton<IExtendedService>(provider => implementation); In case ServiceImplementation has its own dependencies, you will need to instantiate it from the container as well. Here's a trick you can use: serviceCollection.AddSingleton<IService, ServiceImplementation>(); serviceCollection.AddSingleton<IExtendedService>( provider => (ServiceImplementation)provider.GetService(typeof(IService))); Below you can find more general details that I typed in before fully understanding the question :) XML registration If you're using XML registration, just add a .config patch file with the following contents: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <services> <register serviceType="[Namespace].IService, [Assembly]" implementationType="[Namespace].ServiceImplementation, [Assembly]" lifetime="Singleton" /> <register serviceType="[Namespace].IExtendedService, [Assembly]" implementationType="[Namespace].ServiceImplementation, [Assembly]" lifetime="Singleton" /> </services> </sitecore> </configuration> Code registration You should use Sitecore configurators to register dependencies from code. There are many available registration methods. Here's an example with a singleton dependency: serviceCollection.AddSingleton<IExtendedService, ServiceImplementation>; A transient example: serviceCollection.AddTransient<IService>(provider => new ServiceImplementation()); To see the complete list of available registration methods, decompile the class ServiceCollectionServiceExtensions in the assembly Microsoft.Extensions.DependencyInjection.Abstractions. The main variations are: AddTransient<...>(...) AddScoped<...>(...) AddSingleton<...>(...) Add(Type, Type, ServiceLifetime) Add(Type, Func<IServiceProvider, object>, ServiceLifetime) Dependency lifetime Regardles of which registration method you choose, remember to specify an appropriate lifetime scope. The supported options are: Singleton Scoped Transient Further reading https://docs.asp.net/en/latest/mvc/controllers/dependency-injection.html http://kamsar.net/index.php/2016/08/Dependency-Injection-in-Sitecore-8-2/
Sitecore Dependency Injection - register two abstractions to same singleton instance of an implementation When using the native Sitecore Dependency Injection I have 2 abstrations: IService IExtendedService I want them both to be registered to same singleton instance of a ServiceImplementation How do I register the implementation with my IoC Container to do that?
Toolbox displays renderings in a way how they are organised in Renderings content tree. Available Renderings plays a role of filter only. Those items define which renderings should be added to a toolbox but do not define a way how they are organised. In your case you've got one of your renderings under Renderings/../News folder and one under Renderings/../Author See how all other renderings are organised into folder categories under renderings All sections in the toolbox are sorted alphabetically then. How to add a new section in SxA toolbox To summarise and make things easier for others, here are steps that you need to perform if you want to add an extra section into Toolbox. Create a folder with Section name and put your renderings there. Add New Available Renderings item and assign your renderings to it (you can use existing one as well as those plays filtering role only) Results
Adding new section in SXA toolbox The goal is to create a new section in the toolbox. I created a new Available Renderings item called Custom, and I've added two new renderings, News and Author. When I go to the toolbox instead of one new section called Custom with two renderings in it, I get two new sections, named News and Author, each with one rendering of the same name in it. Any ideas?
Click on the Sitecore Icon present on the top left in Content Editor then navigate to: Application options ▶ View(2nd tab) ▶ Check the Show Entire Content Tree check box.
Unable to see entire Sitecore content tree on selecting any media library item Below is the Sitecore tree structure in my project. When I click on any item in the media library(for e.g. here Test1 item). I'm unable to see the entire content tree. Refer below image for the issue that I'm facing. Can someone help provide a solution for this issue?
From my testing, it does it by default. So I followed this page: developers.coveo.com/display/SitecoreV4/Provide+Result+Suggestions and I added the "Coveo Search Resources", "Coveo Search Box" and "Coveo Omnibox Result List" to my header. I now have suggestions on everything within my index. Side Note : The suggestions, when clicked, will open the result itself, it will not redirect me to the search page. I tested just typing "ar" and it suggested Article , Article Group, Glossary and more. Is it what you are seeing? * UPDATE * I made a mistake in my original answer, I was using field-based query suggestions : https://developers.coveo.com/display/SitecoreV4/Provide+Query+Suggestions To have the same query completion behavior with the OmniboxResultList (Results Suggestions) is not possible without adding a wildcard, since it does a full query against the index, while query suggestions does a field listing call: https://developers.coveo.com/display/SearchREST/Listing+Values+of+a+Field So is there a workaround? Yes! BE WARNED! This workaround will require you to map the title of your items as a facet. Facets require more computing than standard fields, so a facet with a high number of values is not recommended for large index. If you use this workaround for a few hundreds/thousands items, fine, but not for millions. The way it work on our pages such as the online help is by doing a field-based query with a custom onSelect event, which looks like this: $('#searchBox').coveo('initSearchbox', MySearchBoxComponent, { FieldSuggestions: { omniboxSuggestionOptions: { onSelect: function (valueSelected, populateOmniBoxEventArgs) { populateOmniBoxEventArgs.closeOmnibox(); // When a value is selected, query the index for the result list Coveo.SearchEndpoint.endpoints["default"] .search({ q: '@systitle=="' + valueSelected + '"', aq: SuggestionScope }) .done(function (results) { var foundResult = Coveo._.find(results.results, function(result){ return valueSelected == result.raw.systitle; }); if(foundResult) { logCustomEvent('pageNav', 'omniboxTitleSuggestion', uaToken, foundResult.Title, foundResult.clickUri); window.location = foundResult.clickUri; } else { logger.warn("Selected suggested result," + valueSelected + " , not found."); } }) }, queryOverride: SuggestionScope } } }); * UPDATE 2 * My original code was using the Coveo JavaScript framework standalone, here is the new code in Coveo for Sitecore using MVC Coveo.$(function () { var searchbox = Coveo.$('#@Model.SearchboxId'); if (typeof(CoveoForSitecore) !== 'undefined') { CoveoForSitecore.componentsOptions = @(Html.Raw(Model.GetJavaScriptInitializationOptions())); //Here is the part where I access the suggestions of my search box CoveoForSitecore.componentsOptions.FieldsSuggestions = { omniboxSuggestionOptions: { //This queryOverride is optional, you can use it to filter the suggestions queryOverride: '@Model.ToCoveoFieldName("haslayout")=="1"', //The onSelect function is the one we want to override in order to open the suggestion onSelect: function (valueSelected, populateOmniBoxEventArgs) { populateOmniBoxEventArgs.closeOmnibox(); //This is the core of the code, you will launch a new query to find the value selected in the suggestion and open it directly Coveo.SearchEndpoint.endpoints["default"] .search({ q: '@Model.ToCoveoFieldName("title")' + '=="' + valueSelected + '"' }) .done(function (results) { var foundResult = Coveo._.find(results.results, function(result){ return valueSelected == result.raw.systitle; }); if(foundResult) { // This logCustomEvent is optional but should be used in order to track in the Usage Analytics logCustomEvent('enter the name of the event'); window.location = foundResult.clickUri; } else { logger.warn("Selected suggested result," + valueSelected + " , not found."); } }) } } } searchbox.coveoForSitecore('initSearchbox', CoveoForSitecore.componentsOptions); } else { searchbox.coveo('initSearchbox', '@Model.GetSearchPageUrl()'); } searchbox.find(".CoveoSearchbox input").attr("placeholder", '@Model.SearchboxPlaceholderText'); So what it does is offering query suggestions, but instead of redirecting to the result page, it queries the index and redirects to the most relevant result. For more information on the PopulateOmnibox function: https://developers.coveo.com/display/JsSearchV1/Providing+Suggestions+for+the+Omnibox
Is it possible to have Automatic Partial Match for Result Suggestions in Coveo Cloud? I'm trying to do something and I'm not sure it is possible. We are using results suggestions as described in the link below. And I want to have it match partial words without requiring a wild card. So for example if I type "tick" it would be the same as if I typed "tick*" and it would suggest results with the word "ticket" in it. Is this possible? https://developers.coveo.com/display/public/SitecoreV4/Provide+Result+Suggestions The example on that link suggests this would work but it doesn't seem to in Coveo 450 for Sitecore using Pro Cloud
The new version of the Analytics Database Manager allows to clear historical data in the collection (mongo) database. It allows to specify various conditions to keep only important data. I hope it is helpful for you: https://marketplace.sitecore.net/en/Modules/Analytics_Database_Manager.aspx
MongoDB historical data and data truncation We have noticed that our MongoDB's are growing steadily. Which is an obvious result of just capturing all kinds of user interactions. However, we can't have the xDB grow infinitely... I can't seem to find any config in Sitecore that provides the means to clean up on the collected MongoDB information, provide a TTL for xDB data or anything of that kind. Furthermore, data is growing way faster than expected since a lot of bot analytics are also captured as the filtering done by ootb Sitecore is not sufficient. Any general approaches or advice on how to handle this? Because we can hardly pitch this to our customers and inform them that the MongoDB size will keep increasing over time (or their subscription will). And old collected analytics data (older than 2years) is simply not relevant enough anymore. Or should become achievable.
You should start with a blank web application solution with no /sitecore files at all. If you need to add a file or modify a sitcore file, build the folder structure in your project so on deployment, it will overwrite the existing sitecore file. All Sitecore config changes should be in the solution, in a /App_Confif/Include/z_[Client] folder. All your dlls for Sitecore should come from the official sitecore NuGet feed where you specify the sitecore version, not using "latest" in NuGet. Your web.config should be an out of the box Sitecore web.config and use transforms to make the web.config into what it needs to be on the build. You should develop with in the Helix guidelines for your project structure. All Sitecore item changes should be tracking in your choice of serialization software. Whether its TDS or Unicorn. My litmus test is if I can create a site with a Sim tool and deploy my project code and items, does my site work? In some situations, we pull production/stage content from Sitecore using PowerShell, copy the package to a Nuget server and deploy it to development/CI with PowerShell. To create a site, I have used Sim tools with the command line or this Powershell script. You are not alone in your frustration. I have run into several clients who have the entier Sitecore web site in their solution. Deployments and upgrades are always very difficult. But if you design a solution that includes no actual Sitecore files and can be deployed to a blank site via CI. Then you will be in great shape.
What's the Best Practice for Storing Sitecore in the Solution? So at the company I work, we've always stored the Sitecore instance that we are developing (for the site we are building) in source control. In this instance, we use TFS for source control. (Though I doubt it matters much if it's Git or TFS) However I've been building a few components for the market place and I've found that not committing the Sitecore instance into source control, is actually a lot easier and theoretically allows me to build my component to work with multiple versions of Sitecore (by firing up different versions using SIM). But does this only make sense when developing components? That being said, how would I ensure each developer is using the correct version of Sitecore when testing their code that matches the Sitecore version of the client (if I'm not forcing them to use a specific version using source control)? Also, how would this work with automated deployments? Would I just use the SIM to fire up the specific version of Sitecore from scratch each time and then install/publish the site on top of that fresh instance? How do you handle Sitecore support fixes in that scenario? Would we need to store those in the Web project? If that's the case, wouldn't those cause issues if we started working with a newer version of Sitecore?
EXM 3.3 does not run on Sitecore 8.2, so it makes sense that it's causing aggregation problems. EXM 3.3 only runs on Sitecore 8.1 update 3 (rev. 160519). EXM 3.4 runs on Sitecore 8.2 (rev. 160729). You are always able to see which Sitecore version is required by a specific version of EXM on the Email Experience Manager download page
Experience Analytics exception after upgrade to Sitecore 8.2 from 8.1 update 2 I have installed a fresh Sitecore 8.2 and deployed the solution built on 8.1 u2 on top of it. I have updated all dll references beforehand to point to Sitecore NuGet for 8.2 version and updated web.config in the source control. The site starts ok but i don't find any analytics data. I can see the visits in Experience Profile, but analytics dashboard is blank. I am running SOLR as a content search provider. I can see lots of exceptions like this in the log: 9552 16:45:13 ERROR Aggregation Error Exception: System.InvalidOperationException Message: Exception has been thrown by the target of an invocation. Source: Sitecore.ExperienceAnalytics.Aggregation at Sitecore.ExperienceAnalytics.Aggregation.Pipeline.SegmentProcessor.ProcessSegments(AggregationPipelineArgs args, IEnumerable`1 segments) at Sitecore.ExperienceAnalytics.Aggregation.Pipeline.SegmentProcessor.OnProcess(AggregationPipelineArgs args) at Sitecore.Analytics.Aggregation.Pipeline.AggregationProcessor.Process(AggregationPipelineArgs args) Nested Exception 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.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters) at Sitecore.Configuration.DefaultFactory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert) at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, Boolean assert) at Sitecore.Configuration.DefaultFactory.CreateObject[T](XmlNode configNode) at Sitecore.ExperienceAnalytics.Aggregation.AggregationContainer.Repositories.<.cctor>b__1() at Sitecore.ExperienceAnalytics.Aggregation.Data.Model.AggregationSegment.get_Dimension() at Sitecore.ExperienceAnalytics.Aggregation.Data.Model.AggregationSegment.GetData(IVisitAggregationContext context) at Sitecore.ExperienceAnalytics.Aggregation.Pipeline.SegmentProcessor.ProcessSegments(AggregationPipelineArgs args, IEnumerable`1 segments) Nested Exception Exception: System.TypeLoadException Message: Could not load type 'Sitecore.ExperienceAnalytics.Aggregation.Dimensions.DimensionBase' from assembly 'Sitecore.ExperienceAnalytics, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'. Source: mscorlib at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type) at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at Sitecore.Reflection.ReflectionUtil.CreateObject(String assembly, String className, Object[] parameters) at Sitecore.ExperienceAnalytics.Aggregation.Repositories.DimensionConfigReader.CreateDimensionFromConfig(XmlElement childNode) at Sitecore.ExperienceAnalytics.Aggregation.Repositories.DimensionConfigReader.LoadDimensionsFromConfig(String pathToConfigNode) Actually I tried dis-assembling that dll and that type exists.
We can achieve this using spellcheck dictionary. Create a composite tokenized index field using custom n-gram analyzer with help of ShingleFilter. Create a custom spellcheck dictionary. Get suggested words from the dictionary. For achieving this in Sitecore using Lucene, download the available source code for "Sitecore Cookbook for Developers" from - https://github.com/PacktPublishing/Sitecore-Cookbook-For-Developers/tree/master/Chapter%209/7.%20Correcting%20a%20search%20with%20did%20you%20mean
How to implement 'Did you mean?' - spell checker functionality like google in Sitecore using Lucene/Solr? I have a requirement to implement google-like 'Did you mean?' functionalities. If user make a mistake in typing then I've to show 'Did you mean [correct search term]'. What is the best way in sitecore to implement this?
Thanks to a post by @jammykam saved me. Here is the post : https://jammykam.wordpress.com/2015/12/03/sitecore-media-library-in-azure-cloud-storage-part-2/ All I had to do was change the config file. I commented out the hook and add a patch for medialibrary. See the screenshot below. I thought it would be better to post my finding, as someone else who have the Adaptive Images module installed and upgrading to Sitecore 8.2 could run into same issue and get help from here. :)
Error in SitecoreAdaptiveImages module after upgrading to 8.2 I have a Sitecore Adaptive Images module in one of our Sitecore applications. I just finished upgrading it from 7.2 to 8.2. I am now doing some fine-tuning. I see the error below in the log. How can I fix this? 13320 15:15:36 ERROR Error loading hook: Exception: System.NotSupportedException Message: Specified method is not supported. Source: Sitecore.Kernel at Sitecore.Resources.Media.MediaManager.set_Provider(MediaProvider value) at SitecoreAdaptiveImages.AdaptiveImagesMediaProviderHook.Initialize() in C:\Projects\OmniHotels\Source\C2\Upgrade-branch\SitecoreAdaptiveImages\AdaptiveImagesMediaProviderHook.cs:line 9 at Sitecore.Events.Hooks.HookManager.LoadAll() It is complaining about this line in the code for the hook. How do I fix it?
I think the part you might be missing is that actual action of clicking a link in an EXM sent email message is that the link goes to a page that sits outside of the Sitecore item structure. That page is \sitecore\RedirectUrl.aspx. Because that's the case, there isn't an item in Sitecore that allows you to tap into that action through the Sitecore UI, instead, EXM runs the pipeline <redirectUrl> which triggers the campaign and sets the Engagement Plan state to Clicked Through Message. You can register conditions and actions after the fact by modifying the EXM Engagement Automation plan, as shown in Part #1 below. However, if you are looking to register conditions and actions before or in tandem with the Clicked Through Message state, then I think creating a custom processor will most likely be required, as show in Part #2 below. Hope this helps! 1. Using Sitecore Engagement Automation Every time a new EXM Message is created, a Campaign and Engagement Plan are created specific to the message that is being created. Specifically, the Engagement Plan is copied from the Standard Message Plan that is located in /sitecore/system/Marketing Control Panel/Engagement Plans/Email Campaign/Standard/Message Plan There is a state in this engagement plan called Clicked Through Message that contains a couple of out of the box conditions: Valuable Visit Visited One Page Visit Had No Value In Not Email Click Handler Session Out of the box, there are no actions assigned to these conditions. However, if you have custom actions that you want to fire, you can adjust this standard Message Plan to add in your own Conditions and associated Actions following the Clicked Through Message state. 2. Programmatically - Creating a Pipeline Processor If you are running a distributed environment (meaning you have Content Delivery servers in play, among other possible servers) you will want to make sure that the Sitecore.EmailExperience.ContentDelivery.config is enabled on the Content Delivery role. Inside this config, you will find the <redirectUrl> pipeline. <!-- REDIRECT URL PIPELINE This pipeline is executed when Email Experience Manager receives a request to redirect a page request from an email link to the correct destination page. --> <redirectUrl> <!-- Retrieves the message item associated with the redirect event. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.GetMessage, Sitecore.EmailCampaign.Cd"/> <!-- Determines whether the link provided in the request is a reference to a page on the local web site. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.CheckInternalLink, Sitecore.EmailCampaign.Cd" /> <!-- Constructs the URL to redirect the request to. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.SetRedirectToUrl, Sitecore.EmailCampaign.Cd"> <param desc="queryStringEncryption" ref="queryStringEncryption" /> <internalCarryoverFields hint="list:AddInternalCarryoverField"> <carryoverField type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.CarryoverField, Sitecore.EmailCampaign.Cd"> <param desc="fieldKey" ref="settings/setting[@name='QueryStringKey.MessageId']/@value" /> <param desc="urlPattern">.*Unsubscribe.aspx|UnsubscribeFromAll.aspx.*|.*sc_pd_view=1.*</param> </carryoverField> <carryoverField type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.CarryoverField, Sitecore.EmailCampaign.Cd"> <param desc="fieldKey" ref="settings/setting[@name='QueryStringKey.AnalyticsContactId']/@value" /> <param desc="urlPattern">.*Unsubscribe.aspx|UnsubscribeFromAll.aspx.*|.*sc_pd_view=1.*</param> </carryoverField> <carryoverField type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.CarryoverField, Sitecore.EmailCampaign.Cd"> <param desc="fieldKey" ref="settings/setting[@name='QueryStringKey.Campaign']/@value" /> <param desc="urlPattern">.*Unsubscribe.aspx|UnsubscribeFromAll.aspx.*|.*sc_pd_view=1.*</param> </carryoverField> </internalCarryoverFields> </processor> <!-- Registers the link click event in emailEventStorage and attaches the result to the pipeline argument. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.RegisterMessageEvent, Sitecore.EmailCampaign.Cd"> <param desc="eventStorage" ref="emailEventStorage" /> <param desc="duplicateProtectionIntervalSecs" ref="settings/setting[@name='EXM.DuplicateProtectionInterval']/@value" /> <param desc="logger" ref="exmLogger" /> </processor> <!-- Registers custom page events. Internal page references matching the IgnoredUrlPattern will not add the event. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.RegisterPageEvents, Sitecore.EmailCampaign.Cd"> <EventName>Click Email Link</EventName> <FirstEventName>First Click Email Link</FirstEventName> <IgnoredUrlPattern>.*Unsubscribe.aspx|UnsubscribeFromAll.aspx.*</IgnoredUrlPattern> </processor> <!-- Triggers the campaign associated with the email message. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.TriggerCampaign, Sitecore.EmailCampaign.Cd" /> <!-- Marks the current session as an email click session. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.MarkAsEmailClickSession, Sitecore.EmailCampaign.Cd" /> <!-- Identifies the xDB contact related to the event in the xDB tracker. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.IdentifyContact, Sitecore.EmailCampaign.Cd"> <param desc="logger" ref="exmLogger" /> </processor> <!-- Moves the identified contact to the Clicked state in the engagement plan of the email message. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.MoveContactToEmailClickedState, Sitecore.EmailCampaign.Cd" /> <!-- Updates the classification of the identified contact if it is currently greater than a given threshold. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.UpdateContactClassification, Sitecore.EmailCampaign.Cd"> <LowerClassificationThreshold>900</LowerClassificationThreshold> <NewClassification>0</NewClassification> </processor> <!-- Resets the email bounce counter of the identified contact to zero. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.ResetContactEmailBounceCount, Sitecore.EmailCampaign.Cd"> <EmailAddressesFacetName ref="model/entities/contact/facets/facet[@name='Emails']/@name" /> </processor> <!-- Sets the channel id of the current visit according to the campaign activity associated with the email message. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.SetVisitChannelId, Sitecore.EmailCampaign.Cd" /> <!-- Sets the language of the current visit according to the language of the email sent to the current recipient. --> <processor type="Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.SetVisitLanguage, Sitecore.EmailCampaign.Cd" /> </redirectUrl> If you have additional actions that you want to happen during the Click Email Link event, you can do so by adding a custom processor to this pipeline. You'll most likely want to place your custom processor somewhere after Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.RegisterPageEvents or Sitecore.EmailCampaign.Cd.Pipelines.RedirectUrl.TriggerCampaign processors.
How do I execute an action when a user clicks a link in an EXM email? I would like to execute an a rule (condition and action) when a user clicks a link in an EXM email. The ability to trigger a goal would also be acceptable. This seems like a simple request, but nothing I try seems to work. Each message gets an engagement plan, but EXM puts users directly into the Clicked Through state via the API so I don't think you can immediately execute actions as it enters that state. Each message also gets a campaign, but it does not appear that you can execute a rule or register a goal when that campaign is triggered. You can assign a user to an engagement plan state when a campaign is triggered, but this has the same problem as the engagement plan above. Am I missing something? I am using Sitecore 8.1 update 3. Update To clarify, I am looking for a solution that does not require custom code. It seems to me that this should be standard functionality.
Explaining the log message 11404 20:29:34 INFO [Experience Analytics]: Request: http://host.name/sitecore/api/ao/aggregates/all/7A9A483F195D4F96AD88473CD6854C4F/all?&amp;dateGrouping=by-week&amp;&amp;keyTop=5&amp;keyOrderBy=visits-Asc&amp;dateFrom=06-08-2016&amp;dateTo=06-11-2016&amp;keyGrouping=by-key returned messages. This is not an error, this is just an INFO log message saying that the API at the given URL has been accessed. This is not something to be concerned about. You're only seeing this message because the Sitecore log level is set up low enough. You can change your log level to WARN or ERROR if you don't want the log to be overly verbose. Explaining the anti-forgery field error Experience Analytics seems to be using ASP.NET MVC for its RESTful API. It uses anti-forgery tokens to prevent CSRF attacks. Only the Experience Analytics application should access these API endpoints. You are not supposed to access them directly from the browser—it's not going to work since your request does not include an anti-forgery token. So receiving that error is in fact intended behavior. Conclusion You shouldn't worry because of the messages you're seeing.
Sitecore 8.2 Experience Analytics error: "anti-forgery form field is not present" On plain Sitecore 8.2 instance with WFFM on it I see next messages in the log: 11404 20:29:34 INFO [Experience Analytics]: Request: http://host.name/sitecore/api/ao/aggregates/all/7A9A483F195D4F96AD88473CD6854C4F/all?&amp;dateGrouping=by-week&amp;&amp;keyTop=5&amp;keyOrderBy=visits-Asc&amp;dateFrom=06-08-2016&amp;dateTo=06-11-2016&amp;keyGrouping=by-key returned messages. If I open that URL, I see the following JSON: { message: "An error has occurred.", exceptionMessage: "The required anti-forgery form field "__RequestVerificationToken" is not present.", exceptionType: "System.Web.Mvc.HttpAntiForgeryException", stackTrace: " at System.Web.Helpers.AntiXsrf.TokenValidator.ValidateTokens(HttpContextBase httpContext, IIdentity identity, AntiForgeryToken sessionToken, AntiForgeryToken fieldToken) at System.Web.Helpers.AntiXsrf.AntiForgeryWorker.Validate(HttpContextBase httpContext) at Sitecore.Web.Http.Filters.ValidateHttpAntiForgeryTokenAttribute.OnAuthorization(HttpActionContext actionContext)" } What does that affect? How we can fix that?
Just for clarification of how HTML cache works, the remote CD servers need to know about the CM server publish event. That setting is EnableEventQueues. If it is set to true on the remote server, the remote listen for the CM end:publish event. <setting name="EnableEventQueues" value="true"/> Then on the CM server you need to make sure the publish:end event has the HtmlCacheClearer (method = ClearCache) handler. <event name="publish:end"> <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache"> <sites hint="list"> <site>website</site> </sites> </handler> </event> Finally in the log you can look for this log. It is the cache being cleared from the event end. 16812 19:06:53 INFO Job started: Publish 15296 19:06:53 INFO Job started: Publish to 'web' 15296 19:06:57 INFO HtmlCacheClearer clearing HTML caches for all sites (2). 15296 19:06:57 INFO HtmlCacheClearer done. The last thing I will mention is that in some of the times when I needed info like this, on renderings that I have cached. I use this code to push all this cache info for the rendering into a HTML comment. This is written at the time the rendering was created and is stored in the cached HTML. <!-- CacheKey = @Html.Sitecore().CurrentRendering.Caching.CacheKey Cachable = @Html.Sitecore().CurrentRendering.Caching.Cacheable Timeout = @Html.Sitecore().CurrentRendering.Caching.Timeout VaryByData = @Html.Sitecore().CurrentRendering.Caching.VaryByData VaryByDevice = @Html.Sitecore().CurrentRendering.Caching.VaryByDevice VaryByLogin = @Html.Sitecore().CurrentRendering.Caching.VaryByLogin VaryByParameters = @Html.Sitecore().CurrentRendering.Caching.VaryByParameters VaryByQueryString = @Html.Sitecore().CurrentRendering.Caching.VaryByQueryString VaryByUser = @Html.Sitecore().CurrentRendering.Caching.VaryByUser Time = @System.DateTime.Now.ToShortDateString() - @System.DateTime.Now.ToLongTimeString() -->
How can I know that the Html Cache on the CD is Cleared on Publish I recently configured a CD and CM environment, where the CD's are isolated from the CM environment on their own machine. Is there a way to tell via the logs that the Html Cache has been cleared when I do a publish on the CM environment that affects the web database for the CD environment? Obviously I could just check via testing of the website, but that could be misleading.
With that assumption that you are triggering an implementation of a Sitecore Command (by inheriting from Sitecore.Shell.Framework.Commands.Command), you can trigger a download in the Content Editor using the SheerResponse utility class: SheerResponse.Download(localPathToYourFile);
How do I download a file from a local folder I read data from mongodb and export it to .csv, then save it to my local folder (file path ="F:\report.csv"). When I click the download button in the Sitecore interface it should be downloaded from the local file path. How do I do that?
Write an event handler or pipeline processor and place inside following code: if (Context.User.IsInRole("sitecore\\ROLE_NAME")) { Sitecore.Shell.UserOptions.View.ShowEntireTree = false; } This will basically disable the EntireTree for your current user if he belongs to role ROLE_NAME I would suggest to add this into some event, however this is your choice when and how often you need to revalidate it. I would avoid anything that influence normal user experience, which is for instance: httpRequestBegin. So concentrate on pipelines/events that are used by logged users. You can find some examples and POC below: EVENT HANLDER Configuration: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <events> <event name="security:loggedIn"> <handler type="Sitecore.Playground.EventHandlers.DisableEntireTree, Sitecore.Playground" method="DisableEntireTreeMethod" /> </event> </events> </sitecore> </configuration> Code: namespace Sitecore.Playground.EventHandlers { public class DisableEntireTree { public void DisableEntireTreeMethod(object sender, EventArgs args) { if (Context.User.IsInRole("sitecore\\Experience Explorer")) { UserOptions.View.ShowEntireTree = false; } } } } I tested it with item:saved event, everything worked fine but this not what you probably want. PIPELINE PROCESSOR: Configuration: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <renderContentEditor> <processor type="Sitecore.Playground.Pipelines.RenderContentEditor.DisableEntireTree, Sitecore.Playground" /> </renderContentEditor> </pipelines> </sitecore> </configuration> Code: namespace Sitecore.Playground.Pipelines.RenderContentEditor { public class DisableEntireTree { public void Process(RenderContentEditorArgs args) { if (Context.User.IsInRole("sitecore\\Experience Explorer")) { UserOptions.View.ShowEntireTree = false; } } } } Works almost fine. During first load value in ribbon is changed but tree needs reload. Find your best match.
How can I control GUI defaults in the Content Editor for specific user roles? This page describes how to customize the content tree: https://doc.sitecore.net/sitecore_experience_platform/80/content_authoring/the_editing_tools/the_content_editor/customize_the_content_editor#_Customize_the_content_1 You can hide the Content tree, Entire tree, Hidden items, Standard fields, Raw values and Buckets. How can I configure these for a specific role? When a new user gets created with that specific role, by default I want him to have the 'Entire tree' disabled. My guess is to override a Pipeline somewhere...
The language version is probably there by the default installation of Sitecore. They add a few language versions by default, even though the language itself is not listed under /sitecore/system/languages. If you have Sitecore Powershell Extensions installed, you can remove the language with the following command: Remove-ItemLanguage -Path master:\content\home -Language "da" -Recurse This will remove all da versions under /sitecore/content/home. Adjust path or language (e.g. da-DK) if necessary.
Undefined Language versions appearing on Sitecore Items The Language 'Danish:dansk' exist with version on certain items but it is not added/defined under System(Sitecore/System/Languages/). How is this Language added and how can I resolve/restrict such kind of issues?
As others have said here there are a number of steps to do this: Install Solr Generate an XML Schema for Solr Enable Solr term support Verify that Solr is running correctly Create Solr cores Configure an IOC Container Configure Sitecore to work with Solr Rebuild the search Indexes This official Sitecore documentation covers most of this fairly well: https://doc.sitecore.net/sitecore_experience_platform/80/setting_up__maintaining/search_and_indexing/walkthrough_setting_up_solr However I'm going to pick up on the more complex/time consuming ones of these and break them down for you. Install Java, Tomcat &amp; Solr There are some other ways to do this such as using bitnami, but here is the full manual install process using Apache Tomcat. Install Java https://java.com/en/download/ (if it isn't already installed - https://www.java.com/en/download/installed.jsp) Download the Solr 4.1.0 windows zip from http://lucene.apache.org/solr/downloads.html. Extract the zip and find the \dist folder in the extracted solr-4.1.0 directory. Rename the solr-4.1.0.war to solr.war and copy the file to the Tomcat’s \webapps folder. e.g: C:\Program Files\Apache Software Foundation\Tomcat 8.0\webapps. Create an empty Solr home folder to hold all Solr instances. For example, C:\solr. Find the \example\solr folder in the extracted solr-4.1.0 directory. Copy the contents of \example\solr to the empty Solr home folder you just created in step Copy the jar files from \solr-4.1.0\dist to Tomcat’s \lib folder. e.g: C:\Program Files\Apache Software Foundation\Tomcat 8.0\lib. Set the home directory for Solr in Tomcat. By adding a new Java option with the Monitor Tomcat program. e.g -Dsolr.solr.home=C:\solr Stop and Restart Tomcat. Check you new instance of Solr is running by going here: http://localhost:8080/solr If it isn't running properly check the Catalina logs. Configure Sitecore to work with Solr One of the steps that takes the longest is switching all the configs to use Solr. There is a Powershell script below that will do this for you: Function Set-SCSearchProvider { $rootPath = Read-Host "What is the path of your Sitecore instance's website folder?"; $choice = Read-Host "(L)ucene or (S)olr?"; $validInput = $true; #test that path is valid If (!(Test-Path -Path $rootPath)) { Write-Host "The supplied path was invalid or inaccessible." -ForegroundColor Red; $validInput = $false; } #test that choice is valid ElseIf (($choice -ne "L") -and ($choice -ne "S")) { Write-Host "You must choose L or S." -ForegroundColor Red; $validInput = $false; } If ($validInput) { If (($choice -eq "L")) { Write-Host "Set to Lucene." -ForegroundColor Yellow; $selectedProvider = "Lucene"; $deselectedProvider = "Solr"; } ElseIf (($choice -eq "S")) { Write-Host "Set to Solr." -ForegroundColor Yellow; $selectedProvider = "Solr"; $deselectedProvider = "Lucene"; } #enumerate all config files to be enabled $filter = "*" + $selectedProvider + "*.config*"; $filesToEnable = Get-ChildItem -Recurse -File -Path $rootPath -Filter $filter; foreach ($file in $filesToEnable) { Write-Host $file.Name; if (($file.Extension -ne ".config")) { $newFileName = [io.path]::GetFileNameWithoutExtension($file.FullName); $newFile = Rename-Item -Path $file.FullName -NewName $newFileName -PassThru; Write-Host "-> " $newFile.Name -ForegroundColor Green; } } #enumerate all config files to be disabled $filter = "*" + $deselectedProvider + "*.config*"; $filesToDisable = Get-ChildItem -Recurse -File -Path $rootPath -Filter $filter; foreach ($file in $filesToDisable) { Write-Host $file.Name; if ($file.Extension -eq ".config") { $newFileName = $file.Name + ".disabled"; $newFile = Rename-Item -Path $file.FullName -NewName $newFileName -PassThru; Write-Host "-> " $newFile.Name -ForegroundColor Green; } } } } Set-SCSearchProvider Originally from here: https://gist.github.com/patrickperrone/59b8745ee8b8ff9045b5 This is a really quick way of renaming your configs. We use this during deployments also from Octopus. There is a great guide for more info on setting up Solr here: https://sitecore-community.github.io/docs/search/solr/fast-track-solr-for-lazy-developers/ With regard to your custom index. Migrating the index to Solr should work but as mentioned above it depends on the kind of queries you are doing, you may need to refactor some of your code/config after migration. We have 3 or 4 custom Solr indexes and they work fine.
How to switch Lucene to Solr We are planning on changing from Lucene to Solr due to number of items and because we have more than one CM server. What are the steps needed to migrate default lucene indexes to Solr? Is it just a matter of enabling all .Solr.config files or will we need to do much more than that? We also have one custom lucene index we use on the site to query items. Is it a massive job to migrate this? Using Sitecore 8.1
I would use a remote event that can be raised on the CM server and subscribed to by the CD servers. When the event is raised, an event handler can execute on the CD servers clearing the cache. This is the mechanism used by the HtmlCacheClearer handler that comes with Sitecore, you can see how it is setup in the default Sitecore.config: <event name="publish:end"> <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache"> <sites hint="list"> <site>website</site> </sites> </handler> </event> <event name="publish:end:remote"> <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache"> <sites hint="list"> <site>website</site> </sites> </handler> </event> The publish:end event is raised on the local environment when publishing ends (i.e. the CM server), and the publish:end:remote event is raised on remote environments (i.e. the CD servers). It is fairly straight-forward to setup but requires a bit of boilerplate code. It makes use of two mechanisms in Sitecore: Event Raising / Handling, which allows you to configure code that subscribes to an event and executes when that event is raised. The Event Queue, which allows for events to be raised on one machine and handled by another. You are able to create your own custom events in Sitecore just by adding them to configuration. First of all, you can define your new event and your cache clearing class in configuration like this: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <event name="dataimport:complete"> <handler type="MyProject.DataImporter.CacheClearer, MyProject.DataImporter" method="ClearCache" /> </event> <event name="dataimport:complete:remote"> <handler type="MyProject.DataImporter.CacheClearer, MyProject.DataImporter" method="ClearCache" /> </event> </sitecore> </configuration> In this example, I have left out the implementation of MyProject.DataImporter.CacheClearer, but it is here that you would perform the functionality for clearing your cache. Once you have this, raising this event can be done through code, which you can do once your import is complete. The following code will raise both the local event as well as the remote one: // Raise the local event Event.RaiseEvent("dataimporter:complete"); // Add some data to the Event Queue, which will be consumed by other instances and then raised as events on those instances. Sitecore.Eventing.EventManager.QueueEvent<DataImportCompleteEvent>(new DataImportCompleteEvent()); In this case, DataImportCompleteEvent is simply an empty class and used as a means of a class for the remove instance to listen to. You can also use this class and add parameters to it if you want data to be passed to the remote instances as part of the event. I will not add that to this example to keep it simple. The remote event doesn't fire automatically without further setup. You will also need to write some code that tells each instance to listen out for events of the DataImportCompleteEvent class and raise the dataimporter:complete:remote event locally on that machine. public class DataImportEventHandler { public virtual void Initialize(PipelineArgs args) { var action = new Action<DataImportCompleteEvent>(RaiseRemoteEvent); Sitecore.Eventing.EventManager.Subscribe<DataImportCompleteEvent>(action); } private void RaiseRemoteEvent(DataImportCompleteEvent myEvent) { Sitecore.Events.Event.RaiseEvent("dataimporter:complete:remote"); } } To make sure this code is executed at startup, you can add a processor to the initialize pipeline: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <initialize> <processor type="MyProject.DataImporter.DataImportEventHandler, MyProject" method="Initialize" /> </initialize> </pipelines> </sitecore> </configuration> The Sitecore community documentation also contains an example that is similar to this, and may provide assistance if you want to add parameters to your event - http://sitecore-community.github.io/docs/pipelines-and-events/events/
Clearing CD cache in code from the CM I'm just mapping out some caching for a module which loads data from an external SQL database. I want to cache the results of methods for a configured amount of time but if the data is reimported on the CM I want to clear the cache on the CDs (as well as the CM). I'd planned on using a named Sitecore cache (I have some code I've used before which will do nicely for this). So my question is: How after the data import routine do I tell the CD servers that the named cache is invalid?
As mentioned above by Kasaku you need to install the Sidekick module in all environments in order to be able to connect to the service from dev. You can do this by either: Installing the Marketplace module in each environment: https://marketplace.sitecore.net/en/Modules/S/Sitecore_Sidekick.aspx Install Sidekick via NuGet and deploying the following files to each environment: Install Sidekick via NuGet https://www.nuget.org/packages/SitecoreSidekickCore/ Install-Package SitecoreSidekickCore Ensure any updates to these config files are included in your deployment: zSCS.config zSCS.Aduitlog.config zSCS.ContentMigrator.config zSCS.Editingcontext.config
Error on Sitecore Sidekick Content Migrator I recently installed Sitecore Sidekick and I am now trying to pull content from Production environment to my Dev environment. It is a Sitecore 7.2 installation instance. when I try to pull content from production, I am getting the following error. I did some initial troubleshooting and found that there is no such physical path in the my website folder as mentioned in the error below. Anything I am missing?
Apparently the problem was not in the IconCache folder, but rather the temp folder. I deleted everything from temp and it fixed the problem.
Parameter is not valid when trying to select item icon I'm trying to set an icon for an item in Sitecore 8.2. When I click the More Icons button, I get the error message below. The parameter is not valid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Parameter is not valid. What's strange is that I have this site deployed to another environment and it's working fine there. It's only giving me this error on my local development machine. I think it might be a corrupt cached image file that's causing the error, but I don't know how to clear that cache out.
Well, you just found a new bug in Coveo for Sitecore 4.0.450! It is caused by a new fix that was introduced in the October version. It looks for an input in all .CoveoSearchboxes to bind an event when the CoveoForSitecoreOmniboxResultList component is added. However, the input is not yet loaded, because the Search page loads after the CoveoForSitecoreOmniboxResultList component. I have managed to come up with a quick workaround that will fix your problem: Add the following input tag like this in your SearchView.cshtml file: <div class="CoveoSearchbox CoveoSearchPageSearchbox" ... > <input style="display:none"></input> <!-- This line here --> </div> The bug will be fixed in the next version :)
Multiple Search Fields on the Same Page with Suggested Results We have implemented a global Coveo search box, in our global header on our site that drives to our search page. This appears on our search page as well. Both the search box on the search page and the global search box use this for suggested results: https://developers.coveo.com/display/public/SitecoreV4/Provide+Result+Suggestions However, on our search page, we now get a JavaScript error on the page. Uncaught TypeError: Cannot read property 'addEventListener' of null(…) If I remove the Coveo Omnibox Result List View from the global search box on the page it works fine again.
I propose hiding users through the use of filtering in the membership provider. Consider using the customFilter attribute used by the Active Directory membership and role providers. Examples shown below. Active Directory supports the following filter for excluding disabled users: (!(UserAccountControl:1.2.840.113556.1.4.803:=2)) You can find more details here on filters supported by Microsoft Active Directory; no guarantees that the AD module will recognize them all. The customFilter attribute is documented in the AD module docs but there are not too many examples on how to do this in production. I was able to get the filtering of disabled users working today. Thanks for the idea. Use these filters in your web.config. Users which require access to Sitecore are added to the GRP-Sitecore-Users group in Active Directory. To keep things simple, this tracking group limits who appears in User Manager; the remaining access is configure in Sitecore on an individual user basis. SitecoreADMembershipProvider Custom Filter: (&amp;amp;(memberOf=CN=GRP-Sitecore-Users,OU=Groups,OU=Company,DC=chs,DC=company,DC=corp)(!(UserAccountControl:1.2.840.113556.1.4.803:=2))) SitecoreADRoleProvider Custom Filter: (&amp;amp;(objectCategory=group)(memberOf=CN=GRP-Sitecore-Users,OU=Groups,OU=Company,DC=chs,DC=company,DC=corp)(!(UserAccountControl:1.2.840.113556.1.4.803:=2))) Complete Example: A complete example demonstrating settings with the Active Directory module can be found here. The only part missing is the disabled filter.
Can I hide disabled users in the User Manager? We have Sitecore pulling user information out of Active Directory, and since a chunk of these are marked as disabled (University setting, and a chunk of our students get accounts for the time they're here), it results in a lot of extra results when searching for some common names. In the Sitecore User Manager, is it possible to hide disabled users?
Introduction Forms Wrapper rendering is nothing more than a wrapper for WFFM. It just needs to display a placeholder where you normally put your forms (this done this way to provide additional styling abilities for forms). How to add a WFFM form with SXA This is how you should add Web Forms for Marketers Forms with Sitecore Experience Accelerator Open your page Add Forms Wrapper rendering Forms->Forms Wrapper (now you should see additional section in Toolbox called WEB FORMS FOR MARKETERS) Drag Mvc Form (WEB FORMS FOR MARKETERS->Mvc Form) rendering inside Forms Wrapper (notice placeholder path on the right side of the screenshot) Starting from this step everything is the same as in vanilla WFFM. So just create a blank form or insert existing one. After I selected one of the existing forms (Demo form) here is what I see:
Form not showing up using Sitecore Experience Accelerator I'm trying to insert a form using the "Form Wrapper" rendering of Sitecore Experience Accelerator. So I installed WFFM, created a form, inserted a form wrapper in a page within Site Experience Accelerator and I associated my form as associated content but nothing shows up. The area stays empty. Any suggestions would be really appreciated.
Defect explanation The problem is not the SessionIDManager. It enforces a maximum ID length of 80 characters and you shouldn't attempt to overcome this limitation, since some session state providers may rely on it. The actual problem is Sitecore's current implementation of SessionDictionaryData. In Sitecore 8.0, this class used to store a dictionary object in the current private session and accessed the whole dictionary using a constant session key. In Sitecore 8.1, this was changed and every dictionary entry is now stored as a separate session (a shared session, to be precise). This was probably done for the sake of easy per-entry expiration. Take a look at this (reformatted) line of code from SessionDictionaryData.LoadAs<T>(object key): SessionStateStoreData sessionStateStoreData = this.provider.GetItem( this.HttpContext, "DictionaryData" + typeof (T).Name + key, out locked, out lockAge, out lockId, out actions); The session ID is formed by concatenating: "DictionaryData"; The type name of the object being stored—in your case, ReferringSiteData; The dictionary key—in this instance, it's the name of the referring site. There is no restriction on the length of the key here. So there will always be a possibility for a referring site name to be too long to be stored in this dictionary. Until this defect is fixed, that is. In your scenario, the referring site name was the domain name of the CM. Changing the domain name will only help with your current situation; other referring sites on the web can still have long domain names. Solutions 1. Workaround Well, first of all, this will very rarely be an issue in production. Domain names that long are pretty uncommon, so most users will never experience this error. Using a shorter domain name for your CM will "solve" the error in your environment. 2. Use another dictionary implementation The current dictionary is injected from the configuration. It is obtained via the getDictionaryDataStorage pipeline: Sitecore.Analytics.config <getDictionaryDataStorage> <processor type="Sitecore.Analytics.Data.Dictionaries.DictionaryData.Xdb.GetDictionaryDataProcessor, Sitecore.Analytics" /> </getDictionaryDataStorage> Sitecore.Analytics.Tracking.config <getDictionaryDataStorage> <processor type="Sitecore.Analytics.Data.Dictionaries.DictionaryData.Session.GetDictionaryDataProcessor, Sitecore.Analytics" patch:before="processor[@type='Sitecore.Analytics.Data.Dictionaries.DictionaryData.Xdb.GetDictionaryDataProcessor, Sitecore.Analytics']" > <DictionaryData type="Sitecore.Analytics.Data.Dictionaries.DictionaryData.Session.SessionDictionaryData, Sitecore.Analytics" singleInstance="true"> <param desc="configuration" ref="tracking/sharedSessionState/config" /> </DictionaryData> </processor> </getDictionaryDataStorage> You can just remove the second processor (that uses SessionDictionaryData) and then xDB will default to using a MongoDbDictionary instead. If you don't want your dictionary data to be stored in MongoDB, you can also implement your own dictionary and inject it using the getDictionaryDataStorage pipeline. 3. Wait for an official fix I registered this bug with Sitecore Support. I'll update this answer if they get back to me with a hotfix.
Exception on a CM server: The session ID is longer than the maximum limit I am seeing the following error in the logs for the CM I am setting up for one of our clients, in preparation for launch of their Sitecore 8.1u2 site: Logged Error: 4972 16:30:56 ERROR Sitecore.Analytics.Tracker Cannot start analytics Tracker Stack trace: Exception: System.Web.HttpException Message: The session ID is longer than the maximum limit of 80 characters. Session ID=DictionaryDataReferringSiteDatacm.myclientsname.clientabbrev-prd-cm1.mydelphic.com Source: System.Web at System.Web.SessionState.SessionIDManager.CheckIdLength(String id, Boolean throwOnFail) at System.Web.SessionState.InProcSessionStateStore.DoGet(HttpContext context, String id, Boolean exclusive, Boolean&amp; locked, TimeSpan&amp; lockAge, Object&amp; lockId, SessionStateActions&amp; actionFlags) at System.Web.SessionState.InProcSessionStateStore.GetItem(HttpContext context, String id, Boolean&amp; locked, TimeSpan&amp; lockAge, Object&amp; lockId, SessionStateActions&amp; actionFlags) at Sitecore.Analytics.Data.Dictionaries.DictionaryData.Session.SessionDictionaryData.LoadAs[T](Object key) at Sitecore.Analytics.Data.Dictionaries.TrackingDictionary`2.Get(TKey key, LookupStrategy strategy) at Sitecore.Analytics.Pipelines.TrafficTypes.ReferringSite.Process(TrafficTypeArgs args) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Analytics.Pipelines.TrafficTypes.TrafficTypePipeline.Run(TrafficTypeArgs args) at Sitecore.Analytics.Pipelines.CreateVisits.SetTrafficType.Process(CreateVisitArgs args) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Analytics.Pipelines.CreateVisits.CreateVisitPipeline.Run(CreateVisitArgs args) at Sitecore.Analytics.Tracking.StandardSession.CreateInteraction(HttpContextBase httpContext) at Sitecore.Analytics.Pipelines.InitializeTracker.CreateVisit.Process(InitializeTrackerArgs args) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Analytics.Pipelines.InitializeTracker.InitializeTrackerPipeline.Run(InitializeTrackerArgs args) at (Object , Object[] ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Analytics.Pipelines.StartTracking.StartTrackingPipeline.Run(StartTrackingArgs args) at Sitecore.Analytics.DefaultTracker.StartTracking() The error is basically telling me that the Session ID that was supplied, DictionaryDataReferringSiteDatacm.myclientsname.clientabbrev-prd-cm1.mydelphic.com (note that while the Session ID I am showing you is not the real one, I did make sure that it is the same length and structure as the real one), is longer than the 80-character maximum. Observations: I can see that the length of the Session ID is, in fact, longer than 80 characters. I did a little digging and found the Sitecore.FXM.Pipelines.ChooseSessionIdManager.FXMSessionIdManagerProcessor processor of the <getSessionIdManager> pipeline, but I'm not using FXM, so I want to use the default SessionIDManager. Aside from adding my own processor to this pipeline, I don't see any way to control the Session ID value, beyond changing the host name of the site, since the host name is being included in the URL. Questions: Is anyone else familiar with this error and how to fix it? Is there another way, beyond changing the host name of the site? Should this issue even be relevant for a CM instance?
Make sure you have enough quality content online and use social channels to share your thoughts: on Twitter use #Sitecore https://twitter.com/search?q=%23sitecore on LinkedIn join the appropriate groups https://www.linkedin.com/vsearch/g?type=groups&amp;keywords=sitecore on Facebook use the Sitecore group https://www.facebook.com/groups/6932529533/ you can request your blog to be added to the Blog Feed https://community.sitecore.net/general/f/11/t/4183 Also offline contribution matters, so participate conferences, user groups and other events. These events can also help you meet Sitecore employees or MVPs. Recommendation is not everything, but it is always good that someone feels that your contribution is worthwhile, so make sure to have at least one! Update: As of Nov 2018 the recommendation can be sent after logging in to the MVP Application area for current MVPs. Sitecore employees have an internal form to submit recommendations.
How to be Recommended to be a Sitecore MVP? Currently I do not personally know any Sitecore MVP's or employees to recommend me for this honor. I feel like I've given back to the community (although I'm looking to expand this even further in 2017). There's probably a lot of developers in the same boat as me. How might someone like me get recommended for consideration towards becoming a Sitecore MVP?
One solution to achieve the desired functionality you can override the Sitecore.Shell.Applications.ContentManager.Dialogs.LayoutDetails.LayoutDetailsForm class. Here is an example of how to do this: Create an assembly with the class that has the same code as defined in the LayoutDetailsForm class. Add the following code to the end of the OnLoad method: if (Sitecore.Context.User.IsInRole("yourrole")) { LayoutPanel.Visible = false; } Build the assembly and add it to the \bin folder. Open the \Website\sitecore\shell\Applications\Content Manager\Dialogs\LayoutDetails\LayoutDetails.xml file and replace the following line: <CodeBeside Type="Sitecore.Shell.Applications.ContentManager.Dialogs.LayoutDetails.LayoutDetailsForm,Sitecore.Client" /> With this line: <CodeBeside Type="MyNamespace.LayoutDetailsForm,MyAssembly" /> After performing these changes the content of the Shared Layout tab will be hidden depending on user role.
How to put restriction on Sitecore user to edit only final layout Is there any way to restrict a sitecore user to edit only final layout? they still should be able to view the shared layout. I tried doing below changes through role manager. switched to core db opened role manager and selected a custom role opened security editor navigated to /sitecore/content/Applications/WebEdit/Ribbons/Chunks/Layout Modes/ Did changes as per below pic. Still i see the users assigned to that role has access to edit shared layout. Any suggestions on what i am missing? Also, the custom role above is member of sitecore/designer and sitecore/author role.
It is best practice to not modify the global.asax file. Best to use the Sitecore pipelines to accomplish the same task. This allows you to follow Helix more closely and makes upgrading the site simpler. using System.Web.Mvc; using System.Web.Routing; using Sitecore.Pipelines; namespace YourApp.Pipelines.Initialize { public class RegisterApiRoutes : Sitecore.Mvc.Pipelines.Loader.InitializeRoutes { public override void Process(PipelineArgs args) { // app start here } } } Then your config <pipelines> <initialize> <processor type="YourApp.Pipelines.Initialize.RegisterApiRoutes, YourApp" /> </initialize> </pipelines> Other Global.asax functions https://laubplusco.net/global-asax-sitecore-pipelines/
Global.asax Application_Start not hit after upgrade to Sitecore 8.2 We noticed the Application_Start in the Global asax is no longer hit after the upgrade to Sitecore 8.2. Does anyone have an idea what may have caused this? My global.asax.cs: public class Global : Sitecore.Web.Application { protected void Application_Start() { // some code } } Global.asax: <%@ Application Codebehind="Global.asax.cs" Inherits="[namespace].Global" Language="C#" %> Edit: In order to be sure the Application_Start is not hit I did a few tests: Added a System.Diagnostics.Debugger.Break(); Edited the Global.asax file while the debugger was attached Threw an exception None of the above were successful. The target framework is set to 4.6
Working multiple teams in one Sitecore solution is a question of discipline and organisation. By organisation I primarily mean how and where assets for the sites are stored and organised. To start with your example however; different sites needing different membership providers. You don't actually map sites directly to a provider, you map them to a default domain. Extranet by default, but this can be changed. <site name="sitea" domain="domaina" ... /> <site name="siteb" domain="domainb" ... /> And each membership provider in your solution would be set up, to deliver these new domains to your solution. As for how to organise yourselves; I recommend following the guidelines laid out in the Helix architecture recommendations. Specifically the section named Patterns, Principles and Conventions that directly discusses everything related to multi-tenant implementations, file structure, organising Sitecore content, security setup and so on. In short. Yes, there are some more things to consider when working multiple teams in the same solution, but it is definitely doable and done by many teams around the world every day. Breaking up your solution into two separate Sitecore instances has the added implication of needing a whole new set of licenses. One set for each site. Depending on your customer, this might not be an option at all.
How to separate site configurations among managed multi sites I have got concerns raised by the 2 teams (to work in the same time) that multi site configuration may not be a solution for them. We want to have different sites working in the same instance of Sitecore. For example: In the situation when we have multi site <site> configured (Let's assume SiteDefinition.config or Dynamic Sites Manager for Sitecore) and Web A has to use Membership provider "One" and Web B has to use Membership provider "Two" what is the best way to handle this situation? And what is the other risk from having 2 teams working in 2 different web projects in the same Sitecore instance?
1) Create a custom drop link field in the core database. In a newly created field, make control field empty. 2) Include the following code in your project and give the assembly name and class name of the following code in a newly created custom drop link field item. public class FieldDropLink : Sitecore.Shell.Applications.ContentEditor.LookupEx { protected override string GetItemHeader(Sitecore.Data.Items.Item item) { if (string.IsNullOrEmpty(this.FieldName) || item[this.FieldName].StartsWith("@",StringComparison.OrdinalIgnoreCase)) // don't impact default usage { return base.GetItemHeader(item); } if (string.IsNullOrEmpty(item[this.FieldName])) { return item.DisplayName; } return item[this.FieldName]; } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (String.IsNullOrEmpty(this.Source) || !this.Source.Contains("=")) { return; } NameValueCollection args = Sitecore.Web.WebUtil.ParseUrlParameters( this.Source); if (!String.IsNullOrEmpty(args["field"])) { this.FieldName = args["field"]; } this.Source = args["source"] == null ? String.Empty : args["source"]; } } 3) Select newly created drop link in your template and give your datasource followed by &amp;field=yourfiledname For example: source=/sitecore/content/home&amp;field=title
Display field value in Drop Link field I have a requirement where I need to display "Title" field value of the items in the DropLink field instead of the item display names. How do I do it?
The problem could be that you use AutoMapping. If the field names are not exactly the same as the property names then Glass can't solve these. I would try to use [SitecoreField("First Text Line")] attribute for FirstTextLine property, if your field name in Sitecore is First Text Line. Here is the documentation about AutoMap - http://www.glass.lu/Blog/AutoMapping
Glassmapper fields displaying null despite correct item ID I'm working on integrating a previously built Sitecore solution (web project as well as TDS items) into the current Sitecore solution we are building. I've been working through a variety of Application errors that have sprung up during this migration, but I seem to be stuck on this one related to Glassmapper. The application is throwing a NullReferenceException at the following line: string.IsNullOrEmpty(Model.BackgroundImage) ? "bg-primary-dark" : string.Empty)" style="background-image: url('@Model.BackgroundImage.Src') When I step through using the debugger, I can see that Model.BackgroundImage is null. However, the ID in the Model is set to the appropriate Sitecore item. So it seems as though Glassmapper is finding the item, but not resolving the fields correctly. This is the Model itself. It was working without error before I began trying to integrate the old Sitecore solution: using Glass.Mapper.Sc.Configuration.Attributes; namespace Site.Models { [SitecoreType(AutoMap=true, TemplateId= "{5DADD454-BB7D-46A4-AF64-0C169DBDAF79}")] public class HomePageHero : GlassBase, IHomePageHero { public new static string ModelTemplateId { get { return "{5DADD454-BB7D-46A4-AF64-0C169DBDAF79}"; } } public virtual string FirstTextLine { get; set; } public virtual string SecondTextLine { get; set; } public virtual string ThirdTextLine { get; set; } public virtual Glass.Mapper.Sc.Fields.Image BackgroundImage { get; set; } public virtual Glass.Mapper.Sc.Fields.Link ButtonLink { get; set; } } } And this is how I'm inheriting the Model in the .cshtml file: @inherits Glass.Mapper.Sc.Web.Mvc.GlassView<HomePageHero> Does anyone have an idea of what might be going on here?
The values in Steps 1-3 is a straight value...meaning it is NOT a delta value. Therefore you will be getting exactly what the renderings referenced here specify on the item, and NOTHING will come from the Standard Values. Step 4 IS a delta value (notice the xmlns:p="p" xmlns:s="s", and most of the parameters are preceded with a s:. So for this item, you will get what the Standard Values renderings state, with it modified by this delta value on top. You will need to check this XML against the raw values of the Standard Values field to see what it's doing. For example, I can see that it is deleting (<p:d />) whatever rendering has uid="{A676EFBC-370E-46B7-B5F9-94D47D9093AC}". Same with uid="{4DA8179B-5CCC-4114-A322-F1C8AB41D955}".
Renderings xml seems to be suddenly broken We encountered something strange with the renderings. We have a form with 4 steps. All the 4 steps have the same template, but they all have different renderings. For steps 1 to 3, the renderings are loaded correctly (even in the CM the renderings are visible in the correct order in the presentation details). But for step 4 We get that not Layout was specified and no renderings are specified. Now the strange part starts, if we enable the "raw values" we get the following XMLs: Step 1 to 3 (working perfectly): <r xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <d id="{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}" l="{6D2049B2-34CE-4653-BEC9-206860EB9857}"> <r id="{CA8A09FA-6353-4CBF-94DB-92CD68D163B0}" ph="local-belgium-main" uid="{FD256D71-16B6-449E-8C08-42BFE2A6CD4B}" /> <r ds="" id="{BC464D77-8FB4-410C-A46D-8F2171DF18C7}" par="" ph="local-belgium-constrained" uid="{8C90ABF4-FFAA-4050-B099-F71C8D61C15C}" /> <r ds="{39ECF3E9-B19B-41A7-8A6F-59F0DBDB728E}" id="{966998AF-44C5-4FF4-A3BA-DDEC8DE7076C}" par="" ph="local-belgium-constrained" uid="{BACB3C74-CFF4-4495-91F4-E12043B04D58}" /> <r ds="" id="{E095D3B6-E620-450D-A225-961BE12283EF}" par="" ph="local-belgium-constrained" uid="{A1FFA733-32C9-480F-BE2E-38352D99E0B9}" /> <r id="{5A0E0EFE-21D4-4194-A772-90E88085B7AA}" ph="local-belgium-constrained" uid="{BC2CCD71-A242-463D-8231-9C75A90EC61E}" /> <r ds="{82E0C067-87BD-47C8-B419-E0D66923C2A8}" id="{55CBED47-26DF-4AEE-9FBA-82A5ADB5B9AD}" par="" ph="local-belgium-left" uid="{FBFFDFFB-B753-47DA-829A-C284B9AAF49C}" /> <r ds="{1CA34AA9-905A-492A-AAAD-291C2546BEE1}" id="{A62834D4-B607-42D5-9F90-FEFB715006B1}" par="" ph="local-belgium-left" uid="{CE158AFF-9B73-4A41-95D9-46A48E0125DD}" /> </d> </r> Step 4 (NOT WORKING): <r xmlns:p="p" xmlns:s="s" p:p="1"> <d id="{FE5D7FDF-89C0-4D99-9AA3-B5FBD009C9F3}"> <r uid="{A676EFBC-370E-46B7-B5F9-94D47D9093AC}"> <p:d /> </r><r uid="{4DA8179B-5CCC-4114-A322-F1C8AB41D955}"> <p:d /> </r><r uid="{FD256D71-16B6-449E-8C08-42BFE2A6CD4B}" p:before="*" s:id="{CA8A09FA-6353-4CBF-94DB-92CD68D163B0}" s:ph="local-belgium-main" /> <r uid="{8C90ABF4-FFAA-4050-B099-F71C8D61C15C}" p:after="r[@uid='{FD256D71-16B6-449E-8C08-42BFE2A6CD4B}']" s:ds="" s:id="{BC464D77-8FB4-410C-A46D-8F2171DF18C7}" s:par="" s:ph="local-belgium-constrained" /> <r uid="{A1FFA733-32C9-480F-BE2E-38352D99E0B9}" p:after="r[@uid='{8C90ABF4-FFAA-4050-B099-F71C8D61C15C}']" s:ds="" s:id="{E095D3B6-E620-450D-A225-961BE12283EF}" s:par="" s:ph="local-belgium-constrained" /> <r uid="{CE158AFF-9B73-4A41-95D9-46A48E0125DD}" p:after="*[1=2]" s:ds="{BAFB7E03-2E60-4677-80BC-CF2CE2D48923}" s:id="{D51D5868-8695-49EE-A63B-9CCBA46633DB}" s:par="" s:ph="local-belgium-constrained" /> </d> </r> As you can see, the XML is differently formatted. Is there something we can do to fix this? or do we manually need to adapt the faulty XML?
You should. Here are few things that you should know. Without this div element your rendering will not be SXA compliant. If you decide to skip it you will lose following features/abilities: your rendering will not be able to use "SXA styles". This div is the main wrapper and inside class attribute other classes which can be specified in Rendering Parameters will be injected (if your rendering parameters inherit from /sitecore/templates/Foundation/Experience Accelerator/Presentation/Rendering Parameters/IStyling). your rendering will not be recognised by Creative Exchange. Bear in mind that if you are going to allow designers to export your theme someone can add additional CSS classes and CE will not be able to import it then. if you decide to write a rendering with JS logic it is easier to register your JS logic (XA.register('accordions', XA.component.accordions);). You don't have to worry about loading order. You just implement 'interface' and your rendering will be initialized when it will be possible. You don't have to. I would say you will never implement this interface directly. What you can do is to use existing RenderingModelBase which implements IRenderingModelBase and derive from it. This is how it should be done and how it is done in SXA. To see whare are the benefits of using that model base class go to Appendix 1 to learn more. See how it is filled in FacebookCommentsRepository. There is FillBaseProperties(model); method which comes from Sitecore.XA.Foundation.Mvc.Repositories.Base.ModelRepository public override IRenderingModelBase GetModel() { FacebookCommentsRenderingModel model = new FacebookCommentsRenderingModel(); FillBaseProperties(model); model.DataHref = GetDataHref(); model.PostsCount = GetPostsCount(); model.ColorScheme = GetColorScheme(); return model; } This is how the new simple model could look like. As you can see it derive from RenderingModelBase and decorate type with 3 tiny properties. public class FacebookCommentsRenderingModel : RenderingModelBase { public string DataHref { get; set; } public string PostsCount { get; set; } public string ColorScheme { get; set; } } Appendix 1 RenderingModelBase class contains: public Item Item { get; set; } public Item PageItem { get; set; } public IRendering Rendering { get; set; } public Item DataSourceItem { set; get; } public IEnumerable<string> CssClasses { get; set; } public MvcHtmlString MessageEditHere { get; set; } public MvcHtmlString MessageIsEmpty { get; set; } public string HeadingTag { get; set; } public bool IsControlEditable { get; set; } public bool IsEdit { get; set; } public RenderingWebEditingParams RenderingWebEditingParams { get; set; } public Dictionary<string, List<string>> Attributes { get; set; } I will not describe every property, but some interesting are: IsEditable - invokes getControlEditability pipeline and determine whether your control can be editable. Used to display rendering in a different way in different context MessageEditHere - this is an auto-formatted string that can be returned to indicate that rendering should be edited HERE. Sometimes your rendering may return nothing due to lack of data source or some data. This is s string that should be displayed to make rendering still visible on the page MessageIsEmpty- this is auto formatted string that can be returned to indicate that rendering has no data source CssClasses - collection of css classess which I described in (1) Rendering - your current rendering item DataSourceItem - automatically resolved data source item of your rendering (Datasource from rendering parameters)
Create controller rendering in SXA As a test, I wanted to create a rendering for an SXA site. It had to be added to the toolbox and have a controller, model, and view. I read this Creating new renderings that are compatible with SXA and now I am somehow confused as in that answer only the controller and rendering parameters are mentioned and I remember this slide from the Sitecore Symposium: Here they also mentioned: adding a div to my view implementing IRenderingModelBase for the model So now my questions are: Do I need to do add this div to the view and what if I don't? Do I need to implement that interface and what will I benefit (or what will I miss if I don't)? If I have a custom model that implements this interface, what is the best way to fill all the properties involved? I found a GetModel() in the controller and a ModelRepository that might help but then I need to copy the values..
When it comes to deployment practices, most of the time when deploying code, the worker process is going to recycle itself in order to pick up the changes that it detected. In some cases, this recycle can cause problems. With that in mind, it is generally a best practice manually recycle the app pool as part of the deployment process. Most of the MongoDB related activities are performed through agents that have to subscribe to the Heartbeat event. Based on what you're saying, it sounds like enough of the app-pool is being changed (DLL's) to cause the app pool to send a SIGHUP to the application without fully restarting the app pool. When this happens, the Heartbeat is turned off, resulting in hooks and scheduled agents to stop running. Restarting/recycling the app pool in IIS fixes the issue. Check your logs after a deployment to see if you get the "Hosting environment shutdown" message, but no actual recycle.
Analytics Stops upon Code Deployment I am not sure if anyone ran into this issue before: We have an in house built tool to deploy code from the build server to specified destinations. Mongo reports/Custom Analytics is not working whenever we deploy code to the server and every time this happens IISReset fixes the issue. Notes: When we deploy the code we do not deploy Sitecore/App_Config or any Sitecore specific files but we do deploy application/project related files(layouts, sub layouts, .dlls) and also web config, global.asax. Is there any way to fix this issue other than resetting IIS?