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
<!--NOTE: Before use be sure to rename to '.config' Using the XML extension to provide better visual formatting.--> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<settings> | |
<!-- Set it to "true" if you want use the SMTP settings below. | |
You should purchase the right of using the "UseLocalMTA" setting first. --> | |
<setting name="UseLocalMTA"> | |
<patch:attribute name="value">true</patch:attribute> | |
</setting> |
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
using Sitecore.Forms.Core.Rules; | |
namespace TheCodeAttic.SharedSource.WFFM.PopulateFieldAction | |
{ | |
public class ActionTemplate<T> : ReadValue<T> where T : ConditionalRuleContext | |
{ | |
protected override object GetValue() | |
{ | |
string retVal = string.Empty; | |
/// This value is inherited from ReadValue<T>. |
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
switch (this.Name.ToLower()) | |
{ | |
case "first name": | |
retValue = Tracker.Current.Contact.GetFacet<IContactPersonalInfo>("Personal").FirstName; | |
break; | |
case "last name": | |
retValue = Tracker.Current.Contact.GetFacet<IContactPersonalInfo>("Personal").Surname; | |
break; | |
case "email": | |
IContactEmailAddresses ea = Tracker.Current.Contact.GetFacet<IContactEmailAddresses>("Emails"); |
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
Assert.IsNotNull((object)Tracker.Current, "Tracker.Current"); | |
Assert.IsNotNull((object)Tracker.Current.Contact, "Tracker.Current.Contact"); |
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
//Step 1:Using Statements | |
using Sitecore.Analytics; | |
using Sitecore.Analytics.Model.Entities; | |
using Sitecore.Diagnostics; | |
using Sitecore.Forms.Core.Rules; | |
using System.Linq; | |
//Step 2: Basic Code Structure | |
namespace TheCodeAttic.SharedSource.WFFM.PopulateFieldAction | |
{ |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<xamlControls | |
xmlns:x="http://www.sitecore.net/xaml" | |
xmlns:ajax="http://www.sitecore.net/ajax" | |
xmlns:asp="http://www.sitecore.net/microsoft/webcontrols" | |
xmlns:html="http://www.sitecore.net/microsoft/htmlcontrols"> | |
<ContactFacetDialog x:inherits="TheCodeAttic.SharedSource.WFFM.PopulateFieldAction.Sheer.ContactFacetDialog,TheCodeAttic.SharedSource.WFFM.PopulateFieldAction"> | |
<Sitecore.Controls.DialogPage runat="server" > | |
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 void Execute(XElement element, string name, UrlString parameters, string value) | |
{ | |
Assert.ArgumentNotNull((object)element, "element"); | |
Assert.ArgumentNotNull((object)name, "name"); | |
Assert.ArgumentNotNull((object)parameters, "parameters"); | |
Assert.ArgumentNotNull((object)value, "value"); | |
UrlString str = new UrlString("/sitecore/shell/~/xaml/ContactFacetDialog.aspx?ti=Contact Facet Picker&txt=Select a contact facet property&spk="+value); | |
SheerResponse.ShowModalDialog(str.ToString(), true); | |
} |
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
protected override bool Execute(T ruleContext) | |
{ | |
Assert.ArgumentNotNull((object)ruleContext, "ruleContext"); | |
Assert.IsNotNull((object)Tracker.Current, "Tracker.Current must be not null"); | |
Assert.IsNotNull((object)Tracker.Current.Contact, "Tracker.Current.Contact must be not null"); | |
if (string.IsNullOrWhiteSpace(ContactFacetMemberPath) || Tracker.Current.Contact == null) | |
return false; | |
//Custom method that reads the facet member XML path and using reflection retrieves the value. |
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
<!-- NOTE: After download rename to '.CONFIG', xml is used for better formating in Gist--> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<contentSearch> | |
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch"> | |
<indexes hint="list:AddIndex"> | |
<index id="sitecore_master_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider"> | |
<param desc="core">itembuckets</param> | |
</index> | |
<index id="sitecore_web_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider"> |
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
using Sitecore.Shell.Framework.Commands; | |
namespace TheCodeAttic.CustomContentEditorButtons | |
{ | |
public class CollapseAllCommand : Command | |
{ | |
public override void Execute(CommandContext context) | |
{ | |
Sitecore.Context.ClientPage.ClientResponse.Eval("TheCodeAttic_CollapseAll();"); | |
} |
OlderNewer