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 class HomeUrlProvider : DefaultUrlProvider | |
{ | |
public override string GetUrl(UmbracoContext umbracoContext, int id, Uri current, UrlProviderMode mode) | |
{ | |
var content = umbracoContext.ContentCache.GetById(id); | |
if (content.DocumentTypeAlias == "Home" && content.Parent != null) | |
{ | |
return base.GetUrl(umbracoContext, content.Parent.Id, current, mode); | |
} |
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 class GoogleMapsConverter : PropertyValueConverterBase, IPropertyValueConverterMeta | |
{ | |
public override object ConvertSourceToObject(PublishedPropertyType propertyType, object source, bool preview) | |
{ | |
if(source != null && !string.IsNullOrWhiteSpace(source.ToString())) | |
{ | |
var coordinates = source.ToString().Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); | |
if (coordinates.Length == 3) | |
{ | |
return new GoogleMaps |
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 archetypeModel = this.GetPropertyValue<ArchetypeModel>("tourLocations"); | |
return archetypeModel.Select(x => | |
{ | |
return new TourLocation() | |
{ | |
Name = x.GetValue<string>("name"), | |
Translations = x.GetValue<ArchetypeModel>("translations").Select(y => | |
{ | |
return new Translation() | |
{ |
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 class NewsContentFinder : IContentFinder | |
{ | |
public bool TryFindContent(PublishedContentRequest contentRequest) | |
{ | |
if (contentRequest != null && contentRequest.HasDomain) | |
{ | |
var rootDomainNode = contentRequest.RoutingContext.UmbracoContext.ContentCache.GetById(contentRequest.Domain.RootNodeId); | |
} | |
} | |
} |
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> | |
/// Return the all the data required for filtering and displaying object types. | |
/// </summary> | |
/// <returns></returns> | |
public static IEnumerable<ObjectTypeItem> GetObjectTypeItems() | |
{ | |
//Get the node where all projects and object types are below. | |
var projectOverview = Umbraco.TypedContent(ConfigurationManager.AppSettings["projectOverviewId"]); | |
return |
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
[ImplementPropertyType("slider")] | |
public IEnumerable<HomeSlider> Slider | |
{ | |
get | |
{ | |
var archetypeModel = this.GetPropertyValue<ArchetypeModel>("slider"); | |
return archetypeModel.Select(x => | |
{ | |
return new HomeSlider() | |
{ |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 items = this.GetPropertyValue<IEnumerable<IPublishedContent>>("sliderNestedContent"); | |
//Slider is a generated model based on a document type. | |
//Currently x as Slider returns null. | |
return items.Select(x => x as Slider); |
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
// -------------------------------------------------------------------------------------------------------------------- | |
// <copyright file="ContentExtensions.cs" company="Colours B.V."> | |
// © Colours B.V. 2015 | |
// </copyright> | |
// <summary> | |
// The content extensions. | |
// </summary> | |
// -------------------------------------------------------------------------------------------------------------------- | |
namespace Project.Web.Core.Extensions |
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
import React, { useEffect, useState } from 'react'; | |
import { withSitecoreContext, dataApi, Placeholder } from '@sitecore-jss/sitecore-jss-react'; | |
import { dataFetcher } from './dataFetcher'; | |
import config from './temp/config'; | |
const HybridPlaceholder = ({ | |
name, | |
rendering, | |
sitecoreContext, | |
}) => { |
OlderNewer