Skip to content

Instantly share code, notes, and snippets.

@thomasclausen
thomasclausen / language.html
Created February 19, 2014 11:08
Language selector - Dynamicweb
<nav class="language">
<ul class="clearfix">
<!--@LoopStart(Languages)-->
<li><a href="/Default.aspx?ID=<!--@FirstPageID-->" hreflang="<[email protected](0, 2)-->" class="flags-<[email protected](3).ToLower()--><!--@If Defined(IsCurrent)--> current<!--@EndIf-->"><[email protected](3).ToLower()--></a></li>
<!--@LoopEnd(Languages)-->
</ul>
</nav>
@thomasclausen
thomasclausen / body.html
Last active August 29, 2015 13:56
Mobile, tablet and desktop attributes and template class - Dynamicweb
<body data-is-mobile="<!--@Global:Device.IsMobile-->" data-is-tablet="<!--@Global:Device.IsTablet-->" data-is-desktop="<!--@Global:Device.IsDesktop-->" class="page-template-<!--@Global:Pageview.LayoutTemplate.Replace('.html', '').Replace('.cshtml', '')-->">
@thomasclausen
thomasclausen / ItemType_Carousel.xml
Last active August 29, 2015 13:58
Item for a carousel paragraph - Dynamicweb
@thomasclausen
thomasclausen / ItemType_Tabs.xml
Last active August 29, 2015 13:58
Item for a tabs paragraph - Dynamicweb
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<items>
<item category="" name="Faner" systemName="Tabs" description="" icon="/Admin/Images/Ribbon/Icons/Small/index.png" largeIcon="/Admin/Images/Ribbon/Icons/index.png" includeInUrlIndex="False">
<fields>
<field name="Tabs" systemName="Tabs" description="" type="System.Collections.Generic.IEnumerable`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib">
<editor type="Dynamicweb.Content.Items.Editors.ItemListEditor, Dynamicweb">
<editorConfuguration><Parameters><Parameter addin="Dynamicweb.Content.Items.Editors.ItemListEditor" name="Item type" value="Tabs_Content" /></Parameters></editorConfuguration>
</editor>
<options sourceType="Static">
<Static>
@thomasclausen
thomasclausen / ItemType_News.xml
Created April 4, 2014 08:41
Item for news - Dynamicweb
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<items>
<item category="" name="Nyhed" systemName="News" description="" icon="/Admin/Images/Ribbon/Icons/Small/text_rich_colored.png" largeIcon="/Admin/Images/Ribbon/Icons/text_rich_colored.png" includeInUrlIndex="True">
<fields>
<field name="Overskrift" systemName="Heading" description="" type="System.String, mscorlib">
<editor type="Dynamicweb.Content.Items.Editors.TextEditor, Dynamicweb">
<editorConfuguration />
</editor>
<validators>
<validator type="Dynamicweb.Content.Items.Editors.RequiredValidator, Dynamicweb" errorMessage="" />
@thomasclausen
thomasclausen / ItemType_Video.xml
Created April 30, 2014 08:46
Item for videos - Dynamicweb
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<items>
<item category="" name="Video" systemName="Video" description="" icon="" largeIcon="" includeInUrlIndex="False">
<fields>
<field name="Video ID" systemName="VideoID" description="" type="System.String, mscorlib">
<editor type="Dynamicweb.Content.Items.Editors.InputHTML5Editor, Dynamicweb">
<editorConfuguration><Parameters><Parameter addin="Dynamicweb.Content.Items.Editors.InputHTML5Editor" name="Type" value="text" /><Parameter addin="Dynamicweb.Content.Items.Editors.InputHTML5Editor" name="Pattern" value="" /><Parameter addin="Dynamicweb.Content.Items.Editors.InputHTML5Editor" name="Placeholder" value="" /><Parameter addin="Dynamicweb.Content.Items.Editors.InputHTML5Editor" name="Size" value="" /><Parameter addin="Dynamicweb.Content.Items.Editors.InputHTML5Editor" name="Min" value="" /><Parameter addin="Dynamicweb.Content.Items.Editors.InputHTML5Editor" name="Max" value="" /><Parameter addin="Dynamicweb.Content.Item
@thomasclausen
thomasclausen / classie.js
Last active August 29, 2015 14:10
HTML5 form validation "fallback"
/*!
* classie v1.0.1
* class helper functions
* from bonzo https://github.com/ded/bonzo
* MIT license
*
* classie.has( elem, 'my-class' ) -> true/false
* classie.add( elem, 'my-new-class' )
* classie.remove( elem, 'my-unwanted-class' )
* classie.toggle( elem, 'my-class' )
@thomasclausen
thomasclausen / lightbox.html
Last active August 29, 2015 14:10
Homegrown simple lightbox
<p><a href="image.jpg" class="js-lightbox">LIGHTBOX (IMAGE)</a></p>
<p><a href="//youtu.be/0kBjb1yfabI" class="js-lightbox">LIGHTBOX (YOUTUBE)</a><br />
<a href="//www.youtube.com/watch?v=0kBjb1yfabI" class="js-lightbox">LIGHTBOX (YOUTUBE)</a></p>
<p><a href="//vimeo.com/channels/staffpicks/112500813" class="js-lightbox">LIGHTBOX (VIMEO)</a></p>
@thomasclausen
thomasclausen / createDocumentOutline.js
Last active August 29, 2015 14:17
Create document outline (bookmarklet)
var headings = document.body.querySelectorAll('h1, h2, h3, h4, h5, h6'),
headingOutline = document.createElement('ol'),
styleOutput = '';
if (headings.length !== 0) {
for (var a = 0; a < headings.length; a++) {
if (headings[a - 1] === undefined && headings[a].tagName.substring(1) > 1) {
for (var b = 1; b < headings[a].tagName.substring(1); b++) {
var headingElement = document.createElement('li'),
headingElementSpan = document.createElement('span'),
javascript:(function(){window.open(window.location.origin + '/admin', '_blank')})();