output
stringlengths 34
25.7k
| instruction
stringlengths 81
31k
| input
stringclasses 1
value |
---|---|---|
@Gatogordo's "try turning it off and back on" suggestion did the trick. I found John West's All About Logging with Sitecore ASP.NET CMS blog post, which led me to an old SDN article, aptly named Wake up log files.
The article poses the following problem:
Occasionally after application restart log files are not working. How can I fix this without making a second restart?
As a solution, the article instructs you to create an ASPX file with the following contents:
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
log4net.LogManager.ResetConfiguration();
log4net.Config.DOMConfigurator.Configure();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Log wake up</title>
</head>
<body>
Done.
</body>
</html>
What this is doing is reloading the log4net configuration, essentially turning it off and back on again.
I added this to my site root, hit it from the browser and behold! I had log files! Thanks @Gatogordo!
|
One CD in Two-CD Cluster Not Writing Logs
I have a CD environment in a two-CD cluster running Sitecore 8.1u2, and today I noticed that my CD2 environment is not writing to its logs, even though it is running exactly as expected.
I verified the following:
CD1 and the CM are all writing to their logs, as expected
The site is still running and I do not have any relevant errors in the Event Viewer
Permissions have been assigned correctly (triple-checked and had a peer verify, as well)
UPDATE
The Data folder is configured correctly and is not being overridden (in response to @OwenNiblock's comments)
The LogFileAppender is set to the correct path (in response to @DerekC's answer)
I feel like I'm going crazy and that there is something ridiculously simple that I'm missing. Does anyone know what could cause logs to suddenly stop writing without error, and know how to fix it?
| |
If you do not have keys for the Sitecore.Commerce.Connect or Sitecore.Commerce.ConnectPartner modules in your license file, the following message may be displayed above the Quick Info section when opening the Content Editor:
You require one of the following licenses to use the Sitecore Commerce Connect module.
`Sitecore.Commerce.Connect` or `Sitecore.Commerce.ConnectPartner`
These license keys are not included by default.
Solution
To fix the issue, put the Sitecore.Support.105037.config file into the \App_Config\Include folder.
https://kb.sitecore.net/articles/852031
|
Sitecore Commerce Connect Module License Missing on Fresh Install
I've just installed a fresh Sitecore 8.1 Update-2 instance on my dev machine for a client and I'm getting the following warning on the Home item:
Required license is missing.
You require one of the following licenses to use the Sitecore Commerce Connect module. 'Sitecore.Commerce.Connect' or 'Sitecore.Commerce.ConnectPartner'
I'm using the client's license for this install and we are not using the Sitecore Commerce Connect module on their site. Why is this message popping up and how do I suppress it?
| |
I just wanted to add this for how I solve the security issues @guschi had.
Download Process Monitor from the Microsoft web site.
When you get it open, add the rule Result - Contains - access. This will only capture access denied hits. Eliminating all the other chatter from the drives. Be sure to click the Add button.
Then with the app open, uncheck the boxes for registry, network and services. This will leave only file system turned on.
Now when you try and run your index, you should see the access denieds piling up. If you open one, on the second tab you can see the user and the service that is causing the issue.
|
Indexing jobs queued
On the CM server, all jobs are getting queued, after the following jobs appear in a running state:
UpdateIndex_filesystem Indexing Running False 08.11.2016 15:43:19 0
UpdateIndex_web2 Indexing Running False 08.11.2016 15:43:19 0
UpdateIndex_web Indexing Running False 08.11.2016 15:43:19 0
UpdateIndex_master Indexing Running False 08.11.2016 15:43:19 0
Sitecore.Tasks.TaskDatabaseAgent schedule Running False 08.11.2016 15:48:13 0
UpdateIndex_filesystem Indexing Running False 08.11.2016 15:43:19 0
UpdateIndex_core Indexing Running False 08.11.2016 15:43:19 0
Index_Update_IndexName=sitecore_analytics_index Indexing Running False 08.11.2016 15:40:18 0
After an AppPool recycle it takes about 15 to 30 minutes until the same problem happens again. The Sitecore log- and crawling.log-file, as well as the Solr logging monitor (/solr/#/~logging) are not giving any indication of an error.
Because it is always the sitecore_analytics_index update job, which is getting started first, i assume it could be an issue with a corrupt solr index. But the index looks good in the Solr Core Admin. It could also be anything with the UpdateIndex_filesystem, which i don't know where this one comes from.
I already checked permission issues with Process Monitor according to the following post, but nothing helped: Sitecore index update jobs getting stuck
Has anyone experienced the same issue? Any recommendations on further investigation are very welcome.
Update: Edited 14/11/16 10:38 am.
Here is what i already did, during investigation:
Changed syncMaster index update strategy to intervalAsyncMaster for
all custom master indexes and sitecore master indexes
Set the Indexing.UpdateInterval setting's value to "00:00:00" to disable updates for the legacy search indexes
Removed the <exclude hint="list:AddExcludedTemplate"> node from the
defaultSolrIndexConfiguration, which lead to the crawling log
warnings: WARN You have specified both IncludeTemplates and ExcludeTemplates. This logic is not supported. Exclude templates will be ignored.
Set the intervalAsyncMaster update strategy's interval to "00:01:00"
Set the intervalAsyncMaster update strategy's <CheckForThreshold> to
false
Added a for each index with a
SolrDocumentSizeCommitPolicy of maximum 1MB
Removed index update strategies in SwitchMasterToWeb.config for the
CD environments
Cleaned the Sitecore_master DB's EventQueue and validated that the
"Sitecore.Tasks.CleanupEventQueue" agent's IntervalToKeep is set
(01:30:00).
Truncated the Sitecore_master DB's PublishQueue and set
"Sitecore.Tasks.CleanupPublishQueue" agent's property DaysToKeep to 2
days.
Sadly, we're still facing the issue. The running job queue is a lot shorter than before, because of the new index update strategies, but the indexing jobs are still getting stuck in a running state and are blocking the job queue.
Maybe there is a relation to new added Languages. We went up from 19 Languages to 39. This means a lot more items are getting indexed. All Solr cores together are using ~11GB disk space. Solr Logging isn't showing any errors or warnings and Dashboard is looking fine as well:
Physical Memory: 3.85 / 32 GB (12%)
Swap Space: 4.8 / 36.75 GB (11.1%)
JVM-Memory: 781.83 MB / 1.92 GB (39.8%)
Solr looks healthy to me.
Update: Edited 24/11/16 11:20 am.
I finally solved the issue with a new setup of the website including physically web root, IIS-website and application pool as well as setting the AppPool permissions. I suspect wrong configured AppPool user permissions on some files in the web root, which could have happened during the manual deployment process or a broken AppPool with corrupted userprofiles/accounts.
Conclusion:
Using automated deployments is going to avoid such issues - saving time and nerves. At least the Solr indexing configurations have been improved ;)
| |
If this is version 4, make sure that the item is within the scope of your crawler: https://developers.coveo.com/display/SitecoreV4/Changing+the+Crawling+Root+of+an+Index
The crawler scope by default will only include Media Library >> Files and Sitecore >> Content. If your bucket is outside of this path, you need to change the crawler's scope.
Also, if you are using Inbound Filtering in the indexing pipeline, make sure it is not removing your item. Sitecore Inbound filtering will affect all indexes, including Coveo.
Finally, since this is an On-Premises index, keep an eye on the RabbitMQ queues when rebuilding: https://developers.coveo.com/display/SitecoreV4/Accessing+the+RabbitMQ+Management+Console+-+On-Premises
Once you are logged in, navigate to the Queue tab to see the status of your queues. If you see remaining documents in your queues, then you have a problem. You can get the messages by using the GetMessage section of that tab. The Get Message will do a "pop" action in the queue, which will allow you to see the message, but will also remove it.
And also keep an eye in the CES Console when rebuilding, the error might not show on the Sitecore side, but could show in Coveo: https://onlinehelp.coveo.com/en/ces/7.0/administrator/using_the_ces_console.htm
For larger items, messages going through the queue is a simple reference to the Sitecore item, which means that Coveo will need to ping Sitecore back. It is possible that Coveo could be unable to reach certain items, the console will tell you.
|
Content missing from Coveo indexes
I have an item (in a bucket) that I cannot find in the Coveo indexes. I can find the item in my master and web databases no problem, but when I go to the CES 7 admin panel (this is a free on-prem edition) and search my indexes for the item name, I get no results.
I made a small change to the item and saved/published, and in the indexing manager I see a change to the time, but I don't see a status change when I go back to the index status page in the Index - Sources and Collections window - it says the last operation was "rebuild" source over a week ago. I would think this would show the incremental change I made.
I also confirmed the published date/unpublished date aren't preventing it from being published. I don't see anything in the log that screams "problem" either, so I'm now lost in the woods. Does anyone have a gumdrop trail to help? :)
| |
I've had success in the past by fully-qualifying the UrlAgent's parameter with the full host name, though I'm not familiar with the specific error you're displaying.
Example:
<agent type="Sitecore.Tasks.UrlAgent" method="Run" interval="00:15:00">
<param desc="url">https://www.myapplication.com/sitecore/service/keepalive.aspx</param>
<LogActivity>true</LogActivity>
</agent>
|
How does one get the keepalive.aspx to work over SSL?
Is there a way to get Sitecore to accept the SSL cert or are we required to disable HTTPS on those directories?
ManagedPoolThread #14 12:46:43 ERROR Exception in UrlAgent (url: /sitecore/service/keepalive.aspx)
Exception: System.Net.WebException
Message: The underlying connection was closed: An unexpected error occurred on a send.
Source: System
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadData(Uri address)
at Sitecore.Web.WebUtil.ExecuteWebPage(String url, NameValueCollection headers)
at Sitecore.Tasks.UrlAgent.Run()
Nested Exception
Exception: System.IO.IOException
Message: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Source: System
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async)
Nested Exception
Exception: System.Net.Sockets.SocketException
Message: An existing connection was forcibly closed by the remote host
Source: System
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
| |
Audit information is available in the logs, and I thought there was a way to isolate them in a separate log file by changing log4net settings. But you could also use the Audit Trail module from the marketplace: https://marketplace.sitecore.net/Modules/S/Sitecore_Audit_Trail.aspx
Helps you to answer following questions:
Who did change?
When it happened?
What all actions happened on aparticular day?
...
|
Audit log for seeing who updated content when
Hopefully a simple question - is there any kind of ready-made audit log built into Sitecore so I can see who edited content when? I know without versioning the content, the last updated date/user would likely keep overwriting itself, but even knowing who was the last to do something with an item would be useful data. The History table might give some useful info perhaps but I’m not sure. Thanks.
| |
This works because of the way that HtmlCacheClear processes the <sites> list.
When you take a peek into the code for HtmlCacheClearer.ClearCache() method, you'll see that it's iterating through the list of sites in a basic for() loop. Therefore, the element name of the list item makes no difference whatsoever.
As for how it changed to MyCompanyName in prod, I have no idea. Bad transform file? Either way, it doesn't matter.
You will be safe changing it on QA.
/// <summary>Clears the cache.</summary>
/// <param name="sender">The sender.</param>
/// <param name="args">The arguments.</param>
public void ClearCache(object sender, EventArgs args)
{
...
for (int index = 0; index < this._sites.Count; ++index)
{
string siteName = this._sites[index] as string;
...
}
...
}
|
SiteDefinition Config Events - Site Changed to MyCompanyName
I noticed a strange difference between our Production and QA Sitecore websites that was deliberately done by our Sitecore vendor.
In the SiteDefinition.config file, the site block is changed to MyCompanyName.
Why would this be different? Can I change the one on QA to match Production or will that break something?
QA:
<events>
<event name="publish:end">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<site>MyCompanyName</site>
</sites>
</handler>
</event>
<event name="publish:end:remote">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<site>MyCompanyName</site>
</sites>
</handler>
</event>
</events>
PROD:
<events>
<event name="publish:end">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<MyCompanyName>MyCompanyName</MyCompanyName>
</sites>
</handler>
</event>
<event name="publish:end:remote">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<MyCompanyName>MyCompanyName</MyCompanyName>
</sites>
</handler>
</event>
</events>
| |
This is a limitation of ASP.NET, which is what Sitecore uses.
You need code to register new culture/language combinations.
Sitecore Marketplace module that will help you: https://marketplace.sitecore.net/en/Modules/Custom_Language_Registration.aspx
You'll need to remember to install the custom language on each machine running Sitecore (every CM and CD in development and production).
Demonstration of module: http://www.bugdebugzone.com/2013/12/adding-custom-language-code-in-sitecore.html
Code wise, if you don't want to install a module (tool) for this, here's a snippet that does the same thing.
private static void RegisterCulture(string cultureCode, string cultureName, string baseCultureCode)
{
var ci = new CultureInfo(baseCultureCode);
var ri = new RegionInfo(ci.Name);
var builder = new CultureAndRegionInfoBuilder(cultureCode, CultureAndRegionModifiers.None);
builder.LoadDataFromCultureInfo(ci);
builder.LoadDataFromRegionInfo(ri);
builder.CultureEnglishName = cultureName;
builder.CultureNativeName = cultureName;
try
{
builder.Register();
}
catch (InvalidOperationException)
{
}
}
Sourced from here: https://stackoverflow.com/questions/15336263/asp-net-mvc-registering-custom-culture-and-internationalization
|
Adding a new language option that is not predefined?
I got a request from one of our international content owners where they wanted a site in anglicized English but for a country that does not have a pre-set for English.
In this case it would be an anglicized English site for Saudi Arabia - en-SA. When I choose the the Add a new language option, I specify the language en and the country SA but I am then confronted with the error:
The name "en-SA" is not a valid or supported culture identifier.
Do I need to do this another way or is it just not possible? I've never had to do this, but it seems that this is exactly why the option to specify a language and country is an option of this dialogue.
| |
At the moment SXA doesn't support such kinds of mapping. I would recommend to go with Rendering Variants. You can create one rendering variant which will have following fields:
Title
Content
Published Date
Profile Picture
Rendering variants won't render fields which don't exist so Published Date and Profile Picture will be only shown if items of News or Author templates will be found.
Regarding sorting:
you can choose default sort order in the Search Results rendering properties
add Sort Results component which can be configured to use pre-defined sorting options which are stored here: SITE/Data/Search/Sort Results
|
SXA Search Results Different Rendering Variants per Template
Is there a recommended approach to creating a Search Results in SXA that have different renderings for different content types? The use case would be something like this:
There are 3 content types,
Page - default from SXA with Title and Content fields
News - inherits from Page, adds Published Date datetime field
Author - inherits from Page, adds Profile Picture image field
There is a single site wide search page, the result set could contain all the above item types. Using Rendering Variants, all the fields, from all the templates can be listed under a new variant, however this adds some constraints to how you can order all of the fields, as well as becoming confusing if when trying to figure out which field is for which template.
I have built similar functionality outside of the SXA context which usually ends up having some sort of TemplateID/TemplateName to Controller/View/Model mapping, either in Sitecore or Config files.
In this case, I'd like the results page to use as much of the out-of-the-box SXA search components as possible.
| |
Things to keep in mind
Whenever you have a site with user-generated content, you need to make sure that you keep the following in mind:
Security is both more important and more difficult
If storing user-generated media, performance can be a major factor, depending on the media that you are storing, how you store it, and how media-intensive the site is
If storing complex objects then custom Sitecore User Profiles are not for you, since all properties must be serializable and you really don't want to slow this down
In a scaled environment, you have no access to the Master database (I know that you know this, especially given the post that you linked to, but I have to say it)
CDNs are your friend, can be used for all sorts of media, and you can easily throw caches in front of them
Using an external database does not prevent you from using Sitecore's HTML Caching on renderings that display the UGC (which means that you can cache the UGC with Sitecore)
If you need a GUI to view, edit or moderate the UGC then you will need to factor that into deciding whether or not to use a third-party tool, an extra web database or a custom SQL database
If your UGC is a user blog, forum, etc. then you're not in the wrong place, but you might benefit from some of the third-party tools out there, like Telligent, that are designed for these relatively consistent data structures
If your UGC is multi-lingual then you increase the complexity of a custom SQL database architecture, and may dramatically increase the overall effort required to build the code, database, and/or a user-generated content GUI
When Should I use a Sitecore database for UGC?
I would use a Sitecore database for large quantities of hierarchical UGC. As an example, if your UGC is for something like a user-blog or a forum, provided that a paid tool like Telligent isn't an option, a Sitecore database may be a good candidate. The hierarchical structure and the ability of the content authors to examine and/or moderate content in the additional database would make good use of Sitecore's tools, and would save you a sizable amount of effort.
When shoudn't I use a Sitecore database for UGC?
As a general rule, it is my opinion that if the content isn't going to be hierarchical then you shouldn't try to make it fit into Sitecore.
Remember that Sitecore is an enterprise-level CMS and its databases are designed to hold pretty much any data, so long as the data is structured appropriately. Sitecore is great with caching and all the performance voodoo, but it is still has a lot of overhead. You can create a SQL database to store UGC for a user and throw a cache in front of it and you will not only still be able to use Sitecore's HTML Caching, but your database will likely be a lot smaller, simpler and more performant than a Sitecore database.
How should I store my UGC if I am not using a Sitecore database?
First, CDNs are your friend. Use them for all your media. You can add all sorts of caching between them and your application, and you can store references to them (e.g. image URLs, etc.) in your custom database or User Profiles. I cannot recommend CDNs strongly enough.
Second, Entity Framework and SQL are great if you have a lot of data to store, or if you have to store complex objects. EF is great for performance too, you can use Linq with it OOTB, and the sky is the limit with your data structures so you can make it suit your needs. There are, however, three problems with making your own SQL database to hold your data:
It can take time to come up with the right database architecture
Making changes to tables later on isn't always as straight-forward as you might think
If you need a GUI for your authors to edit, review or moderate the UGC then you will have to create it from scratch
Third, try to store as little data in custom Sitecore User Profile properties as possible. Remember that User Profiles are serialized and deserialized, so loading them up with large amounts of information and heavy objects will have a noticeable impact on performance. I recommend storing only something like the associated user ID from the custom database in the user's profile.
Fourth, if your solution is multi-lingual and you go with a custom database then be sure to make your language fallback consistent, reusable, overridable, simple, and easily controllable. I have seen the treatment of multi-lingual UGC make or break the implementation more often than I have seen anything else do so.
What should my custom database look like?
Your custom database can take many forms, depending on your implementation. In the spirit of re-usability, whenever I have a very large quantity of widely varied UGC to store, I prefer to use a flexible database architecture similar to the following (examples provided):
User (ID, Username)
|- jsmith
|- bjordan
ContentTypes (ID, Name)
|- Text
|- Rich Text
|- Media Reference
|- Numeric
|- Sitecore Reference
|- Sitecore Delimited Reference
ContentFieldDefinitions (ID, Name, ContentType)
|- Address, Text
|- Age, Numeric
|- Profile Photo, Media Reference
ContentFields (ID, DefinitionID, UserID)
|- Address
|- Age
|- Profile Photo
Languages (ID, Name, Code)
|- English, "en"
|- French (France), "fr-fr"
|- Spanish (Mexico), "es-mx"
ContentFieldValues (ID, FieldID, LanguageID)
|- "John Smith"
|- "110 Core Site Ln"
|- "13"
|- "Esto es un ejemplo"
|- "http://cdn.mydomain.com/images/someimage.png"
|- "{B07D2864-0A7A-4AC1-B729-89D44FABBFE9}"
|- "{966FA00C-9AD2-44F9-AB44-0DA65B94FB27}|{075701C7-2558-40B2-AC16-CFE930F9C65C}"
Basically, I use a very loose structure, similar to Sitecore's own (though mine is flat, while Sitecore's is hierarchical), which supports pretty much any type of UGC, regardless of complexity level or language-specific content. This flexible architecture saves me a lot of effort in my implementations and makes the solution pretty easy to extend and maintain, but it costs me in performance and database readability without a GUI.
For those implementations that store a smaller quantity of varied UGC types, I tend to create a more tailored and specific database architecture. This saves me on performance and readability, but costs me in effort, extensibility and maintainability. As effort is often a major factor, I tend to only go this route if performance is a serious concern, or if the data being stored is relatively simple. Note that following this path for multi-lingual content can be a path to the "dark side" if you are not careful. Avoid writing the same multilingual support code, tables and columns over and over again.
|
Options for handling user-generated content
This is pretty much a duplicate from Alex's question on stack overflow, but I was wondering if there had been any developments in the 6 years since that question was asked...
We have a need to store user-generated content - images and files. One approach was documented by Kevin Brechbühl here based on a presentation from Martina. However, on the surface, this feels hacky. Full disclosure, I have not actually tried this yet.
Another approach would be to simply store user-generated content in a separate database.
How are others handling user-generated content?
| |
Answer 1
No there is no security. You did everything fine
Explanation:
When you open following item: /sitecore/templates/Feature/Experience Accelerator/Navigation/Rendering Parameters/Navigation/Navigation Settings/NavigationRoot you will notice that inside Source field there is following token query:$home.
This token should be resolved to start item of your site. Nothing else special here, standard Droptree field with dynamic source
Answer 2
My theory is that you created your site on SXA 1.0.
There was an issue in site scaffolding and not all fields were populated correctly.
Solution:
Navigate to your site definition item (/sitecore/content/Group/Tenant/site/Settings/Site Grouping/site) and make sure that Start Item field is set.
I suppose that in your case it is not, thus you can see not your Home item but default Sitecore Home item because $home token in Navigation Rendering Parameters was incorrectly resolved.
You can also notice that by looking at the Home item icon as well. SXA home template icon is slightly different.
Closing Words
In SXA 1.1 this issue has been resolved and you no longer need to define Star Item manually.
Additional solution
This solution is for people who could not solve their issue with the solution provided above.
There is some rare case when, even if you have got everything configured properly your site is resolved incorrectly, thus some functionalities might not work as expected (navigation is a great example).
How do I know if I am experiencing that extra case
Assuming that you configured everything like I described above and you open a page using Experience Editor button from Content Editor and gets sc_site query parameter with website value or value different than your site definition item name then you've got a problem.
How to mitigate this:
To mitigate that issue you have to reconfigure standard Sitecore website a little bit. What we want is rootPath property cannot be a substring of any other SXA based sites rootPath.
Default value isrootPath="/sitecore/content" and we need to make it more unique, for example rootPath="/sitecore/content/default".
Then you have to create any item under /sitecore/content and move default Sitecore Home item there.
Summary
This is a workaround for a small issue that we've found with @keith-vanderveen in site info resolution logic.
This issue should be fixed in the next release of SXA.
Affected versions:
SXA 1.0, SXA 1.1
|
Why can't I select a page in my website when using SXA?
I have created a new SXA site (using Sitecore Experience Accelerator 1.1 rev. 161004 for 8.2.zip) and I've created several different pages (inside of Content Editor). I'm trying to use the Navigation component to provide a sub-navigation menu. So I go to the Control Properties, and go to the Navigation Settings to select a Start Page. When I click on the down arrow to select my start page, none of the pages show up underneath my Home node. Here's what I'm seeing:
Is there some kind of security that I bypassed when creating those pages in content editor?
How can I get any pages to show up underneath the Home node?
| |
If you want to skip adding rendering to an empty Container each time you add a new page try this trick.
Put Rich Text on your Partial design
Now open its rendering parameters and see what is in Data Source field.
There should be something like this: local:/Data/Text
Now let's change it to: page:/Data/Text
From now when you open your page where you currently using this design you will notice that you can edit this Rich Text.
Make sure that you have recreated proper Data folder structure with Text item under your page
From now you can edit Rich Text which is located on a Partial design (in a single place) but at the same time, you are able to edit content separately for different pages as data source is stored under Page Data.
Of course, this solution is not perfect because you have to add datasource items manually.
This can be solved!
Create a Branch with your Page and create predefined Page Data folder structure with all needed datasources for renderings which are defined on a partial design, then add it as an Insert Option.
The advantage of this solution is fact that this rendering is available for editing but could not be removed from the page.
|
Does SXA support page specific content with Partial Design?
When I build my page in SXA I use components like Rich Text to implement page elements. Content I entered is stored in component data-source on page level.
This is exactly what typical content author need.
If several of my pages share common design, SXA recommends to use Partial Designs.
I tried to use it and discovered that components moved to Partial Design are not editable on page level anymore and cannot have page specific content.
I guess that is fine for *Reusable components, but for regular components it looks strange.
How can I use Partial Designs and have page specific Rich Text content in that design?
| |
First off, you need to control the execution order of your controller renderings. You need the controller that renders the <head> element to render after the controller "which knows about paging".
One way to achieve this, is using a setup like this:
@using Sitecore.Mvc
@{
Layout = null;
HtmlString main = Html.Sitecore().Placeholder("MAIN");
HtmlString head = Html.Sitecore().Placeholder("HEAD");
}
<!DOCTYPE html>
<html>
<head>
<title>@Html.Sitecore().Field("title", new { DisableWebEdit = true })</title>
@head
</head>
<body>
<h1>@Html.Sitecore().Field("title")</h1>
<h2>Cross component comms layout</h2>
<div>
@main
</div>
</body>
</html>
Using this technique, everything in the "MAIN" placeholder executes before anything in the "HEAD" placeholder.
Now you can, in your controller that knows paging, leave a "breadcrumb" for your "HEAD" controller (to write "prev" and "next" links) to pick up.
Something like:
HttpContext.Current.Items["prevUrl"] = "myurl?page=1";
HttpContext.Current.Items["nextUrl"] = "myurl?page=3";
Jeremy Davis wrote up a full example of this in his blog, when we last had a discussion on how to achieve this on Slack. Getting MVC Components to Communicate. It even uses pagination as an example.
|
SEO pagination - how to update the head tag from a controller rendering
Im trying to add Seo friendly pagination. This means I need two tags in the head section (For example if I was on page 2)
<link rel="prev" href="myurl?page=1" />
<link rel="next" href="myurl?page=3" />
But my pagination is part of a controller rendering. So I cant figure out how to update these tags from the controller. I need to hide the prev tag on the first page and hide the next tag on the last page. I need to hide both if the results only end up being one page. Some of my paging is server side, and some is client side. Regardless I can really only see how to do this with Javascript. The place where I know the current page and the if I am on the last page is in the controller which does not seem to have access to the head tag. I could have it be its own rendering tied to a page, but that means the page needs to know it has some sort of paged control on it, and I still down see how to know which page its on at any given time. I can get the current page from the query string, but that doesnt help to know if its the last page or not.
| |
It is a dictionary item in core database. So go to the core, open Content Editor. Search for this item: /sitecore/system/Dictionary/S/Some of the fields in this item contain critical errors Are you sure you want to save this item. Here you can set the Phrase to your language.
|
How to show custom message while submitting workflow comment window?
I have created a custom comment template with two field - Comments and Author Name. I marked both the fields validation as Required.
I applied this custom comment template to my workflow and this workflow is applied to template.
So when I submitting his workflow items, my custom window is displaying. If I am not entering any values in this custom comment window fields, Sitecore give me message box as "Some of the fields in this item contain critical errors. Are you sure you want to save this item?" as below
My question is that how can I change this message to some custom message?
| |
The main thing you need to set up is the Instance Names in your ScalabilitySettings.config file.
The names can be anything they just need to be consistent between the CM and CD.
You can leave these blank and Sitecore will create it's own unique names which can cause issues if you switch IIS sites, so it's safer if you create the names yourself.
On the CD server, change these settings:
<setting name="InstanceName">
<patch:attribute name="value">MyCDServer1</patch:attribute>
</setting>
<!-- PUBLISHING INSTANCE
Assigns the instance name of dedicated Sitecore installation for publishing operations.
When empty, all publishing operations are performed on the local installation of Sitecore.
Default vaue: (empty)
-->
<setting name="Publishing.PublishingInstance">
<patch:attribute name="value">MyCMServer</patch:attribute>
</setting>
On the CM Server:
<setting name="InstanceName">
<patch:attribute name="value">MyCMServer</patch:attribute>
</setting>
<!-- PUBLISHING INSTANCE
Assigns the instance name of dedicated Sitecore installation for publishing operations.
When empty, all publishing operations are performed on the local installation of Sitecore.
Default vaue: (empty)
-->
<setting name="Publishing.PublishingInstance">
<patch:attribute name="value">MyCMServer</patch:attribute>
</setting>
Also make sure EnableEventQueues setting is set to true.
With this in place, In basic terms (With default settings), if a publish is performed on the CM box the CM box will trigger a publish:end:remote event - this will get added to the EventQueue table in the database (In your case the pub database).
This will then in turn trigger the OnPublishEndAsync index update strategy which will add the new items to the index.
If you need to do a complete rebuild of the content delivery indexes you need to add the strategy - Remote Rebuild in your index configuration
<strategies hint="list:AddStrategy">
<!-- NOTE: order of these is controls the execution order -->
<!- Existing Strategy here -->
<strategy ref="contentSearch/indexUpdateStrategies/remoteRebuild" />
</strategies>
|
Content delivery setup - Lucene indexes
I have an issue that Lucene indexes are not updated or properly created on the content delivery server after a rebuild of the indexes on the content management server or after an item publish. The version I am using is Sitecore 8.1 rev. 151207 and I followed the documentation listed on https://doc.sitecore.net/sitecore_experience_platform/81/setting_up__maintaining/xdb/configuring_servers/configure_a_content_delivery_server to configure the content delivery server. As you would have guessed, Sitecore access is completely blocked on the CD server meaning a rebuild is not possible on that particular server.
I have the following situation:
Databases
core
master
web (serves as the primary database for the content management server)
pub (serves as the primary database for the content delivery server and a publishing target is defined for this database)
Servers
Content delivery which fetches data from the pub database
Content management which uses all other databases to administer Sitecore, but also functions as a staging environment and fetches data from the web database
Index configuration CM
Web lucene index is not disabled since the site is being used as a staging environment.
Index configuration CD
Added additional Lucene index configuration files for the pub database. Secondly disabled all the web index configuration files.
Could someone point me in the right direction on how to set up the Lucene index configuration on both CM and CD servers regarding my setup with the 'web' and 'pub' databases? Secondly can someone explain the mechanism how indexes are actually being updated on the content delivery server when content is updated on the content management server?
| |
The folders you mention will not get cleared automatically.
Reason been that, for example __UpgradeHistory is created when you run an sitecore upgrade and it contains all the valuable information (results, errors, packages, etc) about upgrades. These information is useful when you try to debug upgrade issues (ex: sitecore support sometimes ask for these forlders when you raise an issue with upgrades)
If you want these folders to be cleaned, you have to delete them manually.
|
When is the website's temp folder cleaned?
I'm trying to figure out when the temp folder gets cleaned.
Talking about this setting in Sitecore.Config:
`<sc.variable name="tempFolder" value="/temp"/>`
From what I found, there is a CleanupAgent in Sitecore.config defined for clearing the diagnostics folder in temp. But I haven't found anything that clears other folders or files in the temp folder.
Conclusion: they don't get deleted?
Folder examples are: __UpgradeHistory, IconCache, Install
<!-- Agent to clean up work files -->
<agent type="Sitecore.Tasks.CleanupAgent" method="Run" interval="06:00:00">
<!-- Specifies files to be cleaned up.
If rolling="true", [minCount] and [maxCount] will be ignored.
[minAge] and [maxAge] must be specified as [days.]hh:mm:ss. The default value
of [minAge] is 30 minutes.
[strategy]: number of files within hour, day, week, month, year
[recursive=true|false]: descend folders?
-->
<files hint="raw:AddCommand">
<remove folder="$(dataFolder)/logs" pattern="*log.*.txt" maxAge="30.00:00:00"/>
<remove folder="$(dataFolder)/viewstate" pattern="*.txt" maxAge="2.00:00:00" recursive="true"/>
<remove folder="$(dataFolder)/Dashboard reports" pattern="*.*" maxAge="2.00:00:00" recursive="true"/>
<remove folder="$(tempFolder)/diagnostics" pattern="*.*" maxAge="00:10:00" recursive="true"/>
<remove folder="/App_Data/MediaCache" pattern="*.*" maxAge="90.00:00:00" recursive="true"/>
</files>
</agent>
Is there an overview of when what gets deleted/invalidated in the temp folder?
| |
You must have a Placeholder Settings item that has Renderings selected in the Allowed Controls field. The selected Renderings must also be marked as Editable.
The Placeholder Settings item must have the placeholder name in the Placeholder Key field or assigned to the placeholder name in the Presentation on the __Standard Values of the page template.
Dynamic Placeholders
If you are using a Dynamic Placeholder implementation, make sure it has properly implemented it's own version of the GetAllowedRenderings pipeline processor. This pipeline processor (found in the GetPlaceholderRenderings portion of the pipeline) is responsible for building the list of Renderings to display when clicking the "Add to here" button in Experience Editor.
So, for instance, if we have a custom processor called GetDynamicKeyAllowedRenderings , the processor code may look something like this:
public class GetDynamicKeyAllowedRenderings : GetAllowedRenderings
{
public new void Process(GetPlaceholderRenderingsArgs args)
{
Item placeholderSettingsItem = null
// Figure out if this is a dynamic placeholder
// and get the proper placeholder settings item from Sitecore.
....
List<Item> allowedRenderings = null;
if (placeholderSettingsItem != null)
{
bool flag;
args.HasPlaceholderSettings = true;
// Get the list of allowed renderings for this placeholder
allowedRenderings = GetRenderings(placeholderSettingsItem , out flag);
if (flag)
{
args.CustomData["allowedControlsSpecified"] = true;
// If GetRenderings returns a list of renderings to display, this must be set to false.
// If set to true, the Allowed Renderings pane will always show the tree view.
args.Options.ShowTree = false;
}
}
if (allowedRenderings == null) return;
if (args.PlaceholderRenderings == null)
{
args.PlaceholderRenderings = new List<Item>();
}
args.PlaceholderRenderings.AddRange(allowedRenderings);
}
}
The key to the code above, is to set args.Options.ShowTree = true if there are renderings to display. If this remains false, it will always show the tree view (as seen in the screenshot in the question).
|
Add to here button does not show allowed controls
I have Editable check-box checked at all the required places and have related settings. The problem appears when clicked on Add to here button and it pops up Select a Rendering empty window.
I have spent hours to figure this out but still no luck. Looking forward to your thoughts on this. Thanks!
| |
1)
sxacontent is a computed field with following implementation Sitecore.XA.Foundation.Search.ComputedFields.AggregatedContent
If you open it you will see for example this piece of code.
if (item.Paths.IsMediaItem)
{
return _mediaContentExtractor.ComputeFieldValue(indexable);
}
Media items are handled different.
if (!item.IsPageItem() && !IsPoi.Verify(item))
{
return null;
}
Only items under you Start Item (by default Home item will be indexed) and Items with certain POI fields.
You can provide your own implementation by overwriting following config node (example for Solr)
<field fieldName="sxacontent" returnType="textCollection" type="Sitecore.XA.Foundation.Search.ComputedFields.AggregatedContent, Sitecore.XA.Foundation.Search">
2)
Index is updated like in vanilla Sitecore. SXA does not provide additional triggers, except additional processor GetDatasourceDependencies in indexing.getDependencies pipeline.
You might be right. I would need to perform test for different scenarios to verify this.
Implementation provides fields indexing for Data items once index rebuild is triggered for your page item but it will be skipped once you touch data item.
But there is that additional processor for adding referenced items (data items) so everything should be fine
If you could provide exact steps to reproduce I will be able to verify it and report as a bug.
|
Search component in SXA
I was playing around with the ootb search components in SXA and I got some results so yes, it's working. But now I wanted to know what was all included in the searchable content (apparently computed in a SxaContent field) and noticed that content from a reusable RT field was included. Cool. When I update the RT value, the index seems to follow as I can find my new content. But when I add the RT to another page, that page is not found as well. So now I have 2 (related, so bundled) questions:
What is included in the "searchable content" of a page in a default sxa setup? And can this be customized? And do I need to do something in a custom component to add (or remove) the data in the search results?
How is the index updated? As mentioned, I noticed that a reusable data item change seemed to affect the pages the component was on, which is cool. But when adding a component to a page, that extra text was not found in the index. So, how does the index know what to update and is it possible that some data might be missed?
| |
Sitecore Fast Query does not support language filtering.
Fast query does not account for the context language (results include items with versions that match the query in any language)
Source: https://community.sitecore.net/technical_blogs/b/sitecorejohn_blog/posts/sitecore-query-cheat-sheet
|
How to populate droplist field option using fastquery and option should be based on language-wise
How to populate droplist field option using fastquery and option should be based on language wise?
| |
As a first port of call, I would try reinstalling the SharePoint module.
From the docs I would check that the "Sharepoint Integration Configuration" template exists:
To integrate SharePoint lists with the Sitecore content tree or the
Media Library use the SharePoint Integration wizard to create a
SharePoint integration definition item based on the SharePoint
Integration Configuration template. You can find the SharePoint
Integration Configuration template at the following location:
/sitecore/templates/Sharepoint/Item Level Integration/Sharepoint
Integration Configuration
It sounds like the field referenced should exist on the items being called. Check that this field exists - I believe it's needed for Item Level Configuration:
SPIF determines which configuration to use using the following
prioritization:
1. It checks whether there is an alternative configuration. For item-level integration, the configuration is in the Integration
Configuration Data field of the Integration Definition item. For more
information about configuration for item-level integration, see
section Editing the XML in a SharePoint Integration Definition Item.
2. If there are no alternative configuration details, SPIF checks for predefined configuration details in the sharepoint.config file.
3. If there are no predefined configuration details, it uses the default configuration details.
Also, can you open the Sharepoint Integration Wizard? From there you should be able to check that you don't have incorrectly assigned templates and field mappings.
|
Item '/sitecore/media library' does not contain IntegrationConfigData field
I am getting several exceptions on the CMS Master server, such as the one shown below.
ManagedPoolThread #17 2016:10:25 08:23:54 ERROR Synchronization context can not be created for "media library" integration config data source item.
Exception: System.Exception
Message: Item "/sitecore/media library" does not contain IntegrationConfigData field.
Source: Sitecore.Sharepoint.Data.Providers
at Sitecore.Sharepoint.Data.Providers.IntegrationConfig.IntegrationConfigDataProvider.ValidateIntegrationItem(Item targetIntegrationItem)
at Sitecore.Sharepoint.Data.Providers.IntegrationConfig.IntegrationConfigDataProvider.GetFromItem(Item sourceIntegrationItem)
at Sitecore.Sharepoint.Data.Providers.SynchContext.Initialize()
at Sitecore.Sharepoint.Data.Providers.SharepointProvider.ProcessTree(ProcessIntegrationItemsOptions processIntegrationItemsOptions, Item integrationConfigDataSource)
My Sitecore CMS is version 7.0 I have separate Master Server and Content Delivery servers configured as well.
I have SharePoint integration with Sitecore setup.
Any ideas what could be wrong with my configuration?
| |
Sitecore.Analytics.Data.DataAccess.DataAdapterManager.Provider.DeleteContact(new ID(contactId));
After that you might run the following to update the index:
var index = Sitecore.ContentSearch.ContentSearchManager.GetAnalyticsIndex();
index.Refresh();
But note that it is time and resource consuming.
|
How to delete a Contact programmatically in xDB
Does anyone know how delete/remove a xDB Contact programmatically in Sitecore (8.1+), which also ensures a correct (re)-indexing?
Or, is there another strategy? Such as scrambling the identifier? - or - merging it into void?
| |
If you go to your page test definition in the content editor under /sitecore/system/Marketing Control Panel/Test Lab after the draft has been saved, you can see that there is a Conversion field that allows you to select multiple goals. However, the Winner Strategy that is provided out-of-the-box, Sitecore.ContentTesting.Analytics.WinnerStrategies.TestObjectiveBasedStrategy only uses the first selection. You would need to create a class that implements Sitecore.ContentTesting.Analytics.WinnerStrategies.IWinnerStrategy and add another Test Winner Strategyitem under /sitecore/system/Settings/Content Testing/Test Winner Strategies. You could then select that strategy on your test.
Note that the actual implementation of the strategy could be rather complicated. It will be different depending on if you want the user to achieve both goals, if achieving either is sufficient, if you wanted to use the values assigned to the goals, etc.
|
How can I connect two goals to a page test?
When creating a page test in Sitecore Experience Optimization you can as test objective choose to connect either one specific goal or all your goals (trailing value/visit). Do any of you know about a possibility or work around to connect two specific goals to a page test in the Experience Optimization?
| |
To pull content from a PROD instance back to a QA instance I would highly recommend using Sitecore Sidekick - Content Migrator
This tool uses Rainbow Serialization under the hood to quickly migrate content from one Sitecore database to another.
From Jeffs blog:
The Content Migrator will move content in a multi-threaded way. The system is designed to be as fast as the Sitecore Item API can go. When the operation starts it spins up two separate thread pools, one for transmission of serialized item data from the remote server and another to ingest that data into Sitecore. Since the inhibiting factor here is the rate in which Sitecore can write item data to the database you can virtually eliminate the penalty of pulling items over the network in most cases (the obvious exceptions being transmission over a slow connection).
A test was done for speed vs a standard Sitecore Package. The migration and package contained 24k items:
The results were:
Content migrator: 41 seconds
Sitecore Package Install: 70 minutes
So it is a much faster option than standard Sitecore packages.
Cons: You would have to install Sidekick on both PROD and QA servers, I don't really view this as a con because its a great tool, but for some this could cause a problem.
|
What is the most efficient & fastest way to speed up the installation of packages with thousands of items?
We are soon going be pulling thousands of items from a PROD instance back into a QA Environment. These packages have thousands of items and take a VERY long time to install, sometimes even beyond 8 hours to install into Sitecore.
My question is, is there a way to speed up the installation of these packages OR is there a better way to bring these items down from our PROD instance back into our QA instance faster than a package?
Looking to see what the community thinks is the fastest & most efficient way and we will heavily explore that option.
| |
The short answer for you question is YES but for SXA 1.0.
From the screenshot, I can see that you are using 1.1.
I tried to reproduce your scenario and I was able to reproduce the same behaviour.
I tried it on 1.0 as well and it does not occur on initial release.
In my opinion, this is a regression and should be reported to Sitecore Support if you wish get some support package (if it will be possible).
@michael-west wrote that it works fine on his machine. I'm assuming that he is using 1.0, if not then it is interesting why it is working for him.
|
Can I export content images with SXA Creative Exchange?
I am playing with SXA Creative Exchange and discovered that it exports only images stored in Theme media folder. That is fine for prototyping, when page is created by designer.
In real sites, Content Authors do not want to mix design and content assets. They build pages using real content and still want to use Creative Exchange to apply styles. When such pages are exported, they do not look nice and design can be broken.
Can SXA export images referenced by components if they are stored in different folder to keep page layout?
Update: let me clarify with screenshot what is Exported what is not in my case:
I do not want keep all my Images in theme folder.
| |
In order to know which item is causing this issue, you will need to hook into the event publish:itemProcessing. I have a blog that I have written to know what items have already been published. The link is here
Below is a code snippet that allows you to know how to retrieve the item
public void OnItemProcessed(object sender, EventArgs args)
{
var itemArgs = args as ItemProcessedEventArgs;
if (itemArgs != null)
{
var publishContext = itemArgs.Context.PublishContext;
if (itemArgs.Context.PublishOptions.Mode == PublishMode.Incremental)
{
var processedItems = publishContext.ProcessedItems;
var itemsToProcess = PublishQueue.GetPublishQueue(itemArgs.Context.PublishOptions).Count();
var totalItems = Math.Pow(itemArgs.Context.PublishContext.Languages.Count(), 2) +
(itemArgs.Context.PublishContext.Languages.Count() * itemsToProcess);
foreach (var processedItem in processedItems)
{
var item = Factory.GetDatabase("master").Items.GetItem(new ID(processedItem));
if (item != null)
{
var publishedItems = new PublishedItemEntity
{
ItemId = item.ID,
ItemName = item.DisplayName,
ItemPath = item.Paths.ContentPath
};
}
}
}
}
}
Since I have updated the tool on Sitecore Marketplace which is still in review phase, please check my GitHub Repository for the code and there is a Sitecore Package of the tool.
|
Exceptions occurred while processing the subscribers to the 'item:deleted' event during Publishing..How can I know on which item it is failing?
I'm running a publish on the content tree of my sitecore instance and at some point the publish crashes.
Is there an easy way of knowing which item is causing the problem?
I don't see on the logs the item ID at any point...
here is the exception I get:
10336 17:56:05 ERROR An error during Publish Pipeline Process Queue execution.
Exception: System.AggregateException
Message: One or more exceptions occurred while processing the subscribers to the 'item:deleted' event.
Source: Sitecore.Kernel
at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters, EventResult result)
at Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Sitecore.Data.Engines.EngineCommand`2.RaiseEvent[TArgs](EventHandler`1 handlers, Func`2 argsCreator)
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.DeleteItem(Item item)
at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.DeleteItem(Item item, SecurityCheck securityCheck)
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.(Item )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.DeleteItem(Item , Boolean )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.Execute(Item , ID )
at Sitecore.Data.Engines.DataCommands.DeleteItemCommand.DoExecute()
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.DeleteItem(Item item)
at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.DeleteItem(Item item, SecurityCheck securityCheck)
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.(Item )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.DeleteItem(Item , Boolean )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.Execute(Item , ID )
at Sitecore.Data.Engines.DataCommands.DeleteItemCommand.DoExecute()
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.DeleteItem(Item item)
at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.DeleteItem(Item item, SecurityCheck securityCheck)
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.(Item )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.DeleteItem(Item , Boolean )
at Sitecore.Nexus.Data.DataCommands.DeleteItemCommand.Execute(Item , ID )
at Sitecore.Data.Engines.DataCommands.DeleteItemCommand.DoExecute()
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.DeleteItem(Item item)
at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.DeleteItem(Item item, SecurityCheck securityCheck)
at Sitecore.Publishing.PublishHelper.DeleteTargetItem(ID itemId)
at Sitecore.Publishing.Pipelines.PublishItem.PerformAction.ExecuteAction(PublishItemContext context)
at Sitecore.Publishing.Pipelines.PublishItem.PerformAction.Process(PublishItemContext context)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Publishing.Pipelines.PublishItem.PublishItemPipeline.Run(PublishItemContext context)
at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context, List`1& referrers, List`1& children)
at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessPublishingCandidate(PublishingCandidate entry, PublishContext context)
at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.ProcessEntries(IEnumerable`1 entries, PublishContext context)
at Sitecore.Publishing.Pipelines.Publish.ProcessQueue.Process(PublishContext context)
| |
The new styles need to go in either main.css or the related component css.
i dont believe the web-edit.css should be edited at all. see the tree above and the styles directory - this is where css changes need to go.
if you exported with a site theme, you should have a project directory within the media directory. if you exported with just the wireframe theme, then I am not sure best way to create a theme. I believe you are supposed to duplicate the wireframe theme, rename and customize there and that new theme will get added on import. However, I have not yet tested this - the documentation is very sparse in this regard.
Can someone please confirm whether this is correct?
|
CSS changes are not Imported into Sitecore with SXA Creative Exchange
I am building styles for my component using SXA Creative Exchange. For that steps below were executed:
Export page with component using Agency drop (preview mode, importable) mode
Add my-test-style class to promo component - <div class="component promo ... add-your-css-classes-here my-test-style">...</div>
Add that class to webedit.css .my-test-style {background: green}
Checked style in offline design. It looks good.
After that package imported back to Sitecore.
In Sitecore I see my style available for Promo component and it is selected in component properties, but my CSS changes are not imported.
Am I doing something wrong or Creative Exchange does not import CSS changes into Sitecore?
Update:
After reading the answers, I see where my mistake is coming from. Initially I assumed that CSSs in Theme folder belong to Base scheme and all modifications should go into webedit.css.
But in reality CSS files in Theme folder belong to actual theme and modifications should be made right there.
Everything works as expected after I added my styles to the bottom of -\media\Project\Sxa-Demo-Tenant\SXA-Demo-Site\SXA-Demo-Theme\styles\component-promo.css file.
.promo.my-test-style {
background: green
}
| |
The issue is the request is not being processed by Sitecore, since it is seeing .oldRegistration as file extension and it has not been configured as an allowed extension. You need to add all the extensions that you want processed, since the module works integrates in the Sitecore pipelines:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<preprocessRequest>
<processor type="Sitecore.Pipelines.PreprocessRequest.FilterUrlExtensions, Sitecore.Kernel">
<param desc="Allowed extensions (comma separated)">aspx, ashx, asmx, oldRegisteration</param>
</processor>
</preprocessRequest>
</pipelines>
</sitecore>
</configuration>
Note that the above is in the preprocessRequest so is very early in the pipeline process. Also be aware that configuring and allowing too many extensions will cause Sitecore to process them and may have a negative impact on performance. It's worth considering the use of the IIS URL Rewrite module for "static redirects", i.e. one's that do not need to be configured by users, since it works at an IIS level before any request to your application is made.
|
301RedirectModule isn't working for URL with dot file name
We are migrating the site from Java Vignette platform to sitecore. And we have redirect requirement.
Looks like most of the Java URL seems to have dot.
portal/site/template.oldRegisteration
I'm trying to use 301Redirect Module (https://github.com/thecadams/301RedirectModule). However, it isn't working (keeps getting 404 status code) for any source URL which has dot.
Has anyone faced this issue and somehow resolved?
| |
I would like to answer my own question because I found out and tested the exact answer. Of course thank you for the answers. So here is the patch configuration what I used to remove all references to the default Home item from the default Sitecore configuration.
<sitecore>
<settings>
<setting name="DefaultItem">
<patch:attribute name="value">/</patch:attribute>
</setting>
</settings>
<sites>
<site name="shell">
<patch:attribute name="startItem">/</patch:attribute>
<patch:attribute name="contentStartItem">/</patch:attribute>
</site>
<site name="modules_website">
<patch:attribute name="startItem">/</patch:attribute>
</site>
<site name="website">
<patch:attribute name="startItem">/</patch:attribute>
</site>
</sites>
</sitecore>
|
How should I remove the default Home item?
I would like to delete the Home from master database. I can delete without any problem but I saw for example references in site configurations. Is there any other places where should I remove the references?
| |
There's no formula, because the workload is as much a function of your code as it is about the number of concurrent users. If you are using caching properly an S will be sufficient for "web" but not "master". If you have a logged-in area you will load up "core" as well.
My suggestion is to start with S3 for master and web, and monitor the DTU, CPU, IO and connection telemetry during peak operation, and during publishing. There's graphs in the portal.
If you rarely hit 60-70% then turn it down to S2. There's a big drop to S1 stop don't be tempted by that. Remember you can change these scales in about an hour with virtually no disruption to traffic. Write a powershell script and run it on a timer to scale up/down at 2am or whenever your site is quiet.
EDIT: Forgot to mention that at the moment all our deployments are done with SQL Elastic Pools instead of individual databases. This has the advantage that you can 'thinly provision' resources to the environment, knowing that while individual databases require burst capacity, they don't all need it at the same time.
Our current starting setup is a Standard 100 eDTU pool for non-production (including Core/Master/Web/Analytics) and Premium 125 eDTU pool for production.
I'm still on the fence on whether a P125 is better than a S200 for 40% extra cost, but 35% less eDTU. We're still evaluating that. The main difference is that with the Standard pool each individual DB is capped to 100 eDTU, which is not the case on the Premium tier.
|
Max concurrent workers/Max concurrent sessions
We have 11 client Sites hosted on Azure PAAS setup with SQL on standard S2 tier. We also have planned to remove Inrole cache and Implement SQLSession Cache on these Production servers.
For all 11 sites , we expect 300-500 concurrent users per site. Is there any formula to calculate if the S2 tier is sufficient for this user load.
Also , is there any documentation on the Max concurrent workers/Max concurrent sessions for Sitecore 8.0, this information would help us understand if the S2 tier will be sufficient for the given user load.
Azure documentation for S2 plan
Max concurrent workers - 120
Max concurrent sessions - 1200
| |
While investigating this issue when I hit it during an upgrade, my debugging discovered that this was caused by a bug in the PortectedImageLinkRenderer class which cannot handle empty <a> tags. In my scenario, I had some HTML in the rich text field as follows:
<a>Some Text Here</a>
When the pipeline tried to process the 'HREF' tag of the anchor, it couldn't find it but the algorithm didn't safely handle this scenario, leading to the exception above.
I was able to patch in my own version of the ProtectedImageLinkRenderer which handled the empty tags and it resolved the issue. @Velict, you may wish to do the same if you need to have empty tags. Alternatively, you can add an HREF tag to your empty anchors and it will work.
I have also submitted a support ticket to Sitecore, referencing 8.2 update 2, to request an official patch. I'll update this answer if I hear back.
UPDATE: I don't have an official patch yet, but my debugging to help the support desk did uncover that this requires a very specific combination. The HTML must have an empty tag and ALSO a media link that needs to be processed. Either of them on their own is fine.
The following HTML example can reproduce the issue in a default Sitecore 8.2 u2 installation by editing the 'Text' field of the default Home node:
<p><a>Empty HREF</a></p>
<p><a href="-/media/094AED0302E7486880CB19926661FB77.ashx">Media link</a></p>
UPDATE (2017-03-01): I have received an official support patch for 8.2update 2 for this from Sitecore: https://github.com/SitecoreSupport/Sitecore.Support.149817/releases/tag/8.2.2.0
|
Length cannot be less than zero. When using sitecore link in richtext edtior
The page crashes and gives
"Length cannot be less than zero." when i insert a Sitecore link in the RTE.
It happens as soon as you visit the specefic page on the site. The error is not thrown when you are browsing the page from the Experience editor.
Has anyone experienced this kind of behaviour before?
Stack trace
[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
System.String.Substring(Int32 startIndex, Int32 length) +14415580
Sitecore.Pipelines.RenderField.ProtectedImageLinkRenderer.ReplaceReference(String tagHtml, String urlAttribute) +300
Sitecore.Pipelines.RenderField.ProtectedImageLinkRenderer.HashReferences(String renderedText, String tagName, String urlAttribute) +802
Sitecore.Pipelines.RenderField.ProtectedImageLinkRenderer.Process(RenderFieldArgs args) +121
(Object , Object[] ) +71
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
Sitecore.Web.UI.WebControls.FieldRenderer.RenderField() +942
Sitecore.Web.UI.WebControls.FieldControl.DoRender(HtmlTextWriter output) +255
Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) +345
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
Sitecore.Web.UI.WebControls.Sublayout.DoRender(HtmlTextWriter output) +49
Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) +345
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
Sitecore.Web.UI.WebControls.Placeholder.DoRender(HtmlTextWriter output) +134
Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) +345
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
Sitecore.Web.UI.WebControls.Sublayout.DoRender(HtmlTextWriter output) +49
Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) +345
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
Sitecore.Web.UI.WebControls.Placeholder.DoRender(HtmlTextWriter output) +134
Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) +345
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
Sitecore.Web.UI.WebControls.Sublayout.DoRender(HtmlTextWriter output) +49
Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) +345
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
Sitecore.Web.UI.WebControls.Placeholder.DoRender(HtmlTextWriter output) +134
Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) +345
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +11868329
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
Sitecore.Web.FormAdapter.Render(HtmlTextWriter writer) +76
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +116
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +50
ASP.layouts_linak_site_linak_html_body_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\28c1c560\ff0e1871\App_Web_iitpqjv4.0.cs:0
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +263
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
Sitecore.Web.UI.WebControls.Sublayout.DoRender(HtmlTextWriter output) +49
Sitecore.Web.UI.WebControl.Render(HtmlTextWriter output) +345
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +160
System.Web.UI.Page.Render(HtmlTextWriter writer) +39
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +80
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3499
| |
If you will open for example Sitecore.XA.Feature.PageContent.config you will see there <autoDatasourceRenderings> section.
You can use that section and put there your rendering ID - this will automatically create data source for you.
When local data source will be created, the Data Source field inside of your rendering properties should have something like this: local:/Data/Text 1. And under your page item there should be:
UPDATE: In the newer versions of SXA we started to use "Other properties" field in the Experience Accelerator section of the rendering item (it is no longer in the config files):
|
SXA and local vs reusable datasources in a custom control
In SXA we have components like the Rich Text component that have a version with a local datasource and a reusable version that gets a datasource from a global (site) folder.
This all works fine and I can see local data folders being created and text items appearing in the global site data folders under "Texts".
If I understand correctly the only real difference between the two versions of the RichText component is on creation - the local one doesn't ask anything and creates a local data item, the reusable one does ask for a datasource.
So my question is: how can I use this behavior in my custom rendering? What are the steps I need to take to have a local and reusable version of my custom control?
| |
Depending on your Sitecore version, you can have both Solr and Lucene enabled at the same time. Each index configuration will define which provider is used. I have done this in v8.0+
You will need to make sure that both the Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config and Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config files are enabled.
Then for your indexes that need to use Lucene, the config should set the type to the Lucene provider:
<index id="mediaframework_web_index"
type="Sitecore.ContentSearch.LuceneProvider.LuceneIndex, Sitecore.ContentSearch.LuceneProvider">
...
</index>
For any indexes that you want to store in Solr, set it to the Solr provider:
<index id="sitecore_core_index"
type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
...
</index>
Sitecore will create the index objects in code based on the type specified, so both will work.
Caveats:
You can't store the same index in both Solr and Lucene, the indexes must be unique
If you have Lucene indexes on the CD servers, you may run into problems with getting the indexes updated. Normally only the CM server would kick off the indexing in a SOLR environment as the indexes are shared across servers. But Lucene are local, so you would have to enable the index updating on the CD servers too, this could cause a lot of needless index updates in SOLR. - if you are only using the media framework index for CM data, then it may not be an issue.
It may be better to convert the media framework to use a SOLR index. It should be possible to do this by changing the index config.
|
How to use both Lucene & Solr with Brightcove?
In our project, we are using Brightcove videos, currently brightcove media framework supports only Lucene. But we need to use Solr for the site search, and other functionalities.
How do we enable both the searches? What are all the configurations need to be enabled on the CM & CD servers.
| |
The simplest option would be to set the 'Items per page' to a higher value (you can choose 10, 25, 50, 100 or All)
You could potentially set that as the standard by running something like Registry.SetInt("Current_User/Workbox/Page Size", 50); when someone logs in or opens the workbox, as that's the setting Sitecore checks when loading up the panel.
(PS. 999999 seems to be the value for 'All')
Edit
Keep in mind this might affect the load time for the workbox if someone has a lot of items in the workbox
|
How to avoid paging in Sitecore Workbox
If Sitecore workbox contains more than 10 items, then it start to show paging in the Draft/Awaiting Approval Section in bottom as highlighted with red rectangle in below image
Do anybody know how to avoid paging and show all items on Draft/Awaiting Approval Section in workbox?
| |
No, there's not a setting to disable lazy loading globally. However, it is possible to disable lazy loading on all of your models' properties with some custom code.
Eager-Loading Attribute Configuration Loader
This is a custom attribute configuration loader that will iterate over all the attribute configurations in your assemblies and disable lazy loading for any of your model properties that support lazy loading.
The IsLazy property is not implemented on a common AbstractPropertyConfiguration class, but rather separately on several different implementations (e.g., ChildrenConfiguration, LinkedConfiguration), so we have to resort to reflection to force IsLazy to false on the properties that support it.
public class EagerLoadingSitecoreAttributeConfigurationLoader : IConfigurationLoader
{
private const string IsLazyPropertyName = "IsLazy";
private readonly SitecoreAttributeConfigurationLoader _attributeConfigLoader;
public IEnumerable<string> AllowedNamespaces
{
get { return _attributeConfigLoader.AllowedNamespaces; }
set { _attributeConfigLoader.AllowedNamespaces = value; }
}
public EagerLoadingSitecoreAttributeConfigurationLoader(params string[] assemblies)
{
_attributeConfigLoader = new SitecoreAttributeConfigurationLoader(assemblies);
}
public IEnumerable<AbstractTypeConfiguration> Load()
{
var configurations = _attributeConfigLoader.Load().ToArray();
ForceEagerLoading(configurations);
return configurations;
}
private static void ForceEagerLoading(IEnumerable<AbstractTypeConfiguration> configurations)
{
foreach (var propertyConfig in configurations.SelectMany(c => c.Properties))
{
var isLazyProperties = propertyConfig.GetType().GetProperties().Where(IsIsLazyProperty);
foreach (var isLazyProperty in isLazyProperties)
{
isLazyProperty.SetValue(propertyConfig, false);
}
}
}
private static bool IsIsLazyProperty(PropertyInfo propertyInfo)
{
return propertyInfo.CanWrite
&& propertyInfo.PropertyType == typeof(bool)
&& string.Equals(propertyInfo.Name, IsLazyPropertyName, StringComparison.InvariantCultureIgnoreCase);
}
}
GlassMapperScCustom.cs
Update the GlassLoaders method in GlassMapperScCustom to use the new EagerLoadingSitecoreAttributeConfigurationLoader instead of SitecoreAttributeConfigurationLoader.
public static class GlassMapperScCustom
{
...
public static IConfigurationLoader[] GlassLoaders()
{
return new IConfigurationLoader[]
{
new EagerLoadingSitecoreAttributeConfigurationLoader("CompanyName.Assembly1"),
new EagerLoadingSitecoreAttributeConfigurationLoader("CompanyName.Assembly2"),
new EagerLoadingSitecoreAttributeConfigurationLoader("CompanyName.Assembly3")
};
}
...
}
Notes
This will not disable lazy loading from the SitecoreService or SitecoreContext. Anywhere that the SitecoreService or SitecoreContext are being used in your code to create or retrieve items with isLazy set to true will still use lazy loading. For that level of control you will have to update to Glass Mapper 4.2.0.184 or greater and implement your own SitecoreContext as far as I know.
Also, this code has not been tested in production so I make no claims about what it'll do to performance :). You can use this to see if it resolves your errors.
|
Can I globally disable lazy loading in Glass Mapper?
In a legacy project, there's code that retrieves items like this:
var context = SitecoreContext.GetFromHttpContext();
context.GetItem<Item>(itemId, Language.Current);
For several types of items, this results in a NullReferenceException with the following stack trace:
Glass.Mapper.AbstractService.RunConfigurationPipeline(AbstractTypeCreationContext abstractTypeCreationContext)
Glass.Mapper.AbstractService.InstantiateObject(AbstractTypeCreationContext abstractTypeCreationContext)
Glass.Mapper.Sc.SitecoreService.CreateType(Type type, Item item, Boolean isLazy, Boolean inferType, Dictionary`2 parameters, Object[] constructorParameters)
Glass.Mapper.Sc.SitecoreService.CreateType(Item item, Boolean isLazy, Boolean inferType, Object[] constructorParameters)
Glass.Mapper.Sc.SitecoreService.CreateType(Item item, Boolean isLazy, Boolean inferType)
... soluction code here ...
According to the registered Glass issues I have found, this happens when caching is enabled and referenced item collections are loaded lazily:
https://github.com/mikeedwards83/Glass.Mapper/issues/169
https://github.com/mikeedwards83/Glass.Mapper/issues/247
We use TDS code generation to create Glass models.
Caching is enabled globally in Glass.Mapper.Sc.config:
<setting name="Glass.Mapper.Sc.Caching.Enabled" value="true"/>
We cannot disable caching, as it improves performance. But I think it wouldn't affect us much if we disabled lazy loading.
It looks like lazy loading is enabled by default for all models, unless specified otherwise with Glass model attributes.
Is is possible to disable lazy loading globally? Or is there a better way to solve the errors we're getting?
Glass version is 4.0.5.54.
| |
This is because Sitecore strips it out of the URL once it identifies it as a valid language code. It happens here:
<processor type="Sitecore.Pipelines.PreprocessRequest.StripLanguage, Sitecore.Kernel" />
Which is a processor in the <preprocessRequest> pipeline, which runs before the <httpRequestBegin> pipeline that you have hooked in to.
The code in question looks like this:
Language language = StripLanguage.ExtractLanguage(args.Context.Request);
if (language == (Language) null)
return;
Context.Language = language;
Context.Data.FilePathLanguage = language;
StripLanguage.RewriteUrl(args.Context, language);
Depending on what you are trying to do; you should probably just check for the "base" url (without the language qualifier) and then in your Landing Page Resolver check the value of Context.Data.FilePathLanguage. If this returns non NULL you will know that a language code was part of the URL and has been removed by the StripLanguageProcessor.
|
HttpContext.Current.Request.Url doesn't return language code
I have a LandingPageResolver that inherits from HttpRequestProcessor. From here I am pulling the current request url from HttpContext. I'd like to get the full request url including language code. However HttpContext.Current.Request.Url doesn't return url with language code.
Ex:
Request from browser: http://domain.com/nl
HttpContext.Current.Request.Url : http://domain.com/
Thank you in advance.
| |
The issue is the created field, which was added in Sitecore 8.1.3 and the earlier version of TDS are not able to handle this field correctly.
You should upgrade to the a newer version of TDS, 5.5.0.14 or higher, and it should resolve the issue after you re-synchronise.
Fixed issue with Sitecore 8 update 3 "created" property in the .item file
You can get the latest version of TDS and see the release notes here:
http://www.teamdevelopmentforsitecore.com/Download
There is more details about this issue in this blog post:
http://www.rockpapersitecore.com/2016/08/26/tds-sync-issues-with-8-1-update-3/
|
TDS sync always shows Items are different even after updataing
I am trying to sync TDS with sitecore items but TDS sync always shows that Items are different even after updataing my sitecore items from project.
Is there a solution for same?
I am using 5.1.0.17 version of TDS
Here is the how it looks.
| |
We recently faced a similar issue, it was caused by one of our custom commands we had, which was inheriting this type 'Sitecore.Shell.Applications.WebEdit.Commands.WebEditCommand, Sitecore.Client', We got rid of it as we didnt need it and it fixed the issue, Or you can update your custom command to inherit the class from the new assembly in Sitecore.ExperienceEditor assembly (Same class name and namespace)
Note, that there is a chance that you have a custom module (marketplace module) installed which still uses the old WebEditCommand, Try disabling all modules you have and see which one is causing this.
|
Error in loading WebEditCommand after upgrade from 7.5 to 8.0
We are in process of upgrading incrementally from 7.5 to 8.1.
After upgrading from 7.5 to 8.0. When we try to access the content editor, index manager we get the below error. Please see screenshots and log files attached.
Could not load type 'Sitecore.Shell.Applications.WebEdit.Commands.WebEditCommand' from assembly 'Sitecore.Client, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null'.
| |
So after discussing with Nathanael Mann, it appears that this is indeed a defect in the Mapping code in Glass and not an issue with the implementation. I'll be adding a defect on the Github page and closing this question with this answer.
|
Glass Mapper - fluent vs attribute mapping; difference in behavior between inherited SitecoreChildren field
I have the following model
using System.Collections.Generic;
namespace Ignition.Foundation.Core.Models.BaseModels
{
public interface INeedsChildren : IModelBase
{
IEnumerable<IModelBase> BaseChildren { get; set; }
}
}
public interface IPage : IMetadata, INavigation, ITaxonomy, INeedsChildren, IModelBaseWithMetadata, INeedsParent { }
public interface IIgnitionPage : IPage { }
Using AttributeMapping, the BaseChildren had the [SitecoreChildren] attribute.
I have an IPage model that implemented INeedsChildren, and that was in turn implemented by IIgnitionPage.
When using Attribute mapping, this worked as expected, and when I got a page reference I had the children.
Using Fluent mapping, I have the following mappers:
using Glass.Mapper.Sc.Maps;
using Ignition.Foundation.Core.Contracts;
using Ignition.Foundation.Core.Models.BaseModels;
namespace Ignition.Foundation.Core.Installers.Mappers
{
public class NeedsChildrenMap : SitecoreGlassMap<INeedsChildren>, IGlassSettingsConsumer
{
public override void Configure()
{
Map(x =>
{
x.AutoMap().Cachable();
ImportMap<IModelBase>();
x.TemplateId(SettingsFactory.GetSitecoreSetting("Ignition.Map.Id.ModelBase"));
x.Children(a => a.BaseChildren).InferType();
});
}
public ISitecoreSettingsFactory SettingsFactory { get; set; }
}
}
And the IgnitionPageMapper
public class IgnitionPageMapper : SitecoreGlassMap<IIgnitionPage>, IGlassSettingsConsumer
{
public override void Configure()
{
Map(x =>
{
ImportMap<IPage>();
x.AutoMap().Cachable();
x.TemplateId(SettingsFactory.GetSitecoreSetting("Ignition.Feature.Core.Map.Id.IgnitionPage"));
});
}
public ISitecoreSettingsFactory SettingsFactory { get; set; }
}
And the Page Mapper
public class PageMapper : SitecoreGlassMap<IPage>, IGlassSettingsConsumer
{
public override void Configure()
{
Map(x =>
{
ImportMap<IMetadata>();
ImportMap<INavigation>();
ImportMap<ITaxonomy>();
ImportMap<INeedsChildren>();
ImportMap<INeedsParent>();
ImportMap<IModelBaseWithMetadata>();
x.AutoMap().Cachable();
x.TemplateId(SettingsFactory.GetSitecoreSetting("Ignition.Map.Id.Page"));
});
}
public ISitecoreSettingsFactory SettingsFactory { get; set; }
}
Once I use Fluent mapping, I no longer get BaseChildren of my items. I DO get Parent however, and it is wired up the same way. Am I missing something here, or is this a bug in Glass?
| |
You don't have to but it is easier right now as there are only Controller Renderings in SXA.
We did not create any View Renderings so it is not standardised and SXA does not provide any base classes for solutions based on View Rendering.
This is probably an area for improvement that SXA team could work on.
Of course if you manage to restore all required features on you View Rendering you can use them.
The most important part of each component is the following piece of code:
<div class="component NAME @Model.CssClasses.Aggregate()">
<div class="component-content">
</div>
</div>
Consequences of skipping that part can be found here: https://sitecore.stackexchange.com/a/2326/16
|
Custom Renderings in SXA
For custom renderings that are compatible with SXA, should we always use Controller Renderings? My understanding is that you must use a controller that inherits from SXA's StandardController or VariantsController.
| |
I will try to answer your main question and few that you asked in comments.
What is the purpose of this Page Content, and how can I use it?
Before that lets clarify what variants are
Variants:
Page Content is one of the simplest renderings in SXA (in terms of complexity).
Without variants it would be a rendering which displays a single field (same like basic rendering which displays page title).
Adding variants to a renderings change it in a way you can dynamically choose which fields should be used to display the content.
So instead of creating different components which are the same but displays different fields (content or title for example) you can have one with variants.
Yes. We could live without Title or Page Content rendering in SXA because both are working the same.
Page Content rendering
I think this is a key point here.
It displays fields which are present on your context item. Your current page is holding data for Page Content so there is no mapping needed.
Examples
Scenario 1: single field
I don't have any page designs. I want to put renderings directly on a page.
My page template has following specification: contains single field Content.
I create a new item under home using my Page Template.
Fill field Title with some text
Open newly created Page and drop Page Content rendering
Select default variant Content
Now you will see that the rendering will display single field from your page named Content
Scenario 2: multiple fields
I don't have any page designs. I want to put renderings directly on a page.
My page template has following specification: contains fields Title, Content, Image.
I create a new item under home using my Page Template.
Fill field Title with some text
Fill field Content with some text
Fill field Image with some image
Open newly created Page and drop Page Content rendering
Create new Rendering Variant, configure it to display Title, Content, Image fields and assign this to your Page Content (see screenshot below)
Now you will see that the rendering will display multiple fields from your page in a way you defined it in your Variant Definition. You can change the order of fields, change tags, add prefix, suffix, nest fields in some divs and so on.
Scenario 3: using page content on partial design
Like you already noticed when you use Page Content on partial design the only thing you see is Content field (see example for multiple fields).
It is totally normal. We call it mock values for partial designs. You already know where the Page Content gets the fields from (from the context item).
When you are editing partial design you are currently on an item which does not contain any of your fields, so there is nothing to display.
If you use this partial design with page content on it on any page where fields are present you will see them rendered.
Different types of content in my "main" section.
Let's say you have footer, header partial designs.
You want to use footer and header on every page but have different center section (different main) for different page types.
You have to define different partial designs and create different page designs then for different page templates.
Example:
News Page Design, which consists
header partial design
main with news fields partial design
footer partial design
Blog Post Design, which consists
header partial design
main with blog post fields partial design
footer partial design
Then you will have to map different designs to different page types:
From now each of your page will share the same parts like: footer, header but will have different main depending on template.
Hope it helps
|
How can I use the Page Content type in SXA?
I have a page that I've used partial designs to create a consistent header and footer for all pages across my site. Now I'm trying to figure out how to have different types of content in my "main" section. I see the Page Content type in the list of components, but I can't figure out how to use it. Every time I try to use it, all I get for a rendering is the word Content Field.
What is the purpose of this Page Content, and how can I use it?
| |
SXA tokens
There are other tokens as well:
$compatibleThemes - path to all themese
$theme - currently used theme
$pageDesigns - root of page designs
$partialDesigns - root of partial designs
$currenttemplate - name of the current template
$tenant - path to the current tenant
$site - path to the current site
$home - path to the current site start item (Home)
$linkableHomes - paths home items from linkable sites (see cross-site linking)
$templates - path to the current sitetemplates
$siteMedia - path to Virtual Media folder located under site
$sharedSites - for multiroot fields, resovles shared site for current tenant.
$rvSystemTemplates - returns list of templates defined in a configuration. Those template are used to feed AllowedInTemplates field for rendering variants.
$xaRichTextProfile - returns XA.Foundation.Editing.DefaultRichTextProfile setting value.
Introduced with 10.2
$sitelang - the context site language.
$lang - the context language.
$vf - the virtual folder for the context site.
How to define custom tokens
You can define your own tokens by adding an additional processor to resolveTokens pipeline
|
Query Tokens in SXA
In SXA's out of the box renderings, I see datasource locations that look like this:
query:$site/*[@@name='Data']/*[@@templatename='Custom Folder']
Is $site the only token supported here? Can I inject my own tokens?
| |
This component uses external source. The problem here is that raw value from the source is displayed instead of HTML.
To change the way external content is displayed follow these steps:
Find following view file Website\Views\Feed\Feed.cshtml
Open file with your favourite text editor
Find following line
<p class="feed-description">
@item.Description
</p>
Change it to:
<p class="feed-description">
@{
var description = new HtmlString(item.Description);
}
@description
</p>
|
How do I get rich text to show up correctly in RSS Feed item in SXA?
I've got an RSS feed that has rich text in it's feed (i.e. paragraph markup, links, etc.) and when the feed is displayed on my website, the markup is not being rendered.
I am using the Basic theme in SXA.
How do I fix this?
| |
It appears your Meta Viewport may not be configured correctly, if you are seeing responsive behavior in the browser but not on a mobile device.
Try setting the Viewport field on /sitecore/content/[Tenant]/[Market]/Presentation/Designs to:
width=device-width, initial-scale=1.0, user-scalable=no
... and don't forget to publish it.
Edit:
The path above is actually based on Zen Garden. It's changed to the Theme in SXA as pointed out by Alan. The theme is either /sitecore/media library/Themes/Theme for default themes, or /sitecore/media library/Project/Tenant/site/Theme for client themes.
|
Responsive Design in SXA
I've been designing my new SXA site on my desktop computer. On a whim I decided to see what my new site design would look like on a mobile device, and I was very disappointed. The site simply shrunk down instead of rearranging itself as I had expected. Here's what my site looks like on the desktop:
Here's what the site looks like on an iPhone 5:
I was expecting the site to break at certain points and rearrange automatically in the same way that Bootstrap does. I am using the basic theme. I thought that SXA automatically made my site responsive.
What am I missing to make my site mobile responsive?
Edit
Here's the wireframe of the same page:
Here's what the mobile wireframes look like. I put some big arrows showing where I expected the columns to wrap, but they didn't.
Here's what it looks like on an actual mobile device:
| |
No, all you need to do is to create SiteSetupRoot/TenantSetupRoot somewhere under:
/sitecore/system/Settings/Feature
/sitecore/system/Settings/Foundation
Script is smart enough to find everything located there and your feature will be then displayed in a dialog:
Feature Definition
New Site - features list
|
Adding a custom feature to SXA scaffolding
If I want my custom feature to be install-able whenever a new tenant or site is created, what are the steps?
Is creating an item of type /sitecore/templates/Foundation/Experience Accelerator/Scaffolding/Roots/SiteSetupRoot or /sitecore/templates/Foundation/Experience Accelerator/Scaffolding/Roots/TenantSetupRoot under /sitecore/system/Settings/Feature/Experience Accelerator enough? Do these custom SetupRoot's need to be registered anywhere?
| |
By default, a date or numeric field is always sortable and facet in a Coveo index. You shouldn't have to specify the field in the field map to be able to use it to sort.
The first thing to check to troubleshoot is the type of the field in your Coveo index to ensure it is really indexed as a Datetime field.
Then, if you intend this sort to be the default for that specific result list, you should set the default sort field directly on your "Coveo Search" component (see Default Sort Options in https://developers.coveo.com/display/SitecoreV4/Search+Component+Properties).
In this configuration, the "Date" sort type always use the modified date of the Coveo indexed documents. If you want to sort by another date, you need to choose "Field" in the sort type dropdown and then select the custom date field you want to sort with.
|
Custom field date sort in Coveo
I've been looking over several sites and guides on Coveo's site, but I'm trying to get together a "definitive" answer that has everything needed. I'm trying to designate one of my custom fields as a sortable field, then change the sort order of my search results to use this field. This is using Coveo for Sitecore 4.0 (CES 7 on-prem).
In the Coveo.SearchProvider.Custom.config file, I added this line to designate my field as sortable: <fieldType settingType="Coveo.Framework.Configuration.FieldConfiguration, Coveo.Framework" fieldName="DC Date" isSortable="true" sitecoreFormat="yyyyMMddTHHmmZ"/> - this was from https://developers.coveo.com/display/SitecoreV4/Making+a+Sitecore+Field+Sortable. I then rebuilt my indexes.
In my CSHTML file, in the Coveo.QueryEvents.buildingQuery call where I build my query, I added this line: args.queryBuilder.sortCriteria = "@Model.ToCoveoFieldName("DC Date") descending"; - this was from https://answers.coveo.com/questions/5745/how-to-sort-by-publishing-date, but the person setting it up is using a built-in Sitecore field it seems, and there didn't seem to be a final resolution to "did that work."
I've checked the Coveo sources for an answer but I'm not finding anything concrete, especially on the sortCriteria syntax or if it should be used in buildingQuery or in another method. I don't want it to be a default sort overall in Coveo, and I don't intend it to be part of a sorting component...this is for a specific implementation of the search view.
Thanks for any help.
EDIT: Here's my rendering parameter setup (see comments):
| |
I believe the issue is that the indexing runs without a HttpContext and not in the correct site context either.
The missing site context is why you have to use SiteResolving = true as otherwhise it doesn't know the site and have to use the full path (i.e. /en/site1/Home/...).
The missing HttpContext means it cannot determine the protocol/scheme (as there is no request). If you set that on your site definitions (as mentioned by josedbaez) it should show up when using SiteResolving = true.
<site name="site1" scheme="http" ... />
An alternative is to just get the actual item from the database via the SearchResultItem and get the link from that where you need it.
var item = searchResultItem.GetItem();
var url = LinkManager.GetItemUrl(item);
Of course this might not be the best solution if you need to filter on this or are showing a lot of items.
|
Lucene indexing item url
I'm struggling to get the Sitecore item url from indexing, the SearchResultItem.url is always null.
I tried creating a ComputedField but I'm not getting the correct url.
With
Sitecore.Links.UrlOptions urlOptions = new Sitecore.Links.UrlOptions();
urlOptions.SiteResolving = false;
I get /en/site1/Home/section/subsection/article-name
With urlOptions.SiteResolving = true;
I get ://test.local/en/section/subsection/article-name
How can I just get /en/section/subsection/article-name or how can I use ://test.local/en/section/subsection/article-name in razor view?
I have a multi-site configuration.
| |
Well the first thought that comes to mind is the deletion of the E-mail Action Item, found in the System/Workflows area of the content tree. It would appear under the workflow that you currently have running and under specific workflow states.
You could also optionally just remove the To field, so it wouldn't send it anywhere, but that might be what you were referring to above as an SMTP setting.
Another thought, some people extend the Email Action with custom logic. If you have done this, you could also create a setting that wraps the logic, that if the setting is set to false (not to send), it would not send these e-mails. That may be the best option especially if you want to disable e-mails only for specific environments.
|
How can I disable Workflow email notifications completely on the CMS?
Is there any way I can disable Workflow email notifications completely, from within the CMS itself?
As in; without say disabling SMTP settings.
| |
The place you are looking for is in the Sitecore.Client.dll as pointed out by Koen Heye.
The class Sitecore.Shell.Applications.Workbox.WorkboxForm contains a method called DisplayStates which formats the state DisplayName and count of items in the workflow with that state.
|
How to change total items number in Draft and Awaiting Approval header in workbox
I have customized my workbox, showing filtered items and its works perfectly. However I am unable to change number of items showing in Draft and Awaiting Aproval header as highlighted with red box in below image
Do anybody know how to change this total items number in Draft and Awaiting Approval header in workbox?
| |
Option 1
SIM uses a zip archive of the Sitecore root folder, so a simple way to do this would be to take the version of Sitecore you want to setup, install that with the basic options.
Next open up Sitecore and delete all the sample content you do not want. Open SQL Server Management Studio and detach the Core & Master databases.
Finally, locate the original zip file containing the Sitecore root folder for your version and unzip it. It will contain 3 folders:
\Data
\Databases
\Website
The Databases folder contains the detached MDF and LDF files, so add your updated database files and then re-zip the archive with the same name.
Now when you install that version, it will be using the updated databases with the sample data removed.
Option 2
Make Sitecore PowerShell Extensions part of the default options for installing and write a script that will remove all the sample data.
To remove an item you can get it by ID and call the Remove-Item cmdlet:
Get-Item master: -ID "{your-guid-here}" | Remove-Item
So get all the paths or ID's of the sample items and create a script to remove them all, run that script once the install is complete.
|
How to Start from a Blank Slate with SIM
So whenever I start a new project using the SIM or even a manual installation, I find myself having to remove a bunch of Sitecore Sample data from the Sitecore Master database. Is there a way to automatically remove this data? So that you can start from a blank install each time.
| |
I think you need to put your base abstract search class to foundation project. then add implementation of this abstract class to feature project and override methods which you need. in your case just add some method which will complete ordering.
if you use base habitat (helix implementation example) search service you can see example of filtering in NewsRespository.
Search Service return ISearchResults which contain collection of ISearchResult. So I can not see any generic methods in this process.
You can not set up flexible ordering (x => x.Date or x => x.Title) without using directly types.
My suggestion updates existing search service to using generic or cast search service results to necessary types in repository layer then ordering by field.
do not forget that habitat just an example using Helix principles.
|
Flexible way of sorting search results in a Habitat solution
I am looking for a flexible way of sorting the results from a search in a Habitat structured solution. I tried different approaches but couldn't find one that doesn't need a hardcoding way of doing things.
Let's say I have to sort by some types like 'Date' and 'Title', both can be ascendant and descendant. Since a solution contains multiple page types, like News, Events, Articles, Publications, each of this could have its own project in solution and has its own fields in Sitecore to sort on, example on News you would have 'Date', on Events would be 'Start Date', on Articles could be 'Updated Date' on Publications could be 'Release Date' and so on.
I am looking for a way I could define these in that specific project, and then by using the Foundation.Indexing project to dynamically sort each depending on type and on sort params I send.
I am doing this on a Sitecore Habitat structure and trying to make it flexible enough so if I add later new projects I don't need to modify the actual search but extend it in the added project. I have tried different ways of doing it but haven't managed so far without having to hardcode some field names or instances that would make me do changes each time I add new projects to the solution.
If anyone has any idea how could this be done in a nice and flexible way let me know. I am eager to find out if anyone ever tried something like this on Habitat and managed to have it done in a good pro way.
| |
The problem here is that a controller rendering in the Sitecore world is not the same as a Controller action result in standard MVC.
So you can't pass data through in the same way without custom code.
From your example, it looks like all you really need to do is use an @Html.Partial to render your other razor view and pass the data through like that. Your controller action is not doing anything with the data.
You're razor would become:
@model SBJSitecore82.Areas.Editorial.Models.ViewModels.IssueSectionViewModel[]
@foreach (var issueSection in Model)
{
@Html.Partial("~/viewpath/IssueSection", issueSection)
}
I do this a lot for renderings where I have a section that is either in a loop or a small view that can be used in multiple other views.
|
Pass objects into ControllerRendering
I'm trying to pass some data into a ControllerRendering from a Razor view. I tried to pass it along as an object:
@model SBJSitecore82.Areas.Editorial.Models.ViewModels.IssueSectionViewModel[]
@foreach (var issueSection in Model)
{
@Html.Sitecore().ControllerRendering("Module", "IssueSection", new { area = "Editorial", issueSectionViewModel = issueSection })
}
By in my controller, the object properties are always null, even though they are not null in the Razor view where it called the ControllerRendering.
public ActionResult IssueSection(IssueSectionViewModel issueSectionViewModel)
{
return View(issueSectionViewModel);
}
So I decided to try to pass the object using the Datasource attribute in the Razor view:
@model SBJSitecore82.Areas.Editorial.Models.ViewModels.IssueSectionViewModel[]
@foreach (var issueSection in Model)
{
@Html.Sitecore().ControllerRendering("Module", "IssueSection", new { area = "Editorial", Datasource = issueSection })
}
But that just passes a string into the RenderingContext.Current.Rendering.Datasource property. I saw an example where someone passed an ID into the Datasource and I presume they just did a GetItem with that ID. I could do the same, but that seems inefficient when I have a dozen of these items to process.
So the question is, how can I pass these objects over, or can I? Or should I just pass the ID over and retrieve the items?
| |
Hum, I believe there might be an error in the documentation.
This line:
<a href="{{-ClickUri}}" class="title open-link">{{-Title}}</a>
Should be this line:
<a href="{{-clickUri}}" class="title open-link">{{-Title}}</a>
The slight difference is the "c" of click uri. The ClickUri is what is in the index. When a result is returned, Coveo for Sitecore uses the REST Endpoint Pipeline to add a new clickUri attribute which is the original ClickUri adjusted to the context of the site. For more information on the clickUri vs ClickUri, please read:
https://developers.coveo.com/display/SitecoreV4/Understanding+How+The+ClickableUri+Value+Is+Computed
TLDR: Change the ClickUri to clickUri in the result template of the Coveo Result list.
|
Coveo Suggested Results Returning the Wrong URL on Search View
We are using this to provide suggested results on our search view page.
https://developers.coveo.com/display/SitecoreV4/Provide+Result+Suggestions
However the results provided are returning a URL that has an extra value in it that is not the correct path to the item returned. We are also using the suggested results tied to Search Box View and there the URL is correct. Anyone have any suggestions?
Correct URL from the Search Box View Suggest results
https://server/en/locations/item
Incorrect URL from the Search View page. Note it is adding our "home" node in to the url.
https://server/en/home/locations/item
| |
In log4net you can use a filter on the level in your appender like this:
<threshold value="DEBUG"/>
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="DEBUG" />
<levelMax value="INFO" />
</filter>
Not sure whether the syntax in Sitecore will be the same as I didn't test it. The threshold value specifies that all messages below the indicated level are ignored by this fileAppender - not sure that you need this on top of the filter but that is how I read it should be done.
Using this, you could create all the appenders you need based on the levels you want, and add multiple appenders to the loggers you want to split and have splitted log files.
|
How can I split logs by log level/priority
I know that logs have the following levels from lowest to highest:
DEBUG
INFO
WARN
ERROR
FATAL
And that the <priority> of each log sets the minimum log level for messages that will be written to the log, i.e. only messages at that level or higher will be written to the log.
A while back, I worked on a project for a client in which the previous agency split each of the CM logs into three:
Detail.{logName}.txt (DEBUG, INFO)
Warn.{logName}.txt (WARN)
Error.{logName}.txt (ERROR, FATAL)
I can't seem to find the project in my archives, and as far as I can tell, there doesn't appear to be a way to set both a "maximum priority" for logs, natively, though this would be great for debugging.
I don't want to reinvent the wheel, so does any one know if I'm missing something simple? Thanks!
| |
You will find the code rendering those <script> tags in \Views\Form\index.cshtml:
@Html.RenderScripts(requirejs)
@Html.RenderScripts(main)
Removing these might break wffm ;)
|
Scripts getting added to my form with WFFM causing it to break
We got a build that has WFFM implementation and in a few forms we have been seeing some scripts being added to the end of the form. On all forms we see that the form doesn't load properly:
I have been looking to see if I can find where it's been defined. Anyone know where I should be looking for?
| |
In the system/Modules/Web Forms for Marketers/Settings/Actions/Save Actions/Create User item, there's a parameter for DefaultProfileItemId. This is set to the profile ID to use. To connect to your own, either change this value, or duplicate the action so the default "Create User" action isn't changed.
There does appear to be an issue though, as I did this but it didn't switch in the form designer to use my user profile, even though I changed the parameter. I've got a query into Sitecore support about it.
UPDATE: Sitecore support said "Please try setting your custom user profile in the User Profile field of your form item. I tried this locally and the custom profile fields appeared in the Create User action editor." - this worked.
|
Using WFFM to create a user to a custom user profile
I'm trying to use WFFM to create a user registration form for my site. I've created a custom domain to put the users in, and added a few fields to a custom user profile. Then I created my form and hooked up the "create new user" save action. In the "additional user properties" section, I see the User Profile section, but the dropdown for User Profile fields aren't my fields.
Is there any way to do the mapping I want to do? I know through the API and a custom form I can do it easily, but we'll be doing internationalization with this site, and we're already using WFFM, so I thought I'd take advantage of built-in capabilities where possible.
| |
Tracking Live
The tracking.live database is used by two entities:
Task Storage (defined in Sitecore.Analytics.Processing.config file)
Live Processing Pool (defined in Sitecore.Analytics.Processing.Aggregation.ProcessingPools.config file)
Task Storage
Works with the TaskQueue collection that is defined in the tracking.live database. Deferent Sitecore roles can add new tasks to collection and get tasks from collection. Task storage is used by the Task Queue. The queue is used by the Task Manager. The Processing / Aggregation role runs the Task Agent (defined in Sitecore.Analytics.Processing.config file). The agent gets tasks from the Task Manager and executes them.
Tasks are added to queue by various parts of the system when processing of large amounts of data is necessary (removing contacts from automation states, setting timeout date of automation state, updating classification of location, etc). Custom code can also schedule tasks to be processed by the Processing / Aggregation role, which typically sits on a dedicated server.
Live Processing Pool
Works with the ProcessingPool collection that is defined in the tracking.live database too. Whenever a new session is flushed (on the Session_End event) to the analytics database, the Sitecore.Analytics.Aggregation.CommitSession.ProcessingPoolAdd processor (defined in the submitSessionContext pipeline) adds a new work item with an interaction ID to the live processing pool for the future processing.
The live processing pool is referenced by the Live Interaction Aggregation Context (defined in the Sitecore.Analytics.Processing.Aggregation.config file), where the context is used by the Interaction Aggregator (defined in the Sitecore.Analytics.Processing.Aggregation.Services.config file).
The Processing / Aggregation role runs the aggregator. It gets work items from the live processing pool through Aggregation Context. Each work item is processed by calling the analytics.aggregation/interactions pipeline.
The Live Interaction Aggregation Context is also referenced by the Interaction Work Dispatcher (defined in the Sitecore.Analytics.Processing.Aggregation.Services.config file). The dispatcher is used by the Aggregation Cleanup and Aggregation Recovery agents (both defined in the Sitecore.Analytics.Processing.Aggregation.Services.config file).
|
What is the purpose of the 'tracking.live' MongoDB database?
Sitecore XP version 8.0, 8.1 and 8.2 comes with following MongoDB databases:
analytics
tracking.live
tracking.history
tracking.contact
What is the purpose of the tracking.live database in MongoDB?
| |
At the moment Creative Exchange is only working with CSS files. You can create separate folder inside of your theme (on the same level as Scripts and Styles folders) called for example Sass.
Then content of that folder should be exported too by Creative Exchange.
But - SASS/LESS files won't be processed.
Regarding Michael West question: It will be possible in next version of Creative Exchange which is coming soon. Next version will bring lot of new pipelines in different parts of export and import process. Full control and lot of customization possibilities! So it will be easy to implement that.
|
SXA with Preprocessors?
For creative exchange exports and imports, is it possible to use a pre-processor such as sass or less? Is exporting and importing css files the only option?
| |
Tracking History
The tracking.history database is used by one entity only:
History Processing Pool (defined in the Sitecore.Analytics.Processing.Aggregation.ProcessingPools.config file).
History Processing Pool
It works with the ProcessingPool collection that is defined in the tracking.history database. During aggregation of a history data (rebuild of the reporting SQL database aka RDB) this pool is populated with the work items.
The History Processing Pool is referenced by two entities:
History Task Manager (defined in the Sitecore.Analytics.Processing.Aggregation.ProcessingPools.config file)
History Interaction Aggregation Context (defined in the Sitecore.Analytics.Processing.Aggregation.config file)
History Task Manager
It manages all tasks related to aggregation of history data, and is used by various agents that are responsible for history data aggregation (rebuild of the reporting database).
History Interaction Aggregation context
It is referenced by the Interaction Work Dispatcher (defined in the Sitecore.Analytics.Processing.Aggregation.Services.config file), where the dispatcher is used by the Aggregation Cleanup and Aggregation Recovery agents (both defined in the Sitecore.Analytics.Processing.Aggregation.Services.config file).
Additionally, both the History Interaction Aggregation Context and History Task Manager are used by the History Worker (defined in the Sitecore.Analytics.Processing.Aggregation.Services.config file). The worker runs by the Processing / Aggregation role. It gets work items from the history processing pool using the History Task Manager. Each work item is processed by calling the analytics.aggregation/interactions pipeline.
|
What is the purpose of the 'tracking.history' MongoDB database?
Sitecore XP version 8.0, 8.1 and 8.2 comes with following MongoDB databases:
analytics
tracking.live
tracking.history
tracking.contact
What is the purpose of the tracking.history database in MongoDB?
| |
You can download and install SOLR like a service using NSSM ( Non Sucking Service Manager) This example is using SOLR 5 but it wasn't a problem to install SOLR 4.10 like a service.
First, extract Solr 5 and NSSM to the following path on your file system.
1 C:\Program Files\solr-5.0.0
2. C:\Program Files\nssm
SETTING UP SOLR AS A SERVICE
On the command line, type the following:
"c:\Program Files\nssm\win64\nssm" install solr5
Fill out the path to the solr.cmd script, and the startup directory should be filled in automatically. Don’t forget to input the -f (foreground) parameter so that NSSM can kill it when it needs to be stopped or restarted.
The following step is optional, but I prefer having a clean and descriptive name in my Windows Service Manager. Under the details tab, fill out the Display name and Description.
Details tab for NSSM service installer for setting up Solr 5 as a service on Microsoft Windows
Click on Install service.
Check that the service is running.
Microsoft Windows Component Services Running Solr 5
Go to your favorite web browser and make sure Solr 5 is up and running.
Solr 5 running as a service on Microsoft Windows
Source: https://www.norconex.com/how-to-run-solr5-as-a-service-on-windows/
|
Can't seem to get Tomcat 8 / Solr 4.10 running as a service
I am trying to get Tomcat 8 / Solr 4.10 running as a Windows service for my Sitecore installation. I am following the steps outlined here: http://www.ansoncheunghk.info/article/5-steps-install-multiple-apache-tomcat-instance-windows. I have the service installed and running fine. I changed some of the port values because this is actually a second instance of Tomcat on the box. When I try to open up the Solr UI at http://localhost:8984/solr I get the following error message:
HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to
init failure: Could not load config file
S:\solr410\solr410\example\solr\collection1\solrconfig.xml
When I set up the service these are the Java options I used:
-Dcatalina.home=S:\Tomcat
-Dcatalina.base=S:\Tomcat
-Djava.endorsed.dirs=S:\Tomcat\endorsed
-Djava.io.tmpdir=S:\Tomcat\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=S:\Tomcat\conf\logging.properties
-Dsolr.solr.home=S:\solr410\solr410\example\solr
-Djava.net.preferIPv4Stack=true
-Djava.net.preferIPv4Addresses=true
Also, I followed the instructions found here for setting up my Solr cores: https://sitecore-community.github.io/docs/search/solr/fast-track-solr-for-lazy-developers/
All of my cores are located at
S:\solr410\solr410\example\solr
. But for some reason it is complaining that it can't find the solrconfig.xml for the first core. I get the feeling that somehow I need to edit a config file or something so that it knows where to find the cores or the config files. I'm not completely sure.
| |
Did you try refreshing your reporting database? https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/server_considerations/walkthrough_rebuilding_the_reporting_database
sometime you see contacts in XDB but its not present in your SQL analytics database and thats when you may need to refresh the reporting DB so that all entries are updated in the reporting DB
|
Experience Profile not showing all Contacts
I am running a JMeter test to create 10 different contacts in xDB. I can see them in xDB but when I come to Experience Profile dashboard I can see only 3 known records from JMeter and rest are all 'anonymous' (old records).
Question:
Any idea why would it show only 3 known records and not the other 7?
Is there a way I can change the the xProfile dashboard to see more records? I think the default value is 20.
Appreciate any help/pointers.
| |
It lasts 24 hours, no charge and the only side effect is that a salesman will be calling to sell you more licenses. I have never tried to use it too many times, so I am not sure how many times you can use it before you get denied. I have never been denied using it.
|
What are the limits and effects of Boosting Sitecore Users
When using the client's Sitecore license, if the client reaches the maximum number of Concurrent Users they are directed to a page where they can either exit, add users or kick off a user:
The "Add users" option (formerly "Boost users"), grants the ability to temporarily add more concurrent users. When a user selects this option, the user is redirected to the following page where they can enter the number of concurrent users to temporarily add to the license:
Questions
Looking at Sitecore's documentation, I don't see anything that explains what the actual effects of "boosting" concurrent users are. Specifically, I am looking for the following:
What is the maximum number of users that you can boost the site by?
How long does the boost remain in effect, i.e. what is the duration of time that "temporarily" describes?
How often can this feature be used?
Is there any additional charge to the client for using this feature?
Are their any negative side-effects to be aware of when using this feature?
Side-note: I apologize for not simply testing this feature myself, but I am hesitent to play around with a client's Sitecore license. Rather than ask support, I thought this would be good information to make available to the community. Cheers :)
| |
Tracking Contact
The tracking.contactdatabase is used by one entity only:
Contact Processing Pool (defined in the Sitecore.Analytics.Processing.Aggregation.ProcessingPools.config file).
Contact Processing Pool
It works with the ProcessingPool collection that is defined in the tracking.contact database. Whenever a contact is changed (created, updated or became obsolete), a new work item with a Contact ID is added to the contact processing pool for future processing.
The Processing / Aggregation role runs the Contact Processing agent (defined in the Sitecore.Analytics.Processing.Aggregation.Services.config file). The agent uses the Contact Work Dispatcher (defined in the Sitecore.Analytics.Processing.Aggregation.Services.config file) to get work items from the contact processing pool. Each work item is processed by calling the analytics.aggregation/contacts pipeline.
|
What is the purpose of the 'tracking.contact' MongoDB database?
Sitecore XP version 8.0, 8.1 and 8.2 comes with following MongoDB databases:
analytics
tracking.live
tracking.history
tracking.contact
What is the purpose of the `tracking.contact' database in MongoDB?
| |
The languages are specified in the schema.xml file. Please look in yours and make sure you see this section.
<dynamicField name="*_t" type="text_general" indexed="true" stored="true" />
<dynamicField name="*_t_en" type="text_general" indexed="true" stored="true" />
<dynamicField name="*_t_ar" type="text_ar" indexed="true" stored="true" />
<dynamicField name="*_t_bg" type="text_bg" indexed="true" stored="true" />
<dynamicField name="*_t_ca" type="text_ca" indexed="true" stored="true" />
<dynamicField name="*_t_cz" type="text_cz" indexed="true" stored="true" />
<dynamicField name="*_t_da" type="text_da" indexed="true" stored="true" />
<dynamicField name="*_t_de" type="text_de" indexed="true" stored="true" />
<dynamicField name="*_t_el" type="text_el" indexed="true" stored="true" />
<dynamicField name="*_t_es" type="text_es" indexed="true" stored="true" />
<dynamicField name="*_t_eu" type="text_eu" indexed="true" stored="true" />
<dynamicField name="*_t_fa" type="text_fa" indexed="true" stored="true" />
<dynamicField name="*_t_fi" type="text_fi" indexed="true" stored="true" />
<dynamicField name="*_t_fr" type="text_fr" indexed="true" stored="true" />
<dynamicField name="*_t_ga" type="text_ga" indexed="true" stored="true" />
<dynamicField name="*_t_gl" type="text_gl" indexed="true" stored="true" />
<dynamicField name="*_t_hi" type="text_hi" indexed="true" stored="true" />
<dynamicField name="*_t_hu" type="text_hu" indexed="true" stored="true" />
<dynamicField name="*_t_hy" type="text_hy" indexed="true" stored="true" />
<dynamicField name="*_t_id" type="text_id" indexed="true" stored="true" />
<dynamicField name="*_t_it" type="text_it" indexed="true" stored="true" />
<dynamicField name="*_t_ja" type="text_ja" indexed="true" stored="true" />
<dynamicField name="*_t_lv" type="text_lv" indexed="true" stored="true" />
<dynamicField name="*_t_nl" type="text_nl" indexed="true" stored="true" />
<dynamicField name="*_t_no" type="text_no" indexed="true" stored="true" />
<dynamicField name="*_t_pt" type="text_pt" indexed="true" stored="true" />
<dynamicField name="*_t_ro" type="text_ro" indexed="true" stored="true" />
<dynamicField name="*_t_ru" type="text_ru" indexed="true" stored="true" />
<dynamicField name="*_t_sv" type="text_sv" indexed="true" stored="true" />
<dynamicField name="*_t_th" type="text_th" indexed="true" stored="true" />
<dynamicField name="*_t_tr" type="text_tr" indexed="true" stored="true" />
<dynamicField name="*_t_zh" type="text_zh" indexed="true" stored="true" />
Then to filter on the language inherit a new ResultItem from the class SearchResultItem, adding this code.
[IndexField("_language")]
public string Language { get; set; }
In your search query you can then filter on the language.
var index = ContentSearchManager.GetIndex("sitecore_master_index");
using (var context = index.CreateSearchContext())
{
var query = context.GetQueryable<SearchResultItem>().Where(i => i.Name.Contains("search")).Filter(i => i.Language == "en");
query = query.Page(1, 20);
var results = query.GetResults();
}
|
Why does my Solr index only contain English language versions? Sitecore 8u4
Any idea why my master and web index only have the "en" language versions of items in my 4 language site?
Where are languages for the crawler configured?
| |
The Experience Editor starts on the home page of your current site. Based on the startItem from the node for the current site.
rootPath="/sitecore/content/sites/company" startItem="/Home"
If you go into Desktop > Content Editor > click on your new home node. Then Publish tab > Experience Editor. Does the editor work? Your item just isn't editable because it doesn't have a layout on it. If you fix that, it will work as expected.
|
Experience Editor stopped working after removing default Home node
I had removed the default home node, and created new home item. After this change, Experience Editor navigation stopped working(it is throwing "The layout for the requested document was not found" exception). How to point the experience button to new home node?
| |
I figured out the problem. Turns out I had Sitecore.Analytics.Processing.Aggregation.Services.config and Sitecore.Analytics.Processing.Services.config files disabled. I had disabled them during the install of another module and never re-enabled them. Once I re-enabled them then the reporting database rebuild worked fine.
|
When rebuilding the reporting database stuck on StoppingDataRecording
I am doing an upgrade from 7.5 to 8.1-Update 3. I have gotten to the end and just finished the final upgrade to get to 8.1-Update 3. Now I am trying to rebuild the reporting database.
I open the /sitecore/admin/RebuildReportingDB.aspx page and I click the Start button. The Process State changes to "StoppingDataRecording" and then just sits there. It has been running for like 15 minutes and hasn't changed.
In my local testing environment when I ran this, it changed very quickly to the desired "WaitingToReceiveData" state. I am not sure why it is taking so long.
I have looked in my browser console on the Network tab and I so see that the browser is issuing calls to ScriptResource.axd every few seconds and getting responses back with a 200 status. So that seems OK. I don't see any errors anywhere in my logs. For this server we are using a hosted version of MongoDB instead of a local version and this is our production database which has a LOT of data. Would that make this process take a real long time? Basically I am just sitting here watching the screen waiting for it to change and I have no idea if it ever will. Has anyone else ever had this issue where the Rebuild Reporting Database screen seems to be stuck?
| |
There is a quite elegant solution proposed in the sitecore community.
Basically, what you have to do is that you need to attach your "old" master database to the "new" sitecore instance as another db, e.g. "master2" and then write a simple code to create items/copy the blobs over to the "new" sitecore master database.
There is a good POC/instruction article about it:
https://pageditor.wordpress.com/2015/10/28/automated-migration-of-content-items-from-sitecore-6-5-to-sitecore-8-1/
Please take the following into consideration:
Disable indexing, otherwise it will take ages to migrate all the stuff. Dont forget to re-enable and rebuild indexes after import is over.
Disable events while importing and do a republish after it is finished.
|
Migrating a large media library
The customer has an existing Sitecore media library of roughly 18GB and wants to migrate this toa new sitecore site. However, because of the size, creating export packages or serializing items, creates problems.
Do you know of any other practical way, than just creating multible smaller export packages, to migrate such a large media library?
(Yes, DAM for Sitecore will be installed later on, but for now we need to migrate the data)
| |
Yes, you should inherit from VariantsController. It's very small and all what it's doing is providing VariantsRepository (in SXA almost all of logic is placed inside of repositories). It got all what you need to enable your rendering using Rendering Variants.
So the steps you be as follow:
Your rendering parameters template should inherit from IComponentVariant
Your repository should inherit from VariantsRepository
Your model which you push to your view should inherit from VariantsRenderingModel
Render content using SXA helpers @Html.RenderingVariants().RenderVariant(). You can take a look at views of Page Content or Title renderings which are quite simple.
|
Create a custom SXA rendering with variants
I managed to create a custom rendering in SXA by inheriting my controller from the StandardController (and some other things). But now I would like to create a component that has the ability to work with variants. I saw that there is a VariantsController, so I assume that my first step is to use that as base for my custom controller, but what are the other steps I need to take to have 2 variants of my rendering? And what are the options in my view with these variants - what can be altered?
| |
Background
Under sitecore/marketingDefinitions/goal/definitionManager, you have the following parameter configured:
<param desc="isReadOnly" type="System.Boolean" factoryMethod="Parse" arg0="true" patch:source="Sitecore.Marketing.config" />
This means that the definition manager is configured to be read-only.
Here's the original text of this node in Sitecore.Marketing.config:
<param desc="isReadOnly" type="System.Boolean" factoryMethod="Parse" arg0="$(marketingDefinitions.isReadOnly)" />
As you can see, the value of this parameter is taken from marketingDefinitions.isReadOnly—a Sitecore configuration variable. This variable is defined in the same file and by default it's set to false:
<sc.variable name="marketingDefinitions.isReadOnly" value="false" />
This variable can be set to true in certain environments. Here's a list of predefined configs where this value is changed to true:
Sitecore.MarketingCD.config.disabled
Sitecore.MarketingProcessingRole.config.disabled
Sitecore.MarketingReportingRole.config.disabled
Sitecore.Xdb.Remote.Server.config.disabled
Solution
Make sure that the configuration of your CM server is correct. It shouldn't be configured as a processing or a CD server. The variable marketingDefinitions.isReadOnly needs to be set to false, the same as it is out of the box.
|
Can't deploy marketing definitions, "definition manager is in read only mode"
I'm getting the error The definition manager is in read only mode in this environment when triggering "Deploy Marketing definitions" from control panel.
How do I enable "write mode?" on CM server? And how often are we supposed to deploy definitions? Shouldn't this happen automatically?
Config definition (from showconfig.aspx)
<goal definitionInterface="Sitecore.Marketing.Definitions.Goals.IGoalDefinition, Sitecore.Marketing">
<definitionManager type="Sitecore.Marketing.Definitions.Goals.GoalDefinitionManager, Sitecore.Marketing" singleInstance="true">
<config>
<customTaxonomyFieldMappings patch:source="Sitecore.Marketing.config">
<mapping fieldId="{E7B5C821-A54C-4264-9C06-C6EBDBFCD6B8}" taxonomyRootId="{13D17E8A-FED4-4799-8DEF-05E9691A3E15}" />
<mapping fieldId="{B3D6C41E-E37B-48AB-B8EC-13DCA18CE729}" taxonomyRootId="{7DE5CC49-D985-49E1-AC61-663A1411AE42}" />
<mapping fieldId="{781346DF-7E91-42F1-BA62-A63572520850}" taxonomyRootId="{D7D814A0-294D-444C-BED0-EEAEA7CD5A27}" />
</customTaxonomyFieldMappings>
<knownTaxonomyFieldMappings patch:source="Sitecore.Marketing.config">
<mapping fieldId="{8B553339-088A-4CFA-AB21-B8D0B8C0B77D}" taxonomyRootId="{733CECC5-1A6D-4C81-8267-D52A80349EE4}" />
</knownTaxonomyFieldMappings>
<activationFeed patch:source="Sitecore.MarketingProcessingRole.config" />
</config>
<param desc="repository" ref="marketingDefinitions/goal/repositories/rdb" patch:source="Sitecore.Marketing.config" />
<param desc="classificationResolver" type="Sitecore.Marketing.Definitions.DefaultClassificationResolver, Sitecore.Marketing" patch:source="Sitecore.Marketing.config" />
<param desc="definitionFieldLabelResolver" type="Sitecore.Marketing.Definitions.ItemBasedDefinitionFieldLabelResolver, Sitecore.Marketing" patch:source="Sitecore.Marketing.config">
<param desc="databaseName" ref="marketingDefinitions/itemRepositoriesDatabase" />
</param>
<param desc="searchProvider" patch:source="Sitecore.Marketing.config" ref="marketingDefinitions/goal/searchProviders/notSupported" />
<param desc="isReadOnly" type="System.Boolean" factoryMethod="Parse" arg0="true" patch:source="Sitecore.Marketing.config" />
</definitionManager>
<repositories>
<rdb type="Sitecore.Analytics.Reporting.DefinitionData.Marketing.GoalDefinitionRdbRepository, Sitecore.Analytics" singleInstance="true">
<param desc="connectionStringName">reporting</param>
<param desc="cache" type="Sitecore.Analytics.Reporting.DefinitionData.Marketing.RdbCache.DefinitionCache`1[[Sitecore.Marketing.Definitions.Goals.Data.GoalDefinitionRecord, Sitecore.Marketing]], Sitecore.Analytics">
<param desc="name">marketing.rdb.goal</param>
<param desc="maxSize">20MB</param>
</param>
<param desc="availableCulturesCache" type="Sitecore.Analytics.Reporting.DefinitionData.Marketing.RdbCache.Cache`2[[Sitecore.Data.ID, Sitecore.Kernel],[System.Collections.Generic.IReadOnlyList`1[[System.Globalization.CultureInfo]]]], Sitecore.Analytics">
<param desc="name">marketing.rdb.goal.cultures</param>
<param desc="maxSize">20MB</param>
</param>
</rdb>
<item type="Sitecore.Marketing.Definitions.Goals.Data.ItemDb.GoalDefinitionItemRepository, Sitecore.Marketing" singleInstance="true" patch:source="Sitecore.Marketing.config">
<param desc="databaseName" ref="marketingDefinitions/itemRepositoriesDatabase" />
<param desc="assumeActive" type="System.Boolean" factoryMethod="Parse" arg0="false" />
</item>
</repositories>
<searchProviders patch:source="Sitecore.Marketing.config">
<notSupported type="Sitecore.Marketing.Search.NotSupportedSearchProvider`1[[Sitecore.Marketing.Definitions.Goals.IGoalDefinition, Sitecore.Marketing]], Sitecore.Marketing" />
</searchProviders>
</goal>
Full exception:
Message: An unhandled exception occurred.
Source: Sitecore.Mvc
at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.ShowErrorMessage(ExceptionContext exceptionContext, ExceptionArgs args)
at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.Process(ExceptionArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
at Sitecore.Mvc.Filters.PipelineBasedRequestFilter.OnException(ExceptionContext exceptionContext)
at System.Web.Mvc.ControllerActionInvoker.InvokeExceptionFilters(ControllerContext controllerContext, IList`1 filters, Exception exception)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
at Sitecore.Mvc.Controllers.SitecoreActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
at System.Web.Mvc.Controller.<>c__DisplayClass22.<BeginExecuteCore>b__1e()
at System.Web.Mvc.Async.AsyncResultWrapper.<.cctor>b__0(IAsyncResult asyncResult, Action action)
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at Sitecore.Mvc.Routing.RouteHttpHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Nested Exception Exception: System.AggregateException
Message: One or more errors occurred.
Source: mscorlib
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Sitecore.Analytics.Reporting.DefinitionData.Marketing.Deployment.DeploymentManager.DeployAll[TDefinitionInterface](CultureInfo culture)
at Sitecore.Shell.Client.Applications.Marketing.Utilities.DeployMarketingDefinitions.DeployMarketingDefinitionsController.DeployDefinitionTypes(String[] definitionTypes)
at Sitecore.Shell.Client.Applications.Marketing.Utilities.DeployMarketingDefinitions.DeployMarketingDefinitionsController.DeployDefinitions(String definitionTypes, Boolean publishTaxonomies)
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
> Nested Exception
Exception: System.NotSupportedException
Message: The definition manager is in read only mode in this environment.
Source: Sitecore.Marketing
at Sitecore.Marketing.Definitions.DefinitionManagerBase`1.EnsureWriteIsEnabled()
at Sitecore.Marketing.Definitions.DefinitionManagerBase`1.Save[TRecord](TDefinition definition, Boolean activate, IDefinitionRepository`1 repository, Action`2 setCustomFields)
at Sitecore.Marketing.Definitions.Goals.GoalDefinitionManager.SaveAsync(IGoalDefinition definition, Boolean activate)
at Sitecore.Analytics.Reporting.DefinitionData.Marketing.Deployment.DeploymentManager.<DeployAllAsync>d__d`1.MoveNext()
| |
Sitecore comes with out of the box possibilities to configure media caching.
Have a look at the Sitecore.config:
<!-- MEDIA RESPONSE - CACHEABILITY
The <see cref="HttpCacheability">cacheability</see> to use in media response headers.
Possible values: NoCache, Private, Public, Server, ServerAndNoCache, ServerAndPrivate
Default value: private
-->
<setting name="MediaResponse.Cacheability" value="private"/>
<!-- MEDIA RESPONSE - CacheExtensions
The <see cref="HttpCachePolicy.AppendCacheExtension">cache extension(s)</see> to use in media response headers.
Default value: ""
-->
<setting name="MediaResponse.CacheExtensions" value=""/>
<!-- MEDIA RESPONSE - MAX AGE
The <see cref="HttpCachePolicy.SetMaxAge">max age</see> to use in media response headers.
Set it to "00:00:00" to omit this header.
Default value: 7.00:00:00 (seven days)
-->
<setting name="MediaResponse.MaxAge" value="7.00:00:00"/>
<!-- MEDIA RESPONSE - SLIDING EXPIRATION
The <see cref="HttpCachePolicy.SetSlidingExpiration">sliding expiration</see> to use in media response headers.
Set it to "" to omit this header. To include it, use "true" or "false".
Default value: ""
-->
<setting name="MediaResponse.SlidingExpiration" value=""/>
<!-- MEDIA RESPONSE - VARY HEADER
Specifies the value for the Vary HTTP header to use in media response headers.
Set it to "" to omit this header.
Default value: ""
-->
<setting name="MediaResponse.VaryHeader" value=""/>
These are used in the MediaRequestHandler. Check the handlers section of your Web.config file.
<add verb="*" path="sitecore_media.ashx" type="Sitecore.Resources.Media.MediaRequestHandler, Sitecore.Kernel" name="Sitecore.MediaRequestHandler"/>
If you want the static user specific PDF files set up correctly, you would need to:
Not change the MediaResponse.Cacheability since it is already set to private
Set the MediaResponse.MaxAge to 00:00:00.
No-store should also already be present due to the setting DisableBrowserCaching.
<!-- DISABLE BROWSER CACHING
If true, all pages will have:
Cache-Control: no-cache, no-store
Pragma: no-cache
in the http header
-->
<setting name="DisableBrowserCaching" value="true"/>
You can modify the MediaRequestHandler to tailor it more to your needs. For example: only logged in users to a specific domain can download media files.
Read this blog for some more information: http://www.doodle.co.uk/blogs/2015/03/03/restricting-access-to-sitecore-media-items
|
Sitecore Implementation - HTML Cache Control Setting options
We are building a very transnational membership portal on sitecore platform. So Rendering output caching is not a good option for us.
Per this htm-caching guideline (https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching), we would like all the static contents such as JS, CSS, Images etc to be cached by both user browser as well as CDN. This means setting the cache-control as public, max-age: 1 week and appropriate ETAG).
At the same time there will be static user specific PDF files which should be set as Private ,max-age:0,no-store).
Is there a best way to configure above using sitecore (configuration or custom code or module)?
| |
If your multisite Habitat solution is using a single IIS site, per the current license model. Then all the web projects (Feature/Foundation/Project) are batched into a single package. That is how we are currently doing it. We are publishing all the files to a single temp location, similar to a deployment. Then we deploy all the yml files and folder structure for Unicorn into its own folder. Finally packaging that up into a NuGet package for deployment.
Looking at the Habitat solution, you can see that the CI script runs through all the projects gathering all the files into a single package. https://github.com/Sitecore/Habitat/blob/master/gulpfile-ci.js#L60
gulp.task("CI-Enumerate-Files", function () {
var packageFiles = [];
config.websiteRoot = websiteRootBackup;
return gulp.src(path.resolve("./temp") + "/**/*.*", { base: "temp", read: false })
.pipe(foreach(function (stream, file) {
var item = "/" + file.relative.replace(/\\/g, "/");
console.log("Added to the package:" + item);
packageFiles.push(item);
return stream;
})).pipe(gutil.buffer(function () {
xmlpoke("./package.xml", function (xml) {
for (var idx in packageFiles) {
xml.add("project/Sources/xfiles/Entries/x-item", packageFiles[idx]);
}
});
}));
});
If you solution is using multiple IIS sites, then you are going to want to package up all the assets into separate NuGet packages so that you can deploy to each site separately. This would include all Features and Foundation as well as the IIS sites project project(s).
|
How do I configure Octopus Octopack to deploy my Helix/Habitat projects?
In the Helix/Habitat style, I have a solution with many 'web projects'. So if using octopus Deploy / Octopack, should I have a package for each Web project in my solution? If so, how/where does each package get deployed?
Do the contents of different src web projects end up merged to one target site?
| |
The Second request being served well is for the reason it is returned from Sitecore caches - Item Cache or even HTML Cache, if that is configured for the rendering.
Adding to Prefetch Cache might help, and you can check whether the required item is returned from cache or not, using Sitecore Cache Admin marketplace module
But, If your first request is taking long time to load the page, I would suggest you to check in code - lets say a Custom pipeline or processor - which is called on every request. Or say, a rendering which is added in the main Default Layout of your website. If you are using something like say ShareThis component, its good to add it as ASYNC on page, and it doesn't add up to the page load.
PS: A Strong Advice: Please do not hide code issues using cache, you might be able to shoo it away for now, but it will reappear sometime in future and with a problem bigger in size.
|
Can prefetch caching help me solve, first page request for every page is slow?
for some reason the first request for every single pages on our site is pretty slow. 2nd hit and subsequent are good.
Thinking of applying a patch for CD per below:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<cacheSize>500MB</cacheSize>
<template desc="mysitetemplate">{xxxxxxxx-8F46-4948-AE74-DA5B6B5AFA86}</template>
<template desc="mysiteLayout">{xxxxxx-64EE-4919-9D41-02FD40FD1466}</template>
<item desc="mySiteHome">{xxxxxx-DEA5-42EA-9C1C-8A5DF7E70EF9}</item>
<children desc="mySiteMainIems">{xxxxxxxx-DEA5-42EA-9C1C-8A5DF7E70EF9}</children>
</configuration>
So that all the relevant items that uses layouts, templates defined above are prefetched. Also the home and its children as well.
Is this a good approach, has anyone done this before and faced any issues /worked well?
| |
Background
When the ItemResolver processor executes, it determines the context item for the request based on the current URL. Additionally, it also performs a security check to see if the current user can access that item. If they can't, the context item is cleared and a PermissionDenied property on HttpRequestArgs is set to true.
When the ExecuteRequest processor executes, the PermissionDenied property is inspected and this is where Sitecore decides to redirect the user to the login page if one has been specified for the site. It does not determine if the user is already logged in or not when doing so, hence your problem.
Solution
You can achieve what you want by adding a pipeline step in-between the ItemResolver and ExecuteRequest processors in the httpRequestBegin pipeline:
public class PermissionDeniedResolver : HttpRequestProcessor
{
public override void Process(HttpRequestArgs args)
{
Assert.ArgumentNotNull((object) args, "args");
if (args.PermissionDenied && UserIsLoggedIn(Sitecore.Context.User)
{
// Redirect to your permission denied page here
}
}
private bool UserIsLoggedIn(Account user)
{
// Perform your logged in test here, e.g:
return user.IsAuthenticated;
}
}
This can then be patched to execute after the Item resolver:
<processor type="MyProject.Pipelines.HttpRequest.PermissionDeniedResolver, MyProject"
patch:after="*[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']"/>
|
How to return 401 page instead of login page when logged in user doesn't have permission
Currently, when a logged in user tries to access a page that they do not have permission to (because they don't have a certain role), Sitecore seems to redirect the user to the login page.
This is obviously confusing to the user as they are already logged in - I'd like to show a 401 page instead.
| |
Sitecore.Globals.ServerUrl is set in the Globals.Load function by calling WebUtil.GetServerUrl(HttpContext.Current.Request.Url, false).
The code for that is:
public static string GetServerUrl(Uri url, bool forcePort)
{
if (url == (Uri) null)
return string.Empty;
string scheme = url.Scheme;
string host = url.Host;
string @string = url.Port.ToString();
string str = string.Format("{0}://{1}", (object) scheme, (object) host);
if (forcePort || @string != "80")
str += string.Format(":{0}", (object) @string);
return str;
}
So the ports are getting added because GetServerUrl adds the port any time the Uri.Port value is not 80.
To make the LinkManager work, you need to make sure that in your site definition you have both the targetHostName and scheme set correctly. These can be setup in your standard deployment process:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<sites>
<site name="foo" patch:before="site[@name='website']"
host="foo.com|other.foo.com"
... other settings ...
targetHostName="foo.com"
scheme="https"
/>
</sites>
</sitecore>
</configuration>
With those set, calling the LinkManager with AlwaysIncludeServerUrl set to true in the options should give you:
https://foo.com/en/path/to/your/page
|
Obtaining a site url with correct binding port dynamically
I have a situation where I need to obtain a link to the item at my site to use it in an e-mail notification. I currently do it like this: var baseUrl = new Uri(Sitecore.Globals.ServerUrl);.
This method works for my local site instance, which has the following bindings:
Type | Host name | port
http | foo | 80
https| foo | 443
I go to https://foo/, trigger my e-mail notification and the link I get in the e-mail is "https://foo/", so all is well. When debugging, Sitecore.Globals.ServerUrl contains "https://foo:443".
However, our shared sandbox site is configured to be used as https://foo.bar:44305. The bindings there are as follows:
Type | Host name | port
http | foo | 80
https| foo | 443
https| | 8082
http | | 8081
https| | 44301
https| | 44305
and while I use https://foo.bar:44305 to trigger e-mail to be sent, I receive "https://foo.bar:8081" in my e-mails.
If I add an extra binding <... >
https| foo | 40443 to my local instance, I start getting "https://foo:40443" in the e-mails while triggering them from plain https://foo.
The alternative we tried is hard-coding the link to be used in Web.config. which obviously works, but the link is not resolved dynamically, so we have to always keep this in mind to change it before deploying to production, etc.
Is there actually a way to do this properly without hard-coding or messing up the bindings? I'm also very curious why Sitecore.Globals.ServerUrl contains a seemingly random binding port.
Update: per @RichardSeal's advice I also tried to get this link via Sitecore.Links.LinkManager:
var options = LinkManager.GetDefaultUrlOptions();
options.AlwaysIncludeServerUrl = true;
var url = Sitecore.Links.LinkManager.GetItemUrl(item);
In this case I obtain a relative url, not a full url, i.e: /en/sitecore/shell/foo/home/lookbook/sales/list
| |
This is a known bug at Sitecore. We had the same problem and created a Sitecore ticket. Please use the reference number 106439 if you contact them.
This is the solution though:
I was able to reproduce the described behavior in my own environment and have registered this as a bug in the current version of Sitecore.
As a workaround for the issue, please perform the following steps:
1. Navigate to the \sitecore\shell\Controls\BucketList folder and back up the default BucketList.js file.
2. Place the attached BucketList.js file instead.
3. Clear browser caches.
And here is the contents of the BucketList.js file:
var Sitecore = Sitecore || {};
Sitecore.InitBucketList = function (id, clientId, pageNumber, searchHandlerUrl, filter, databaseUrlParameter, typeToSearchString, of, enableSetStartLocation) {
var self = {};
self.id = id;
self.clientId = clientId;
self.pageNumber = pageNumber;
self.searchHandlerUrl = searchHandlerUrl;
self.filter = filter;
self.databaseUrlParameter = databaseUrlParameter;
self.typeToSearchString = typeToSearchString;
self.of = of;
self.enableSetStartLocation = (enableSetStartLocation.toLowerCase() === 'true');
self.currentPage = 1;
self.selectedId = '';
self.doneTypingInterval = 2000; //time in ms, 2 second for example
/*self.contentLanguage = $('scLanguage').value;*/
self.contentLanguage = $('ContentEditorForm').lang;
var typingTimer;
self.format = function (template) {
var args = arguments;
return template.replace(/\{(\d+)\}/g, function (m, n) { return args[parseInt(n) + 1]; });
};
// Sends 'GET' request to url specified by parameter
// and apply success handler to multilist element
self.sendRequest = function (url, data, multilist) {
new Ajax.Request(url,
{
method: 'POST',
parameters: data,
onSuccess: new self.SuccessHandler(multilist)
});
};
// Cunstructor for request success handler
self.SuccessHandler = function (multilist) {
return function (request) {
var response = eval(request.responseText);
multilist.options.length = 0;
multilist.removeClassName('loadingItems');
var itemIdsHash = {};
var reducedItems = [];
var i;
var item;
for (i = 0; i < response.items.length; i++) {
item = response.items[i];
if (!itemIdsHash[item.ItemId]) {
itemIdsHash[item.ItemId] = true;
reducedItems[reducedItems.length] = item;
}
}
for (i = 0; i < reducedItems.length; i++) {
item = reducedItems[i];
multilist.options[multilist.options.length] = new Option((item.DisplayName || item.Name) + ' (' + item.TemplateName + (item.Bucket && (' - ' + item.Bucket)) + ')', item.ItemId);
}
self.pageNumber = response.PageNumbers;
self.currentPage = response.CurrentPage;
$('pageNumber' + self.clientId).innerHTML = self.format(self.of, self.currentPage, self.pageNumber);
};
};
// Return id of selected item
self.getSelectedItemId = function (controlSuffix) {
var all = scForm.browser.getControl(self.id + controlSuffix);
for (var n = 0; n < all.options.length; n++) {
var option = all.options[n];
if (option.selected) {
return option.value;
}
}
return null;
};
self.onFilterFocus = function (filterBox) {
if (filterBox.value == self.typeToSearchString) {
filterBox.value = '';
}
filterBox.addClassName('active').removeClassName('inactive');
};
self.onFilterBlur = function (filterBox) {
if (!filterBox.value) {
filterBox.value = self.typeToSearchString;
}
filterBox.removeClassName('active').addClassName('inactive');
};
self.moveToCurrentPage = function () {
var filterBox = document.getElementById('filterBox' + self.clientId);
var filterValue = (filterBox.value && filterBox.value != self.typeToSearchString) ? filterBox.value : '*';
var multilist = $(self.clientId + '_unselected').addClassName('loadingItems');
var savedStr = encodeURIComponent(filterValue);
var filterString = self.enableSetStartLocation ? self.getOverrideString('%2Blocation=') : self.filter;
var selectedIdsFilter = self.getSelectedIdsFilter();
self.sendRequest(self.searchHandlerUrl, 'fromBucketListField=' + savedStr + "&" + filterString.replace(/\+/g, "%2B") + selectedIdsFilter + '&pageNumber=' + self.currentPage + self.databaseUrlParameter + '&scLanguage=' + self.contentLanguage, multilist);
};
// Replaces overrideKey value in filter by value from ovverrideInput
self.getOverrideString = function (overrideKey) {
var overrideInput = document.getElementById('locationOverride' + self.clientId);
if (!overrideInput || !overrideInput.value.length > 0) {
return self.filter;
}
var replaceStartIndex = self.filter.indexOf(overrideKey);
if (!~replaceStartIndex) {
return self.filter;
}
var replaceEndIndex = self.filter.indexOf('&', replaceStartIndex + 1);
if (!~replaceEndIndex) {
replaceEndIndex = self.filter.length;
}
var stringToReplace = self.filter.substring(replaceStartIndex, replaceEndIndex);
return self.filter.replace(stringToReplace, overrideKey + overrideInput.value);
};
self.getSelectedIdsFilter = function() {
return [].slice.call($(self.clientId + '_selected').options, 0)
.map(function(option) { return "&-id=" + option.value })
.join('');
};
self.initEventHandlers = function () {
$('filterBox' + self.clientId).observe('focus', function () {
self.onFilterFocus($('filterBox' + self.clientId));
});
$('filterBox' + self.clientId).observe('blur', function () {
self.onFilterBlur($('filterBox' + self.clientId));
});
$('filterBox' + self.clientId).observe('keyup', function () {
typingTimer = setTimeout(function () { self.currentPage = 1; self.moveToCurrentPage(); }, self.doneTypingInterval);
});
$('filterBox' + self.clientId).observe('keydown', function () {
clearTimeout(typingTimer);
});
$('next' + self.clientId).observe('click', function () {
if (self.currentPage + 1 <= self.pageNumber) {
self.currentPage++;
self.moveToCurrentPage();
}
});
$('prev' + self.clientId).observe('click', function () {
if (self.currentPage > 1) {
self.currentPage--;
self.moveToCurrentPage();
}
});
$(self.id + '_unselected').observe('dblclick', function () {
scContent.multilistMoveRight(self.id);
});
$(self.id + '_selected').observe('dblclick', function () {
scContent.multilistMoveLeft(self.id);
});
$(self.id + '_unselected').observe('click', function () {
self.selectedId = self.getSelectedItemId('_unselected');
});
$(self.id + '_selected').observe('click', function () {
self.selectedId = self.getSelectedItemId('_selected');
});
$('btnRight' + self.id).observe('click', function () {
scContent.multilistMoveRight(self.id);
});
$('btnLeft' + self.id).observe('click', function () {
scContent.multilistMoveLeft(self.id);
});
$('refresh' + self.clientId).observe('click', function () {
self.currentPage = 1;
self.moveToCurrentPage();
});
$('goto' + self.clientId).observe('click', function () {
scForm.postRequest('', '', '', 'contenteditor:launchtab(url=' + self.selectedId + ', la=' + self.contentLanguage + ')');
return false;
});
};
var pageNumberElement = $('pageNumber' + self.clientId);
if (pageNumberElement) {
pageNumberElement.innerHTML = self.format(self.of, self.currentPage, self.pageNumber);
self.initEventHandlers();
self.moveToCurrentPage();
}
};
|
Multilist With Search in Rendering Parameters is empty
It looks like Multilist With Search does not work in rendering parameters. No items loaded in list even for very simple query. Is it intentional behavior or there is a way to configure it correctly?
Sitecore 8.1, 8.2
| |
You don't necessarily need to implement Persona's to achieve this. You could implement a custom rule to check the value stored on the facet and react accordingly.
You can then implement your custom rule and display differing components dependent on the outcome of the rule.
https://sitecorecommerce.wordpress.com/2016/10/24/create-and-configure-xdb-custom-facet/
https://community.sitecore.net/technical_blogs/b/getting_to_know_sitecore/posts/using-custom-contact-data-part-3-rules
Persona's would make sense if you needed to display particular content on a combination of different user behaviours.
|
Configuring a persona?
While I have used Sitecore for several years now, I am relatively new to xDB. About a month or so ago, I finally got xDB configured and am capturing data complete with some custom facet data.
One of the facets we capture is the visitors industry. I would like to start grouping folks based on what industry they selected and display different content to them. I believe the first step to this is to configure a Persona -- such as Manufacturer or Retailer. Is this correct?
If so, is there a good step by step guide for doing so? The profile key template seems to just be focused on scores, not values of fields, so maybe I am looking in the complete wrong place.
| |
Well you could extend the item:added event to then take the item name and update the title to have a formatted item name minus all the special characters.
You would need to do a check to ensure the item that you are adding has a field called Title or else it would fail. This probably isn't the most efficient and elegant solution because you are basically calling this code on every item add event. You could alternatively choose extend the custom standard values tokens, such as $id or $parentname and create your own called $nameclean.
To extend this token replacement, you would patch the Setting MasterVariablesReplacer and set it to a class that you'll create that will just extend from the existing Sitecore.Data.MasterVariablesReplacer, Sitecore.Kernel.dll. If you decompile the Sitecore.Kernel.dll you can see the original source to that dll. Then you can add an additional line to replace this new custom token that you created. Then all you would need to do is add to the Title field for your Template, to the StandardValues $nameclean, and when your item is created from this template it will generate the name you seek.
|
Manipulate item name on create
We are using out of the box item name functionality in Sitecore. We are also using $name to add that to the title of the page. Our client would like to have the following happen. They would like to create an item and add the title of the item as-is in the name dialog that shows up. They would then like the proper alphabets/numbers and hyphens automatically created in the item name and the title copied as is to the title field.
Is anything like this possible? I haven't seen any code examples/samples for this kind of functionality.
Thanks
| |
That's because your Author field (defined on a page template) is a link type and what you are displaying right now is a raw field value (which in your case is a guid).
This is normal and expected. To fulfil your requirements you need to create so called 'pass through field' or field reference.
Instead of creating VariantField with Author value in FieldName field, create a VariantReference with Author value in PassThroughField field.
Then underneath create the variant structure to display fields from linked author item.
Your variant definition item could look like this.
To summarize
Title and Image under variant definition node displays fields from the page you are currently on but Name, Profile Picture, Short Bio displays fields from different item (linked author item).
|
How to display linked item's fields with rendering variants using SXA?
I've created a custom template that links to the author of an article that I'm publishing. Whenever I render that variant, I get the Sitecore Item ID instead of the text of that link. I'd like to do this without any coding (I'm trying to use SXA as much as I can OOB), but if there's not a way, then a coded solution would be OK. Here's how my Author field is setup:
Here's my Variant Configuration:
Here's what the rendered version looks like:
What do I need to do in order to display the sitecore item instead of the ID?
| |
Solution 1. SPE
I recommend using Sitecore Powershell Extensions for that.
Example code snippet:
$fields = "Content", "Title"
$startPath = "/sitecore/content/Playground/Playground/int/Home"
$phrase = "http"
function Item-Report($i){
$fields | % {
if($i.Fields[$_] -ne $null -and $i.Fields[$_].Value.Contains($phrase) -eq $true){
Write-Host $i.Paths.Path "[" $_ "]"
}
}
}
Get-ChildItem -Path $startPath -Recurse | % { Item-Report $_ }
$fields - defines list of fields that should be checked.
$startPath - this is start path. Root of all items you want to check
$phrase - text you want to search in all fields
If needed you can use Regex instead of basic Contains (note that url can be http or https), this is just an example code snippet.
Pros:
You can invoke Replace, editing each field so you don't have to do it manually.
Cons:
You need to install additional module if you haven't it already
Solution 2. SQL
You can try to get report using SQL Queries.
Example:
SELECT TOP 1000 [Id]
,[ItemId]
,[FieldId]
,[Value]
,[Created]
,[Updated]
,[DAC_Index]
FROM [sxa_sitecore_master].[dbo].[VersionedFields]
WHERE FieldId in ('8DBAF611-51C6-4A44-A0DB-92C3DC6DDAC9', '{D81F4C5A-71D0-497E-9612-CFC960165412}')
AND Value LIKE '%http%'
Depending how you store your data you should check other fields as well.
[sxa_sitecore_master].[dbo].[SharedFields]
[sxa_sitecore_master].[dbo].[UnversionedFields]
Pros:
Very fast, no additional modules needed.
Cons:
You can easily get a report but writing an UPDATE command could be hard and risky. I would not do it.
|
How to get a list of all external links
We want to move from http to https. Therefore we need a list of all external links in order to determine which ones have to be changes if external content is embedded. How can this be accomplished?
| |
SPE loses Sitecore context if /sitecore/content/home item is not present and falls back to Windows context.
To force it to use the master database set the location at the top of your script:
Set-Location master:
You can also set the context from the ISE window from the ribbon:
This was raised as an issue on Github and has been fixed in SPE 4.2 so that the context falls back to /sitecore/content instead.
|
Getting "Current Sitecore database cannot be established" using Sitecore Powershell Extensions
I'm trying to get my feet wet in Sitecore Powershell.
I need to list renderings on a list of items. Some of the script works, like getting the items and outputting the name, but when calling Get-Rendering or Get-LayoutDevice i always get the error:
Current Sitecore database cannot be established, current location is not within a Sitecore content tree.
Google offers no help. What am I doing wrong? The script I am buildling on currently looks like this:
$pages = get-item master:/content/MySite/articles | get-childitem -Recurse | where-object { $_.TemplateName -match "Article" }
$device = Get-LayoutDevice -Default
foreach($page in $pages){
write-host $page.name
Get-Rendering -Item $page -Device $device
}
| |
Yes, you can use an external index provider by implementing a custom search provider to use in place of the standard Lucene or Solr indexes.
This is made possible by Sitecore providing a number of interfaces and base-classes that developers can extend if they want to create their own provider, allowing you in theory to create any kind of index you like.
This means you can use Azure Search regardless of the fact you are hosting on-premise.
Additionally, in the case of Azure Search, someone has already gone to the trouble of already creating a search provider for it that is compatible with Sitecore 8.1.
The code is hosted here - https://github.com/jscott1277/SitecoreAzureSearchProvider
It is also on the Sitecore Marketplace - https://marketplace.sitecore.net/Modules/S/Sitecore_Azure_Search_Provider.aspx?sc_lang=en
The developer has published two blog posts on the approach they took to creating this:
https://www.linkedin.com/pulse/sitecore-81-azure-search-provider-part-1-indexing-jamie-scott
https://www.linkedin.com/pulse/sitecore-81-azure-search-provider-part-2-searching-jamie-scott
|
Can Azure Search be combined with on premises Sitecore hosting?
We are preparing a Sitecore upgrade and looking into Azure Search for indexing.
Can anyone tell me if Azure Search can be comined with on premises hosting? Or do you need to host Sitecore in Azure to use Azure search?
| |
I was able to find the processor(Sitecore.Pipelines.HttpRequest.ExecuteRequest in Sitecore.Kernel) which adds these query strings and they are not configurable. To fix the issue I created a new class(CustomExecureRequest) and copied the processor and removed the query strings from HandleSiteAccessDenied, HandleItemNotFound and other methods.
I then created a patch xml file inside include folder similar to below:
<sitecore>
<pipelines>
<httpRequestBegin>
<processor patch:instead="processor[@type='Sitecore.Pipelines.HttpRequest.ExecuteRequest, Sitecore.Kernel']" type="YOUR CUSTOM CLASS TYPE, YOUR ASSEMBLY NAME" />
</httpRequestBegin>
</pipelines>
</sitecore>
Hope this helps some one!
|
Any known way to hide Sitecore sensitive data
We have configured Sitecore security on items for the roles and seeing the sensitive data in the browser logs. We have a custom error page which interrogates the return codes(403/404/ or any other) and redirect to an item.
For Ex:
Assume two roles : Admin and customer.
If there are two items:
Item1 - Admin and Customer have read access
Item2 - Only Admin has access
When customer tries to access Item2 then Sitecore is redirecting to 403 as expected and the browser url is https://mywebsite.com/error.aspx?code=403. However when I see the browser network tab I see this : https://mywebsite.com/error.aspx?code=403&item=2fitemname&user=username&site=sitename
Is there any way to hide the highlighted information(item/user/site)?
| |
If you are using the Sitecore Azure module for deploying Sitecore solution to Platform-as-a-Service (PaaS) environment (Azure Cloud Services), then the reason of the issue is due to incorrect script that sets permission in the file system:
https://kb.sitecore.net/articles/077317
|
Sitecore 8.1 update 2 on Azure environment gives "Access denied for debug folder of path /sitecore module/debug" when trying to login
We are getting a weird issue on CM environment.(Sitecore 8.1 update 2)
Pages works fine when direct url is used, but error comes when we try login to sitecore
AppPool recycle solves the issue
Access to the path 'c:\inetpub\wwwroot\cm-prod.npower.com-2016.11.9.1-deployments-2086\sitecore modules\debug' is denied
Log shows above error and some of the times it also shows
Access to the path 'C:\inetpub\wwwroot\cm-prod.npower.com-2016.11.9.1-Deployments-2086\sitemaps\' is denied.
along with above error
I thought to be permission related issue but folder is not at all there and the issue gets resolved after app pool recycle.
Issue comes once in a while (intermittent) but when issue start coming it stays there till app pool is recycled.
App pool identity is set to default app Pool idetity and all folder are set as modify access to IUSR_MachineName
snap of error given below
Ading stack trace as I captured it as image when error occured.
Full stack trace given below
Server Error in '/' Application.
________________________________________
Access to the path 'c:\inetpub\wwwroot\cm--2016.11.9\sitecore modules\debug' is denied.
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.UnauthorizedAccessException: Access to the path 'c:\inetpub\wwwroot\cm--2016.11.9\sitecore modules\debug' is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[UnauthorizedAccessException: Access to the path 'c:\inetpub\wwwroot\cm--2016.11.9\sitecore modules\debug' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +636
System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost) +1349
System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) +73
Sitecore.Web.UI.XmlControls.FolderControlSource.GetDebugFolder() +61
Sitecore.Web.UI.XmlControls.FolderControlSource.AssemblyResolve(Object sender, ResolveEventArgs args) +79
System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) +195
[FileLoadException: Could not load file or assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Access is denied.]
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +106
System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +62
System.Type.GetType(String typeName) +42
System.Web.Helpers.Claims.ClaimsIdentityConverter.GetDefaultConverters() +123
System.Web.Helpers.Claims.ClaimsIdentityConverter..cctor() +126
[TypeInitializationException: The type initializer for 'System.Web.Helpers.Claims.ClaimsIdentityConverter' threw an exception.]
System.Web.Helpers.AntiForgery.CreateSingletonAntiForgeryWorker() +168
System.Web.Helpers.AntiForgery..cctor() +15
[TypeInitializationException: The type initializer for 'System.Web.Helpers.AntiForgery' threw an exception.]
System.Web.Helpers.AntiForgery.GetHtml() +63
Sitecore.ExperienceEditor.Speak.Ribbon.PageExtender.RibbonWebControl.DoRender(HtmlTextWriter output) +832
Sitecore.Web.UI.WebControl.RenderAsText() +227
Sitecore.Mvc.ExperienceEditor.Pipelines.RenderPageExtenders.SpeakRibbon.RenderPageEditorSpeakExtender.Render(TextWriter writer) +116
Sitecore.Mvc.ExperienceEditor.Pipelines.RenderPageExtenders.RenderPageExtendersProcessor.Process(RenderPageExtendersArgs args) +65
(Object , Object[] ) +74
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +184
Sitecore.Mvc.ExperienceEditor.PageExtenderResponseFilter.GetExtendersHtml() +158
Sitecore.Mvc.ExperienceEditor.PageExtenderResponseFilter.get_ExtendersHtml() +31
Sitecore.Mvc.ExperienceEditor.Pipelines.Request.RequestEnd.AddPageExtenders.Process(RequestEndArgs args) +200
(Object , Object[] ) +74
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +184
Sitecore.Mvc.Routing.RouteHttpHandler.EndProcessRequest(IAsyncResult result) +135
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +399
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +137
________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1069.1
| |
This is ootb functionality if you use the display names. First of all, set the display names of the items (like displayname "Sur" for the "about" item in French).
Then patch the LinkManager settings like this:
<sitecore>
<linkManager>
<providers>
<add name="sitecore">
<patch:attribute name="useDisplayName">true</patch:attribute>
</add>
</providers>
</linkManager>
</sitecore>
This will tell Sitecore to use the display names when creating urls, resulting in the behavior you requested.
Sitecore will be able to resolve the url's as long as the language is known and set to the one needed for your request. As that might not always be the case, the best thing to do is to add the language to the url - this will result in www.example.ca/en/About/ContactUs and www.example.ca/fr/Sur/ContactezNous. To do this, set the languageEmbedding parameter to always by adding this line in the config above:
<patch:attribute name="languageEmbedding">always</patch:attribute>
|
Can I create and resolve URLs in the language of the current locale?
I'm trying to figure out of this is even possible, and if so, how to go about it.
I have a requirement that URLs be localized to the target language, but that the items are common and translated. ex:
the item at
/sitecore/Content/Home/About/ContactUs
would be reachable at:
www.example.ca/About/ContactUs
for the en variant, but the french translation could have a URL along the lines of:
www.example.ca/Sur/ContactezNous
Is this even possible? Have you tackled it yourself? What was your approach?
| |
I have done this before by using a custom handler to provide the sitemap. In the handler I used the SearchAPI to pull a list of all items that are derived from a _Sitemap template and that have the field in that template (Hide from Sitemap) set to false.
The output of the handler is stored in the Sitecore HtmlCache, so on a publish the cache is cleared and the next time the sitemap is requested it updates.
Here is a really rough example of how it can work:
public class SitemapHandler : IHttpHandler
{
private readonly Stack<SitemapNode> siteNodes = new Stack<SitemapNode>();
public void ProcessRequest(HttpContext context)
{
Assert.ArgumentNotNull(context, "context");
if (this.DoProcessRequest(context))
{
return;
}
context.Response.StatusCode = 404;
context.Response.ContentType = "text/html";
}
private bool DoProcessRequest(HttpContext context)
{
Assert.ArgumentNotNull((object)context, "context");
var htmlCache = CacheManager.GetHtmlCache(Sitecore.Context.Site);
var cacheKey = $"{Sitecore.Context.Site.Name}__sitemap";
var xml = htmlCache?.GetHtml(cacheKey) ?? string.Empty;
if (string.IsNullOrWhiteSpace(xml))
{
var sitemapNodes = this.GetSitemapNodes(); // this gets all the items from Sitecore that need to go into the sitemap
xml = this.GetSitemapDocument(sitemapNodes);
htmlCache?.SetHtml(cacheKey, xml);
}
context.Response.Write(xml);
context.Response.StatusCode = 200;
context.Response.ContentType = "text/xml";
return true;
}
public string GetSitemapDocument(IEnumerable<SitemapNode> sitemapNodes)
{
XNamespace xmlns = "http://www.sitemaps.org/schemas/sitemap/0.9";
var root = new XElement(xmlns + "urlset");
foreach (var sitemapNode in sitemapNodes)
{
var urlElement = new XElement(xmlns + "url", new XElement(xmlns + "loc", Uri.EscapeUriString(sitemapNode.Url)), sitemapNode.LastModified == null ? null : new XElement(xmlns + "lastmod", sitemapNode.LastModified.Value.ToLocalTime().ToString("yyyy-MM-ddTHH:mm:sszzz")), sitemapNode.Frequency == null ? null : new XElement(xmlns + "changefreq", sitemapNode.Frequency.Value.ToString().ToLowerInvariant()), sitemapNode.Priority == null ? null : new XElement(xmlns + "priority", sitemapNode.Priority.Value.ToString("F1", CultureInfo.InvariantCulture)));
root.Add(urlElement);
}
var document = new XDocument(root);
return document.ToString();
}
}
To get that responding when you hit /sitemap.xml you can just add it to the custom handlers in the sitecore config:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<customHandlers>
<handler trigger="sitemap.xml" handler="sitemap.ashx" />
</customHandlers>
</sitecore>
</configuration>
And then add the handler to the web.config in system.webServer:
<add name="SitemapXml" path="sitemap.ashx" verb="GET" type="MyProject.Handlers.SitemapHandler" preCondition="integratedMode,runtimeVersionv4.0" />
You are still going to get a big hit for a large site on an uncached sitemap tho. This was used for a smaller site that updated the content a lot, there were multiple sitemaps specific for news articles and videos, so it needed to be updated often.
You could run this on a scheduled task or as an async job post publish.
|
Options for sitemap generation on larger solutions
One of our clients has a large multi-site solution, with 3 sites that have about 100k+ pages each. All three sites have about 3/4 of their contained pages in bucketed items.
To generate the sitemaps for this site, I can think of the following options:
Generate each sitemap on publish end for each site that had items published
Update sitemap for each item that has been published (add/delete/rename/no change) once the item finished publishing
Update each sitemap on manual trigger
Update each sitemap via a scheduled task
Generate each sitemap at runtime and cache
I don't think the options that happen after publish are super feasible - the site is pretty big and that adds a lot of weight to publish. Plus, coding in the "add/delete/rename/no change" logic for updating a sitemap just seems like way more effort than it should be.
We tried to go the route of generating the sitemap at runtime and caching it, but we started getting sporadic 504 errors on some of the "first loads" because of timeouts while the sitemap was trying to generate.
I am leaning towards the scheduler route. Does anyone have any other implementations that they have done for situations like this that may be better?
Update: please note that I am really looking for code-solutions, rather than modules. However, if you want to link to a module and provide a suggestion based on a highlighted bit of code from the module's implementation that that is more than welcome!
| |
Transparent Sync is off by default and something you deliberately enable. With Transparent Sync, for items controlled by Unicorn it bypasses the Sitecore database completely. In effect, the filesystem becomes the item data-store.
In regular Unicorn usage, you still use the Sitecore databases, but any items controlled by Unicorn (i.e. specified in a configuration) are additionally serialized to the filesystem.
In environments where you don't want Unicorn to maintain serialized items on disk, you can remove / disable the Unicorn.DataProvider.config file. This still allows you to use the UI to deserialize items from the filesystem, but it won't update the filesystem as items are edited in that environment.
In a typical scenario, you would have the DataProviders enabled on your development machines so that you can keep the filesystem in-sync with the items as you edit them, and then commit those serialized items to source control. Your other environments, such as production, would have the DataProviders disabled as you would only want to deploy the changes up to them, and not be interested in tracking the changes after that.
|
Unicorn writing to disk with Transparent Sync off
Unicorn version 3.2.0
The issue I am having is that in several environments when I update a item that is being controlled by Unicorn, it is updating the yml file on disk. The expected behavior is to only update the yml files when I perform a serialization. Coworkers have suggested that I am missing a config setting that makes this an option.
Is it the expected behavior for yml files to be updated with transparent sync off? And how can I turn this feature off.
| |
It looks like you're missing Sitecore.Marketing.Lucene.IndexConfiguration.config from the App_Config directory.
Copy this file from the clean Sitecore install.
|
Could not find configuration node: marketingDefinitionSearch/indexConfigurations/marketingDefinitionLuceneIndexConfiguration
Getting Following Exception in CD Server where Xdb is enabled and rest all configs are disabled. Master Database has been turned to Pub Database(Live Database).
3248 21:44:46 ERROR Error loading hook: <hook type="Sitecore.ContentSearch.Hooks.Initializer, Sitecore.ContentSearch" patch:source="Sitecore.ContentSearch.config" xmlns:patch="http://www.sitecore.net/xmlconfig/" />
Exception: System.InvalidOperationException
Message: Could not find configuration node: marketingDefinitionSearch/indexConfigurations/marketingDefinitionLuceneIndexConfiguration
Source: Sitecore.Kernel
at Sitecore.Configuration.DefaultFactory.GetConfigNode(String xpath, Boolean assert)
at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert)
at Sitecore.Configuration.DefaultFactory.CreateFromReference(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, String[] parameters, Boolean assert)
at Sitecore.Configuration.DefaultFactory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.DefaultFactory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
at Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert)
at Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration()
at Sitecore.ContentSearch.Hooks.Initializer.Initialize()
at Sitecore.Events.Hooks.HookManager.LoadAll()
Though this is background error from log and I don't see any visible implication of this as of now. Any clue why it is so. You can find the showconfig output here
| |
Here is my roll you own provider. I have tested this in 8.0 and 8.1.
public class IPLookupProvider : LookupProviderBase
{
[UsedImplicitly]
public override WhoIsInformation GetInformationByIp(string ip)
{
Assert.ArgumentNotNull(ip, "ip");
WhoIsInformation whoIsInformation = new WhoIsInformation();
Log.Info("Looking up IP " + ip, "WhoIsInformation");
try
{
string text = RequestIPData(ip);
var matchCollection = Regex.Matches(text, "(?<=^|,)(\\\"[^\\\"]*\\\"|[^,]*)");
if (text.IndexOf("IP_NOT_FOUND", StringComparison.Ordinal) >= 0)
{
return ContactLocation.CreateUnknown();
}
string[] array = kickfireFormat.Split(',');
if (matchCollection.Count == 0)
{
throw new Exception("Unexpected format. Cannot parse the IP lookup response for IP address: {0}{1}{2}".FormatWith(ip, Environment.NewLine, text));
}
Log.Info("IP info is " + text, "WhoIsInformation");
var model = JsonConvert.DeserializeObject<IpLookup.RootObject>(text);
if (model != null
&& model.status == "success")
{
double latitude = 0;
double longitude = 0;
whoIsInformation.BusinessName = model.data.name;
whoIsInformation.City = model.data.city;
whoIsInformation.Country = model.data.country;
double.TryParse(model.data.latitude, out latitude);
double.TryParse(model.data.longitude, out longitude);
whoIsInformation.Latitude = latitude;
whoIsInformation.Longitude = longitude;
whoIsInformation.Region = model.data.region;
}
Log.Info("Model was successful." + whoIsInformation.BusinessName + "-" + whoIsInformation.City, "WhoIsInformation");
}
catch (Exception exception)
{
Logging.Helpers.Logging.LogError(exception.StackTrace, exception);
}
return whoIsInformation;
}
The RequestIP data looks like this
{
"status":"success",
"result":1,
"data":{
"name":"Vodafone GmbH",
"city":"Disteln",
"region":"Nordrhein-Westfalen",
"countryShort":"DE",
"country":"Germany",
"latitude":"51.606010",
"longitude":"7.149110"
}
}
Config
<sitecore>
<lookupManager>
<x:attribute name="defaultProvider">bonfire</x:attribute>
<providers>
<add name="bonfire" type="YourApp.IPLookupProvider, YourApp"/>
</providers>
</lookupManager>
</sitecore>
Also have you looking in Mongo to see if you country is there and valid? Its in the GeoIP table.
|
unknown country and unknown region in Sitecore Experience Analytics
I did a "roll my own" implementation of Geo IP Location, instead of paying for the Sitecore one.
My data is getting recorded. I can see it under each contacts profile details.
But when I go into the Experience Analytics Dashboard > Audience > Locations the Country and Region show only [unknown country] and [unknown region]
The city is filled out just fine.
I am guessing this is because country and region are being expected in some specific format.
Here we see country is recorded for contacts.
But here, we see that all countries show up as unknown.
UPDATE: This is my implementation code:
using Newtonsoft.Json;
using Sitecore;
using Sitecore.Analytics.Lookups;
using Sitecore.Analytics.Model;
using Sitecore.Diagnostics;
using System;
using System.Net;
namespace MySite.Analytics
{
public class IPLookupProvider : LookupProviderBase
{
[UsedImplicitly]
public override WhoIsInformation GetInformationByIp(string ipAddress)
{
WhoIsInformation whois = new WhoIsInformation();
if (!string.IsNullOrWhiteSpace(ipAddress))
{
try
{
if (Location.IsPrivateIP(ipAddress) == false)
{
Uri geoLocationServiceUrl = new Uri("https://freegeoip.net/json/" + ipAddress);
WebClient client = new WebClient();
var serviceResponse = client.DownloadString(geoLocationServiceUrl);
dynamic serviceData = JsonConvert.DeserializeObject(serviceResponse);
whois.City = serviceData.city ?? string.Empty;
whois.MetroCode = serviceData.metro_code.ToString() ?? string.Empty;
whois.Region = serviceData.region_name ?? string.Empty;
whois.PostalCode = serviceData.zip_code ?? string.Empty;
whois.Country = serviceData.country_name ?? string.Empty;
whois.Latitude = serviceData.latitude ?? 0;
whois.Longitude = serviceData.longitude ?? 0;
}
}
catch (Exception ex)
{
Log.Error("JDA.Analytics.IPLookupProvider.GetInformationByIp: " + ex.StackTrace.ToString(), ex, "Location");
}
}
return whois;
}
}
}
And my patch file:
<lookupManager>
<patch:attribute name="defaultProvider">custom</patch:attribute>
<providers>
<add name="custom" type="MySite.Analytics.IPLookupProvider, MySite.Analytics"/>
</providers>
</lookupManager>
When I look in Mongo it appears that all the Country, Region, etc. fields are
"N/A". But if I look at the details for the Contact they are populated.
| |
Here are a few examples I was able to figure out today. I welcome any recommendations on a better way to do this.
Each example loops through the list of agents in the configuration then creates and starts a new job. Using the Sitecore Configuration Factory, agents are instantiated and applied as options to a new Sitecore Job.
CleanupAgent
foreach($node in [Sitecore.Configuration.Factory]::GetConfigNodes("scheduling/agent") | Where-Object { $_.Type -like "Sitecore.Tasks.CleanupAgent"}) {
$obj = [Sitecore.Configuration.Factory]::CreateObject($node, $true)
$name = [Sitecore.Xml.XmlUtil]::GetAttribute("type", $node)
$method = [Sitecore.Xml.XmlUtil]::GetAttribute("method", $node)
$options = New-Object Sitecore.Jobs.JobOptions $name, "", "", $obj, $method
$options.AtomicExecution = $true
$options.SiteName = "scheduler"
[Sitecore.Jobs.JobManager]::Start($options)
}
CleanupPublishQueue, CleanupEventQueue, CleanupHistory
foreach($node in [Sitecore.Configuration.Factory]::GetConfigNodes("scheduling/agent") | Where-Object { $_.Type -like "*CleanupPublishQueue*" -or $_.Type -like "*CleanupEventQueue*" -or $_.Type -like "*CleanupHistory*"}) {
$obj = [Sitecore.Configuration.Factory]::CreateObject($node, $true)
$name = [Sitecore.Xml.XmlUtil]::GetAttribute("type", $node)
$method = [Sitecore.Xml.XmlUtil]::GetAttribute("method", $node)
$options = New-Object Sitecore.Jobs.JobOptions $name, "", "", $obj, $method
$options.AtomicExecution = $true
$options.SiteName = "website"
[Sitecore.Jobs.JobManager]::Start($options)
}
Note: For newer versions of Sitecore (not sure when it changed but experienced an issue on 10.2), the JobOptions class name has changed.
Change Sitecore.Jobs.JobOptions to Sitecore.Jobs.DefaultJobOptions.
|
How do you programmatically run a Sitecore agent using Sitecore PowerShell Extensions?
I need to run specific agents on demand. When I try to create a new instance of the agent using PowerShell's New-Object command it doesn't seem to work right.
| |
By using Expression.Property(...) you are trying to access a Property with the name textField on the SearchResultItem, which corresponds to this:
SearchResultItem.textField
To get a field value you instead need to use the indexer on SearchResultItem which corresponds to this:
SearchResultItem['textField']
I don't know much about Coveo, but I found Creating a Custom Rule Condition for Coveo for Sitecore in their developer guide which explains it pretty well.
It's a bit complicated to do this, so in the guide they have made a method for just that: GetFieldIndexerExpression(...).
/// <summary>
/// Gets the <see cref="Expression"/> that will invoke the indexer for the field <paramref name="p_FieldName"/>.
/// </summary>
/// <remarks>The indexer must be called as a method, not as a property.</remarks>
/// <param name="p_Instance">The parameter instance of the Linq expression. This is the part of the Linq expression before the <c>=></c> symbol.
/// <example>item => item["fieldName"]</example>
/// </param>
/// <param name="p_FieldName">The field name to reference in the indexer.</param>
/// <returns>The <see cref="Expression"/> that will invoke the field indexer when executed.</returns>
Expression GetFieldIndexerExpression(ParameterExpression p_Instance, string p_FieldName)
{
string indexerPropertyName = "Item";
// By default the indexer corresponds to the "Item" property, but one can change it.
// In order to find the name, if modified, we must search for DefaultMemberAttribute attribute.
// Fortunately, only one indexer name can be defined.
object[] attributes = p_Instance.Type.GetCustomAttributes(typeof(DefaultMemberAttribute), true);
if (attributes.Any()) {
indexerPropertyName = (attributes[0] as DefaultMemberAttribute).MemberName;
}
PropertyInfo indexerProperty = p_Instance.Type.GetProperty(indexerPropertyName,
new Type[] { typeof(string) });
MethodInfo indexerGetMethod = indexerProperty.GetMethod;
Expression callIndexerExpression = Expression.Call(p_Instance,
indexerGetMethod,
Expression.Constant(p_FieldName));
return callIndexerExpression;
}
You then use it instead of Expression.Property(...) like this:
public Expression GetQueryExpression(ConditionContext p_Context)
{
Expression readNameProperty = GetFieldIndexerExpression(p_Context.ParameterExpression, "textField");
Expression standardValuesConstant = Expression.Constant("somevalue");
return Expression.Equal(readNameProperty, standardValuesConstant);
}
With this it should now work correctly.
|
How to set a item field as ParameterExpression in Coveo
When I try to create a custom rule and pass field name, I get
Instance property 'textField' is not defined for type 'Sitecore.ContentSearch.SearchTypes.SearchResultItem' exception.
This is how my query expression is set.
public Expression GetQueryExpression(ConditionContext p_Context)
{
Expression readNameProperty = Expression.Property(p_Context.ParameterExpression, "textField");
Expression standardValuesConstant = Expression.Constant("somevalue");
return Expression.Equal(readNameProperty, standardValuesConstant);
}
| |
This might happen if the item is protected. You can verify this by clicking on an item in the content editor. You will see an information about item being protected.
If you are an admin you can unprotect the item and then be able to modify publish settings.
Further reading: http://contenttree.blogspot.com/2008/02/hiding-and-protecting-items.html
|
Unable to change publishing settings as admin
This is Sitecore 8.2 initial release. Im logged in as Admin, same result on items that has workflows or not.
I can't set publish restrictions as show in image. The warning shows and the version handling isn't working. Why can't I modify the item?
Sitecore displays a warning: You cannot change publish restrictions as you cannot modify the item.
On the affected item there are two visible warnings:
You must lock this item before you can edit it
This item is controlled by Unicorn
If I lock the item it just creates a new version of it.
| |
This is something I have been using since Sitecore Azure version 2 at least. It's my understanding that having a production and a staging slots is one of the original features of Azure Cloud services.
So even without having tested all of them I'm going to say: It's available on all Sitecore Azure versions.
|
Sitecore Azure - Swap option
Which Sitecore and Azure SDK version supports swap option as shown in the screenshot below
| |
The sitecore_analytics_index stores information about interactions, contacts, and some other xDB entities. The more data you collect, the bigger the index will grow. The more visits you have in a given time period, the more frequent index reads and writes will be.
Whether or not you should switch from Lucene to Solr depends on whether the high hard disk activity is a problem for you. If you believe that the performance of your CM is slowed down because of this Lucene index, then you should definitely try to migrate the index to a Solr instance hosted on a separate server. This will certainly take the burden off the CM.
Switching to Solr is not necessarily the only solution. Sure, the official documentation says you should upgrade if you have more than 50k documents in the index. But you can also try to switch from a spinning disc HDD to an SSD—this will make disk reads and writes much faster.
|
Lucene analytics index constantly loads HDD
We see performance issue on CM server. Content editor is very slow periodically and resource monitor shows that HDD is busy - reading and writing sitecore_analytics_index files nearly 50% of the time. We have around 1 million contacts in xDB. Can Lucene handle it or we have to use Solr?
Sitecore 8.0u3
| |
Looking at the default config for that version of WFFMs that node is not in the config (the wffm node is there but I can't see the modelFactory).
As Gatogordo suggests this node exists in previous versions of WFFMs:
<wffm>
<formProcessors>
<processor type="Sitecore.Forms.Mvc.Processors.SitecoreFormProcessor, Sitecore.Forms.Mvc"/>
</formProcessors>
<modelFactory type="Sitecore.Forms.Mvc.Data.ModelFactory, Sitecore.Forms.Mvc" singleInstance="true">
<param name="renderingContext" ref="wffm/renderingContext"/>
</modelFactory>
<renderingContext type="Sitecore.Forms.Mvc.Data.Wrappers.WrappedRenderingContext, Sitecore.Forms.Mvc" singleInstance="true"/>
<formDataManager type="Sitecore.Forms.Mvc.Data.FormDataManager, Sitecore.Forms.Mvc" singleInstance="true">
<param name="processorFactory" ref="wffm/formProcessorsFactory"/>
</formDataManager>
<formProcessorsFactory type="Sitecore.Forms.Mvc.Data.SitecoreProcessorFactory, Sitecore.Forms.Mvc" singleInstance="true"/>
</wffm>
So either your DLLs are old and expecting old config - or the installer is wrong and this config needs to be present in Sitecore.Forms.Mvc.config
I would redownload the installation package from the link above, unpack it and compare the DLL versions against your bin folder, also look for extra DLLs perhaps. If they all look correct, try adding that config node back in and see if it works.
Be worth logging this with Sitecore as well if the config on the installation package is incorrect.
|
WFFM error on a form page
When I'm opening one form of my build that runs with WFFM this is the error I get:
Could not find configuration node: wffm/modelFactory
anyone know what this error is all about? where is this configuration set?
thanks
UPDATE: Sitecore 8.0 rev 160115
WFFM: 8.0 151127
| |
Sitecore Experience Accelerator uses a different approach for that.
You can define your access rights for each rendering/group of renderings by changing the access rights to Available Renderings items.
To do it follow these steps
Navigate to Available Renderings node (/sitecore/content/Tenant/Site/Presentation/Available Renderings)
Pick item which represents a group of renderings you want to limit
Assign security rights (for example set Read to false for certain group or user)
After that, when you log in with your user you will see that the Toolbox contains only available renderings (I set Read to false for all items under Available Renderings, except Media and Page Content)
This differs from standard Allowed Controls approach. Due to the nature of dynamic placehcolders, you can set renderings availability per site not per placeholder.
EDIT:
SXA 1.4 brings placeholders settings back!
Read more here
|
What do you use instead of placeholder settings in SXA?
I want to restrict which components can be used within a placeholder when using the Sitecore Experience Accelerator module. Normally, I'd use placeholder settings to do this, but it doesn't seem to work in SXA 1.1. Is there an alternative approach to limit what content editors can add to a placeholder? Is this a bug?
I've tried associating the placeholder setting at the page design and at the partial design level, but it doesn't work in either place -- I still get the full list of SXA renderings.
| |
In my case we have a load balancer terminating TLS and then passing decrypted traffic to the backend CM server on port 80.
The only solution we could get working is to add a the header Content-Security-Policy to the Web.config with a value of upgrade-insecure-requests.
Now Chrome does not block the execution of the link but rather upgrade to https.
Example: The following transform could be used in your project.
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<httpProtocol>
<customHeaders>
<remove xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)" name="X-Powered-By" />
<add xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)" name="X-Frame-Options" value="SAMEORIGIN"/>
<add xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)" name="X-XSS-Protection" value="1; mode=block"/>
<add xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)" name="X-Content-Type-Options" value="nosniff"/>
<add xdt:Transform="InsertIfMissing" xdt:Locator="Match(name)" name="Content-Security-Policy" value="upgrade-insecure-requests"/>
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
|
Sitecore Mixed Content error for workflow
I am running into issue while using worflow in the site over HTTPS. When Item is either approved or rejected basically page refreshes and in the console i get error like
Mixed Content: The page at 'https://site/sitecore/shell/default.aspx?sc_lang=en' was loaded over HTTPS, but requested an insecure resource 'http://site//sitecore/shell/default.aspx?xmlcontrol=Workbox&mo=preview&reload=1&{190B1C84-F1BE-47ED-AA41-F42193D9C8FC}=0&{46DA5376-10DC-4B66-B464-AFDAA29DE84F}=0&{FCA998C5-0CC3-4F91-94D8-0A4E6CAECE88}=0'. This request has been blocked; the content must be served over HTTPS.
By the way we are using Sitecore.NET 8.1 (rev. 160519)
I found same issue at with no answers.
| |
I once had to tune a server with Sitecore because we did get a lot of requests and couldn't add more servers (for several reasons). I used this blog as a resource, and although it is a few years old it helped me get a significant amount of extra requests handled on the same infrastructure and code.
To answer to the MaxWorkerThreads, I did indeed put that at 100. But I also tweaked other settings like the maxconnection, minWorkerThreads and minFreeThreads.
Note that some of those settings are automatically multiplied by the number of CPUs and some are not.
When you want to tweak these settings, you could follow the basic recommendations as in the blog, but it's better to read the explanation and decide what to do based on your specific project. Example: we had lots of requests from our code to an external webservice - so we added the address of that service in the maxconnections settings allowing the application to have more connections simultaneously to the service.
One more advice: monitor your application to see if you actually need this. Can your server handle more requests/threads/...? And do it again after you made changes. There are several counters available to see what your IIS is doing (not only CPU, but also requests handled/queued/... and so on).
|
What is the optimum value (or range) for MaxWorkerThreads sitecore setting?
I believe that the default value for the MaxWorkerThreads is 20. In order to increase the number of concurrent user requests that can be processed, this needs to be increased from its default value.
I was wondering what is the optimum range for this setting? Does that range change on number of cores that are available? Also, is there a particular value above which increasing the number of threads won't really matter?
I read this post https://forums.asp.net/t/1299590.aspx?Why+maxWorkerThreads+100+and+minFreeThreads+88+is+suggested+ about increasing threads in ASP.net and it sounds like they point towards it being 100. Does that hold good here?
| |
There definitely are reserved field names. Any field on the Standard Template should not be used. I would also recommend you use an Id where possible.
You can see the use of this pattern in the Sitecore.Kernel.dll where fields found in the FieldIDs class are used when accessing standard Sitecore fields. The use of the Id will of course be fast as well as future proof.
This SO question also contains several answers recommending the use of IDs.
John also has a good explanation here about how the Standard Template is composed.
|
Are there any specific reserved field names that shouldn't be used in Sitecore?
I'm working on a project in which we are upgrading an instance of Sitecore from v6.6 to v8.1. The original code built on top of v6.6 is directly accessing the Sitecore.Data API (as opposed to Glass Mapper or some other common ORM). I found one strange behavior post-upgrade tied to this snippet of code.
var value = item["Name"];
The field in question was defined by a custom template/field simply named "Name". This is not related to the standard field Name which is actually, to the best of my knowledge, stored as "__Name". From what I could find while running a debugger, the API returns null even though the item in question has a value for that field. In the same debugger session, I explored the contents of the item.Fields collection and there was no entry for "Name". There were, however, entries for other fields defined by that template. It's as if Sitecore skipped that specific field.
Meanwhile, if I tried to retrieve that field's value via the field definition's GUID, it actually returned the value I was looking for:
var value = item["{64CC3858-18DA-43DA-A7AE-86C1DDEC316D}"];
I can live with this workaround. But for future reference and possibly the benefits of others, are there known field names that should never be used because Sitecore won't retrieve them through normal means? In other words, are there "reserved" field names?
Edit: As it turns out, this ended up being a publishing issue. I don't know how but the field section to which the field in question was a child didn't have any versions and, thus, Sitecore skipped it during publishing. Once I added an English version to that item and republished the entire template, the field and its appropriate value were available from both item["Name"] and item.Fields["Name"]. It is strange that using the GUID was a valid workaround in this situation since the field definition item didn't appear to exist in the web database.
Thanks everyone for your help!
| |
Have a look at the Federated eXperience Manager: https://doc.sitecore.net/sitecore_experience_platform/digital_marketing/federated_experience_manager/a_functional_overview_of_fxm
FXM allows you to capture visitor information across sites.
You must add a JavaScript tag to every page though.
|
Path Analyzer Tracking Pixel
I am interested in using Path Analyzer. I was told that we can use, a tracking pixel (script) on our none Sitecore sites, however, I am not finding any documentation about this. Please point me in the right direction. -JMT
| |
What is the best practice for adding custom CSS to a theme?
It depends on your theme structure but you can either edit existing file or create new one. Changes in existing file should update it in the Sitecore and new file should be imported.
How do I use the "Add-your-css-classes-here"?
You can add your custom css classes after that text (add-your-css-classes-here will be removed by Creative Exchange in the import process) or instead of it.
What css files would I use to modify site-wide settings, such as an image in the body of the page?
That completely depends on your theme structure and it's up to you. I would create one global css file for such classes. And have separate ones for specific pages. But there won't be anything wrong in having one well structured css file.
Regarding your problem - were there any messages/warning/errors in the import status dialog?
|
How do I get my custom css class to show up in SXA?
I have created a new theme in my SXA website (by duplicating the Basic Theme) and I have been able to switch to the new theme in Experience Editor. I've decided to add a background image to the body of my site. So I exported the site using the Agency Drop mode, opened up the ZIP file, and I made the following modifications:
Add a new CSS file that contains my new CSS class.
Added a reference to my new CSS file on line 9.
On line 17 of the index.html file, I found the "add-your-css-classes-here" text for the <body> tag and added my CSS class there.
Added my image to the Media/images folder
Verified my new CSS changes looked as I wanted them to by loading index.html in my browser.
Uploaded the file back to the SXA server and successfully imported the theme.
Tried to preview the changes on my page. I didn't see any differences.
Exported the site again, hoping to see my changes. The only change that I saw was the new image. My new CSS file and modifications to the index.html file did not work.
I'm sure that there is something simple that I'm missing, but I can't figure out how to create my theme. The 3 questions that I have are:
What is the best practice for adding custom CSS to a theme?
How do I use the "Add-your-css-classes-here"?
What css files would I use to modify site-wide settings, such as an image in the body of the page?
| |
We had the same issue and we could solve it to switch off the Is Ajax Mvc Form on the form items in Sitecore.
|
Sitecore 8.1 WFFM rev. 151008 does not work with MVC
I am using Sitecore.NET 8.1 rev. 151003. On top of it I am installing Web Forms for Marketers 8.1 rev. 151008
As that is working perfectly with Webforms it doesn't with MVC 5.
When I submit a simple form then it shows me success message and the whole page loads within the same page. It means that it returns full page in the form section and I end up with my website design distorted with 2 headers, 2 footers etc.
So I have problem:
How can I prevent WFFM from returning the whole page in the form area.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.