Skip to content

Instantly share code, notes, and snippets.

😎
do you sitecore?

Tony Mamedbekov tmamedbekov

😎
do you sitecore?
Block or report user

Report or block tmamedbekov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ProfileComponent.sitecore.js
import { CommonFieldTypes, SitecoreIcon, Manifest } from '@sitecore-jss/sitecore-jss-manifest';
export default function(manifest) {
manifest.addComponent({
name: 'Profile',
icon: SitecoreIcon.DocumentTag,
fields: [
{ name: 'avatar', type: CommonFieldTypes.Image },
{ name: 'name', type: CommonFieldTypes.SingleLineText },
{ name: 'title', type: CommonFieldTypes.SingleLineText },
View index.js
import React from 'react';
import { Text, Image } from '@sitecore-jss/sitecore-jss-react';
const Profile = (props) => (
<div className="col-md-8">
<Image
field={props.fields.avatar}
className="avatar"
/>
<h1><Text field={props.fields.name} /></h1>
View en.yml
yourApplicationName/data/routes/en.yml
View phantomjs_patch.config
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="ContentDelivery or Reporting or Processing">
<settings>
<setting name="ContentTesting.AutomaticContentTesting.Enabled" value="false" />
<setting name="ContentTesting.AlwaysShowTestCandidateNotification" value="false" />
</settings>
<pipelines>
<renderingRuleEvaluated>
<processor type="Sitecore.ContentTesting.Pipelines.RenderingRuleEvaluated.TestingRule, Sitecore.ContentTesting">
View index.html
<section class="row page-header sampleComponent spaced-row" ng-show="data">
<div class="col-xs-12">
<h1 class="header" ng-bind-html="data.Title | asTrusted"></h1>
</div>
<article class="col-xs-7 col-md-8">
<p ng-bind-html="data.Text | asTrusted"></p>
</article>
<figure class="col-xs-5 col-md-4">
<span ng-bind-html="data.Image | asTrusted"></span>
</figure>
View myangular.js
angular.module('sc.sample', [
'ngSanitize'
]).directive('sampleComponent', function () {
return {
scope: {
data: '=sampleComponent'
},
templateUrl: `[template path]/index.html`
};
}).controller('SampleDemoController', ['$scope', function ($scope) {
View AngularController.cs
using System.Web;
using System.Web.Mvc;
using Sitecore.Mvc.Extensions;
namespace sitecore.local.Controllers
{
public static class Angular
{
public static IHtmlString RawJsEncodedString<T>(this HtmlHelper<T> htmlHelper, HtmlString str)
{
View angularLayout.cshtml
@using Sitecore.Mvc
@using Sitecore.Mvc.Extensions
@using sitecore.local.Controllers
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
@tmamedbekov
tmamedbekov / ItemMoving.config
Created Jun 6, 2017
Item Moving configuration that will patch the Sitecore.config
View ItemMoving.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<sitecore>
<scheduling>
<!--Custom Code that will do item moving-->
<agent type="sitecore.local.CustomCode.ItemMoving" method="Execute" interval="00:00:59"/>
</scheduling>
</sitecore>
</configuration>
@tmamedbekov
tmamedbekov / itemMoving.cs
Created Jun 6, 2017
Custom Code for Moving Item from one directory to another
View itemMoving.cs
using Sitecore.Configuration;
using Sitecore.Data.Items;
using Sitecore.Data;
using Sitecore.Data.Fields;
namespace sitecore.local.CustomCode
{
public class ItemMoving
{
private readonly Database _sourceDatabase = Factory.GetDatabase("master");
You can’t perform that action at this time.