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
Country.DataSource = Config.Get<EcommerceConfig>().Countries.Values.Where(x => x.CountryIsActive == true).ToList().OrderBy(x => x.Name); | |
Country.DataTextField = "Name"; // other properties: IsoCode, Culture, CurrencyName, CurrencyIsoCode, CurrencyIsoNumericCode | |
Country.DataValueField = "Name"; | |
Country.DataBind(); |
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 (var api = App.WorkWith()) | |
{ | |
var pages = api.Pages().LocatedIn(PageLocation.Frontend).ThatArePublished() | |
.ForEach(page => | |
{ | |
page.Extension = null; | |
}).SaveChanges(); | |
} |
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
var control = new NewsView(); | |
var pageControl = pageManager.CreateControl<PageControl>(control, placeHolder); | |
pageNode.Page.Controls.Add(pageControl); | |
pageManager.SaveChanges(); |
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
/// <summary> | |
/// Custom Sitefinity Taxonomy Control to display taxonomy items for a specific Blog | |
/// </summary> | |
public class BlogTaxonomyControl : TaxonomyControl | |
{ | |
public Guid ParentBlogID { get; set; } | |
/// <summary> | |
/// Raises the <see cref="E:System.Web.UI.Control.Load"/> event. | |
/// </summary> |
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 override void Install(SiteInitializer initializer) | |
{ | |
#region Install Toolbox Widgets | |
// get section from toolbox | |
var config = initializer.Context.GetConfig<ToolboxesConfig>(); | |
var pageControls = config.Toolboxes["PageControls"]; | |
var section = pageControls | |
.Sections | |
.Where<ToolboxSection>(e => e.Name == ToolboxesConfig.ContentToolboxSectionName) // Or other section eg: "NavigationControlsSection" |
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
<%@ Register TagPrefix="sitefinity" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" %> | |
<sitefinity:ResourceLinks ID="ResourceLinks1" runat="server" UseEmbeddedThemes="false"> | |
<sitefinity:ResourceFile Name="~/Path/To/File.css" /> | |
</sitefinity:ResourceLinks> |
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
var ctrl = pageManager.CreateControl<PageControl>("~/Path/To/Control.ascx", "ContentPlaceholderName"); | |
pageManager.SetControlDefaultPermissions(control); | |
pageData.Controls.Add(control); |
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
var bag = new Dictionary<string, string>(); | |
bag.Add("ContentType", FULL_NAME_OF_CONTENT_TYPE); | |
WorkflowManager.MessageWorkflow(dynamicContentItem.Id, dynamicContentType, null, "Publish", false, bag); |
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 string GetPageUrl(Guid PageID) | |
{ | |
var mgr = PageManager.GetManager(); | |
var pageNode = mgr.GetPageNode(PageID); | |
return pageNode.GetFullUrl(); | |
} |
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
/// <summary> | |
/// A simple field for displaying related dynamic content items in a drop-down menu. | |
/// Requirements: | |
/// * the name of the field must exactly match the name of the content type being displayed | |
/// * the content type must be within the same module as the content type using this field | |
/// </summary> | |
public class DynamicContentSelectorField : ChoiceField | |
{ | |
/// <summary> | |
/// Defaults the rendering of the list as a drop-down menu |
OlderNewer