This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The SecurityDisabler overrides the current security model, allowing you | |
// to access the item without any security. It's like the user being an administrator | |
using (new Sitecore.SecurityModel.SecurityDisabler()) | |
{ | |
// Get the master database | |
Sitecore.Data.Database master = Sitecore.Data.Database.GetDatabase("master"); | |
// Get the template to base the new item on | |
Items.TemplateItem template = master.GetItem("/sitecore/templates/Sample/Sample Item"); | |
// Get the place in the site tree where the new item must be inserted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//IncidentCategoryList is the list control | |
//In this example we are only showing child items of the datasourced item which are using a specific Sitecore template named 'IncidentCategory' | |
foreach ( | |
var categoryDropDownItem in | |
DataSourceItem(IncidentCategoryItemId).Children.Where(z => z.TemplateName == "IncidentCategory")) | |
{ | |
IncidentCategoryList.Add(categoryDropDownItem.DisplayName); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Item item; | |
public String PublishDate() | |
{ | |
DateTime postDate = Context.Item.Statistics.Updated; | |
return postDate != null ? postDate.ToString("MMMM dd yyyy H:mm:ss tt") : String.Empty; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Plonk as many of these as you need for each device/context and they will be | |
applied when the media query defined is met.*/ | |
@media screen and (max-width: 320px) | |
{ | |
/* all styles for this query size go here. */ | |
/* | |
for mobile, get of as many floats as possible sot hey sit on top | |
of eachother down the page nicely. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Session expiration for the Sitecore Client. | |
When managing Client sessions, Sitecore keeps track of every user logged in to the system and assigns a Sitecore user ticket to every user accessing a Sitecore Client application. Sitecore Client user session is not limited in time and is kept alive until the browser is opened. | |
However, if after 8 hours of the current user inactivity another user logs in and the current Sitecore license used has a concurrent number of users limitation – a newly logged in user may take the currently logged in user’s license slot. Current user will be redirected to the login page when trying to use any Sitecore Client application if there are no more available license slots left for him to automatically re-login to the system. | |
If 8 hours inactivity period is too long and needs to be changed, the following workaround can be applied: | |
Copy the Sitecore.Support.323551.dll assembly to the \bin folder. | |
http://sdn.sitecore.net/upload/faq/session%20expiration/sitecore.support.323551. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--replace <newOwner> with DB user | |
exec sp_changedbowner '<newOwner>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--it uses It uses the <user>, <login> in that order | |
EXEC sp_change_users_login 'Update_One', '<user>' , '<login>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Database db = new Database("web"); | |
if (ID.IsID(id)) | |
{ | |
ID itemID = new ID(id); | |
//clear data cache | |
db.Caches.DataCache.RemoveItemInformation(itemID); | |
//clear item cache | |
db.Caches.ItemCache.RemoveItem(itemID); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="KnowledgeBaseListing.ascx.cs" Inherits="DigiconNew.layouts.Sublayouts.Controls.KnowledgeBaseListing" %> | |
<% foreach (var kbcategory in KBCategories) | |
{ | |
%> | |
<div class="article"> | |
<div class="article-title"> | |
<h3> | |
<a href='<%= GetURL(kbcategory) %>'><%= kbcategory["Article Title"]%></a> | |
</h3> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Use the encodeURIComponent to allow you to switch out all characters to their encoded | |
values. You can then attempt to inject into forms using the encoded values. | |
Example Below: | |
*/ | |
//in Web Tools (F12 in chrome), in the console, enter something like this: | |
encodeURIComponent('<script>alert("please soemthing")</script>') | |
//will return value like this which you can copy/paste into input fields on site to test |