Skip to content

Instantly share code, notes, and snippets.

@DaveGoosem
DaveGoosem / web.config
Created May 8, 2013 23:36
Pick up directory for IIS website using web.config
<!--
After the </system.web> closing tag, insert the contents below between the <system.net> tags.
-->
</system.web>
<system.net>
<mailSettings xdt:Transform="Replace">
<smtp from="test@test.com.au" deliveryMethod="SpecifiedPickupDirectory">
<network host="localhost" />
<specifiedPickupDirectory pickupDirectoryLocation="d:\smtp\" />
</smtp>
@DaveGoosem
DaveGoosem / traversingAndFiltering.js
Created May 8, 2013 11:06
Traversing and Filtering
/*allows you to filter SOME of a given element with simlar components
based upon what those some have that others don't.
For example: if you had
<ul>
<li class="vacation onsale"></li>
<li class="vacation onsale"></li>
<li class="vacation"></li>
<li class="vacation"></li>
@DaveGoosem
DaveGoosem / manipulatingDom.js
Created May 8, 2013 08:08
Manipulating the DOM
//lets you add something in the DOM directly after the DOM element you target.
.append()
//lets you add something in the DOM directly before the DOM element you target.
.prepend()
.after()
//lets you place something in the DOM directly above, at the same level the item you target.
.before()
@DaveGoosem
DaveGoosem / web.config
Created May 8, 2013 01:13
Set the Default HTML Editor in Sitecore to be 'Rich Text Full'
<!-- HTML EDITOR DEFAULT PROFILE
Path to the default html editor profile.
Default value: /sitecore/system/Settings/Html Editor Profiles/Rich Text Default
-->
<setting name="HtmlEditor.DefaultProfile" value="/sitecore/system/Settings/Html Editor Profiles/Rich Text Full"/>
@DaveGoosem
DaveGoosem / dom-traversal.js
Created May 7, 2013 15:25
jQuery DOM Traversal
//returns all instances of the selector within find();
$("#vacations").find(".america");
//returns only the first of all similar DOM items
$("#vacations li").first();
//returns only the last of all similar DOM items
$("#vacations li").last();
//returns the 'next' similar DOM item to the one you previsouly specified.
@DaveGoosem
DaveGoosem / SEO Friendly URLs - Web.Config Changes
Created February 8, 2013 04:43
Change 1: To have spaces be changed to hyphens, you need to edit Sitecore’s web.config and tell it to replace ” ” with “-”. In the “encodeNameReplacements” node, we add the final “replace” node seen below. Change 2: Because of this change, whenever someone requests a page with a hyphen, Sitecore is going to assume that it needs to be translated …
<!-- Change 1 -->
<encodenamereplacements>
<replace mode="on" find="&amp;" replaceWith=",-a-," />
<replace mode="on" find="?" replaceWith=",-q-," />
<replace mode="on" find="/" replaceWith=",-s-," />
<replace mode="on" find="*" replaceWith=",-w-," />
<replace mode="on" find="." replaceWith=",-d-," />
<replace mode="on" find=":" replaceWith=",-c-," />
<replace mode="on" find=" " replaceWith="-" />
</encodenamereplacements>