This file contains hidden or 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 static class IContentExtensions { | |
public static bool HasChildren(this IContent content) | |
{ | |
return Umbraco.Core.Composing.Current.Services.ContentService.HasChildren(content.Id); | |
} | |
public static int CountChildren(this IContent content, string childDocType = null) | |
{ | |
return Umbraco.Core.Composing.Current.Services.ContentService.CountChildren(content.Id, childDocType); | |
} |
This file contains hidden or 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
@{ | |
Layout = null; | |
} | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html data-editor-version="2" class="sg-campaigns" xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"> | |
<!--[if !mso]><!--> |
This file contains hidden or 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (var driver = new FirefoxDriver()) | |
{ | |
driver.Url = "https://www.youtube.com/results?search_query=m%E1%BB%B9+t%C3%A2m"; | |
var wait = new WebDriverWait(driver, timeout: TimeSpan.FromSeconds(30)) | |
{ | |
PollingInterval = TimeSpan.FromSeconds(5), |
This file contains hidden or 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 contentTypeService = ApplicationContext.Current.Services.ContentTypeService; | |
const string contentTypeAlias = "spacerSection"; | |
var section = contentTypeService.GetContentType(contentTypeAlias); | |
if(section == null) | |
{ | |
var abstractSection = contentTypeService.GetContentType("abstractSectionTheme"); | |
section = new ContentType(-1) | |
{ | |
Key = Guid.NewGuid(), |
This file contains hidden or 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"?> | |
<settings> | |
<!-- | |
umbracoSettings.config configuration documentation can be found here: | |
https://our.umbraco.com/documentation/using-umbraco/config-files/umbracoSettings/ | |
Many of the optional settings are not explicitly listed here | |
but can be found in the online documentation. | |
--> |
This file contains hidden or 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 umbraco_db_name | |
Drop table schema.cmsPreviewXml | |
Drop table schema.cmsContentVersion | |
Drop table schema.cmsContentXml | |
Drop table schema.cmsDocument | |
Drop table schema.cmsMedia | |
Drop table schema.cmsMember2MemberGroup | |
Drop table schema.cmsMember | |
Drop table schema.cmsTagRelationship |
This file contains hidden or 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
(function () { | |
"use strict"; | |
function customLayoutController($scope, listViewHelper, $location, mediaHelper, mediaTypeHelper, assetsService) { | |
/* | |
* $scope.items = [ | |
* { | |
* properties: [ | |
* { |
This file contains hidden or 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 Mover { | |
public void PerformMovePublishedContent(IContent content, int parentId, int userId = 0) | |
{ | |
if(content.ParentId == parentId) | |
{ | |
return; | |
} | |
var contentService = ApplicationContext.Current.Services.ContentService; | |
if (parentId == Constants.System.Root) | |
{ |
This file contains hidden or 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
--Delete old nodes (keep recent 15 days) from Trash, Umbraco 7.7.6 | |
--deletes in Document | |
--at this point all associated media files are deleted | |
delete from umbracoDomains where id in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from cmsDocument where nodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
--deletes in Content | |
delete from cmsPropertyData where contentNodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); | |
delete from cmsPreviewXml where nodeId in (select id from umbracoNode where trashed = 1 and createDate < DATEADD(d, -15, getdate())); |