Setting EPiServer 6r2 PageTypeBuilder Default Property Values
This is how you set default values for PTB 2.0 poperties in Episerver 6r2:
In the [PageTypeProperty] method attribute, add:
DefaultValue = 0, DefaultValueType=EPiServer.DataAbstraction.DefaultValueType.Value,
E.g.:
[PageTypeProperty(SortOrder = 100, Tab = typeof(RelatedContentTab), EditCaption = "Related content sort index", Type = typeof(PropertyNumber), DefaultValue = 20, DefaultValueType = DefaultValueType.Value)] int RelatedContentSortIndex { get; set; }
The DefaultValue could be any type of object. The EPiServer.DataAbstraction.DefaultValueType.Value is just an enum that indicates that a default value should be used.
However this has to be done before the page is created for the first time, else it wont have any effect until next time a page is created.
See: http://pagetypebuilder.codeplex.com/workitem/7831
Another approach, if suitable, could be to just add the “Required” in the first place to avoid missing values from the editors.
E.g.:
[PageTypeProperty(SortOrder = 100, Tab = typeof(RelatedContentTab), EditCaption = "Related content sort index", Type = typeof(PropertyNumber), Required = true)] int RelatedContentSortIndex { get; set; }
In EPiServer 7 this approach can be used:
See below heading “Default property values” here:
http://www.david-tec.com/2012/06/Comparing-PageTypeBuilder-and-EPiServer-7-Preview-typed-pages-part-3-of-3/
javascript – How do I accomplish an if/else in mustache.js? – Stack Overflow
This is how you do if/else in Mustache (perfectly supported):
{{#repo}} I have repos! {{/repo}} {{^repo}} No repos :( {{/repo}}
via javascript – How do I accomplish an if/else in mustache.js? – Stack Overflow.
jquery – Fade in each element – one after another – Stack Overflow
Let’s say you have an array of span elements:
$("span").each(function(index) { $(this).delay(400*index).fadeIn(300); });
(quick note: I think you need jQuery 1.4 or higher to use the .delay method)
This would basically wait a set amount of time and fade each element in. This works because you’re multiplying the time to wait by the index of the element. The delays would look something like this when iterating through the array:
Delay 400*0 (no delay, just fadeIn, which is what we want for the very first element)
Delay 400*1
Delay 400*2
Delay 400*3
This makes a nice “one after the other” fadeIn effect. It could also be used with slideDown. Hope this helps!
via jquery – Fade in each element – one after another – Stack Overflow.
Creating unit test method stubs with “Create Unit Tests” – Microsoft Application Lifecycle Management – Site Home – MSDN Blogs
Create Bookmarklets – The Right Way – Tuts+ Code Tutorial
“Bookmarkets can be defined as mini applications masquerading as tiny snippets of JavaScript awesomeness that reside in your browser and provide additional functionalities to a web page.
Today, we’re going to look into creating bookmarklets from scratch and on the way, some best practices to follow.”
via Create Bookmarklets – The Right Way – Tuts+ Code Tutorial.
Tell Chrome Developer Tools to use a dark theme – howchoo
Tell Chrome Developer Tools to use a dark theme – howchoo.
Themes for Chrome Developer Tools:
http://devthemez.com/themes/chrome-developer-tools?sort=downloads
Creating simple Dynamic Content in EPiServer CMS 6 R2
What is dynamic content in EPiServer?
Dynamic content is essentially custom pieces of content that an EPiServer editor can insert through the TinyMCE editor. Together with the option of specifyingdynamic content settings (ie properties for the dynamic content being inserted) we can create an easy way for editors to include virtually any type of content.
Ted & Gustaf:
Creating simple Dynamic Content in EPiServer CMS 6 R2 – Ted & Gustaf.
EPiServer offical doc:
http://world.episerver.com/documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-6-R2/Dynamic-Content/
Create a visual TinyMCE Plugin – SoftResource
This post will guide you how to extend the TinyMCE editor EPiServer with a custom button and dialog.
Create a visual TinyMCE Plugin – SoftResource.
EPiServer offical doc:
http://world.episerver.com/documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-6-R2/TinyMCE-Developers-Guide/
Dynamic content in xhtml editor (another type of solution)
http://blog.wsoft.se/2015/03/03/creating-simple-dynamic-content-in-episerver-cms-6-r2-ted-gustaf/
EPiServer CMS 7+ Translate lang xml files UI tool
A great idea. Its described here:
CMS 7 xml resources tool.
For CMS 7.5:
http://world.episerver.com/Blogs/Per-Nergard/Dates/2014/3/CMS-75-XML-resources-tool/
Github for latest version:
https://github.com/PNergard/CMS75XmlResourcesTool