Skip to content

Instantly share code, notes, and snippets.

@komainu85
komainu85 / ICustomRepository.cs
Created March 22, 2015 16:41
Sitecore Entity Service Paged
public interface ICustomRepository<T> : Sitecore.Services.Core.IRepository<T> where T : IEntityIdentity
{
List<Entity> GetAll(int pageSize, int page);
}
@komainu85
komainu85 / EntityRespository.cs
Created March 22, 2015 16:45
Sitecore Entity Service Paged Repository
public class EntityRespository : ICustomRepository<Entity>
{
public IQueryable<Entity> GetAll()
{
throw new NotImplementedException();
}
public Entity FindById(string id)
{
throw new NotImplementedException();
@komainu85
komainu85 / EntityController.cs
Created March 22, 2015 16:47
Sitecore Entity Service Pages Service Controller
[ServicesController]
public class EntityController : EntityService<Entity>
{
private ICustomRepository<Entity> _customRepository;
public EntityController(ICustomRepository<Entity> repository)
: base(repository)
{
_customRepository = repository;
}
@komainu85
komainu85 / Standard Sitecore List Component Tile
Created March 30, 2015 12:53
Standard Sitecore List Component Tile
<div class="sc-tile-default" >
<div class="sc-tile-default-property">
<span class="sc-tile-property-title" >Database: </span><span class="sc-tile-property-value" data-bind="text: $database"></span>
</div>
<div class="sc-tile-default-property">
<span class="sc-tile-property-title" >DisplayName: </span><span class="sc-tile-property-value" data-bind="text: $displayName"></span>
</div>
<div class="sc-tile-default-property">
<span class="sc-tile-property-title" >Path: </span><span class="sc-tile-property-value" data-bind="text: $path, attr: {title: $path}"></span>
</div>
@komainu85
komainu85 / wallpaper.cs
Created March 30, 2015 12:58
Wallpaper Model
namespace MikeRobbins.WallpaperManager.Models
{
public class Wallpaper : Sitecore.Services.Core.Model.EntityIdentity
{
public string itemId { get; set; }
public string Path { get; set; }
public string Name { get; set; }
}
}
@komainu85
komainu85 / Image Knockout Databinding
Created March 30, 2015 17:59
Image Knockout Databinding
<img width="112" data-bind="attr: {src: Path}" />
@komainu85
komainu85 / Inner text Knockout data-binding
Created March 30, 2015 18:24
Inner text Knockout data-binding
<span data-bind="text: Name"></span>
@komainu85
komainu85 / SPEAK List Control Custom Tile
Created March 30, 2015 18:29
SPEAK List Control Custom Tile
<div class="sc-tile-default" data-bind="attr: {id: Id}">
<div style="min-height: 98px;">
<img width="112" data-bind="attr: {src: Path}" />
</div>
<div class="sc-iconList-item-title">
<span data-bind="text: Name"></span>
</div>
</div>
@komainu85
komainu85 / Searcher.cs
Last active August 29, 2015 14:19
Sitecore ContentSearch Lanaguage Culture
namespace MikeRobbins.Business
{
public class Searcher : ISearcher
{
public List<SiteSearchResultItem> GetItemsByBaseTemplate(string indexName, ID baseTemplateId, string[] keywords)
{
using (var context = Sitecore.ContentSearch.ContentSearchManager.GetIndex(indexName).CreateSearchContext())
{
var culture = Sitecore.Context.Language.CultureInfo;
<analyzer type="Sitecore.ContentSearch.LuceneProvider.Analyzers.PerExecutionContextAnalyzer, Sitecore.ContentSearch.LuceneProvider">
<param desc="defaultAnalyzer" type="Sitecore.ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer, Sitecore.ContentSearch.LuceneProvider">
<param desc="defaultAnalyzer" type="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net">
<!-- To run a different version of Lucene, change the version.
Usage: If a problem is found in the latest version to Lucene and a previous version is more stable, you can change the version
attribute and run in the version that is stable e.g. Lucene_29 or Lucene_23.
-->
<param hint="version">Lucene_30</param>
</param>
</param>