Flushing the cache
The cache.aspx page is very useful but you can only clear all caches. Use the attached aspx if you want to flush caches individually.
The cache.aspx page is very useful but you can only clear all caches. Use the attached aspx if you want to flush caches individually.
I created some code to import/read content from an external xml file. I followed the usual manager/provider pattern. I need to tell my manager which provider I want to use. I decided to put the information about the type for my provider, plus any variables it needs for the constructor in the web.config, as an include file:
<betting>
<betManager type="MyNamespace.MyClass,Sitecore.Starterkit">
<param desc="refreshtime">-1</param>
<param dexc="url">/myfile.xml</param>
<param desc="isweb">false</param>
<param desc="itemid">{CE445C73-169A-46C9-9360-B01CA2C879EA}</param>
<param desc="branchid">{EBA8F63B-8F34-43A5-8C3D-D292DB8C91A5}</param>
</betManager>
</betting>
And this would be the code in my Manager class:
<p class="MsoNormal">private const string ConfigPath = "/sitecore/betting/betManager";
[…]
if (_provider == null)
{
XmlNode xmlnode = Sitecore.Configuration.Factory.GetConfigNode(ConfigPath);
Debug.Assert(xmlnode != null, "provider defined incorrectly in web.config. Expected at "+ConfigPath);
_provider = (IBetProvider)Sitecore.Reflection.ReflectionUtil.CreateObject(xmlnode);
Debug.Assert(_provider != null, "no provider");
}
<p class="MsoNormal">
The params elements just correspond and get assigned to the parameters in the constructor:
public BetProvider(string refreshTime, string url, string islive, string itemid, string branchid )
Have you ever used a Droplist but secretly wished you had used a Droplink? Well, now nobody needs to know your secret, because you can sneakily change the field type *without losing any values* between the different field types. Just drop the attached files in the layouts, or the /sitecore/admin folder and call the TransformDroplist.aspx.
When defining Page Events for the OMS you can store as well as the title of the event, other information like text, key and data which are stored on the Analytics DB. This fields can be submitted through code, but default values can also be specified on the event definition item. Unfortunately the standard page event template does not have those fields defined (why?), but can be easily created (names text, key and data). Furthermore, replacements can be used to populate those fields. Those replacements will refer to the Context Item and need to go in [square brackets]. They can be either the tokens $name, $id, $templatename, $path, or the name of any field in the current context item.
Events can be raised by enabling them on an item (through the Analyze tab), through code using the AnalyticsTracker, or either the CurrentPage, PreviousPage or NextPage. Additionally events can be raised through the query string (as defined in the config setting Analytics.EventQueryStringKey by default sc_trk), and using the name of the page event as value.
We compressed Visual Studio project folders to send the project by email. Unfortunately all the .svn and _resharper folders are also included. You can use a nifty feature in WinRar to get rid of them:
This setting could be stored as a profile, so you don’t have to type it everytime
In many cases you want to run a Sitecore query to locate an item or group of items, but you only require the ID, or even a count of how many items meet a condition.
Imagine a list of articles, and you want to show only 20 at a time through paging. You need to know how many there are in total, but you only need the information for 20 of them.
How to write Dynamic SQL with SQLServer to improve performance and increase security. It focuses mainly on Stored Procedures.
http://www.sommarskog.se/dynamic_sql.html10 Tips for Writing High-Performance Web Applications
They use their own flavour. Syntax help: http://msdn.microsoft.com/en-us/library/2k3te2cs(VS.80).aspx