Display stock state & price DynamicWeb

Following markup and template tags will display stock state and price for an item in DynamicWeb eCommerce 8

<!--@If Defined(Ecom:Product:Stock.Text)-->
<div class="<!--@Ecom:Product:Stock.ID-->" id="productstock">
<h2><!--@Translate(stocheader, "Stock status")--></h2>
<span class="stocktext" style="display:block"><!--@Ecom:Product:Stock.Text-->: <img src="<!--@Ecom:Product:Stock.Image.Clean--/>" alt="" /></span>
<span class="stockdeliverytext">Delivery time: <!--@Ecom:Product:Stock.DeliveryText--> <!--@Ecom:Product:Stock.DeliveryUnit--></span>
<span style="display:block"><!--@Ecom:Product.Price--></span>
</div>
<!--@EndIf(Ecom:Product:Stock.Text)-->

Mount ISO in Windows 8

Windows 8 have build in virtual drive, which enables you to mount iso files.
Normally you can just right click an iso and chose “Mount“, but if this option isn’t present, double click the iso / right click, open with, and chose “Windows Explorer”, which will mount the iso as a drive. You might have to do this 2 times, as first time can happen to throw an error.

Mount ISO in Windows 8

Windows 8 shortcuts

Knowing the most basic shortcuts in Windows 8 makes navigation a lot faster and work more easy.
I have made a collection of shortcuts I use the most – a more detailed and full list can be found on the image below.

Hitting Windows button, switches between Metro style screen and the classic Windows desktop. This can be obtained by moving the mouse cursor to bottom left corner and clicking as well.

If you hit Windows button and start typing, you will open the Search charm, and can then search between installed applications, files and settings .

Win + C Open charms (you can also move the mouse cursor to bottom right corner)
Win + D Show desktop
Win + E Open Windows Explorer
Win + F Search files charm
Win + I Settings charm
Win + Q Search charm
Win + R Run
Win + X Open power user menu

To turn of your computer, you have several options:

1. When standing in classic desktop mode, you can simply hit ALT + F4
2. Hit Win + I, which opens the Settings charm. Click Power and Shut Down.
3. Hit Win + C or slide the mouse  cursor to the bottom right corner, click Settings and then Power and Shut Down.

Full list of Windows 8 shortcuts:

Windows 8 shortcuts

W3C Validator: #call_to_action h4{padding:0px 5px;}

I was checking this site with W3C Validator, and got the error:

<strong>Element style not allowed as child of element div in this context. (Suppressing further errors from this subtree.)</strong>

<style type="text/css">#call_to_action h4{padding:0px 5px;}</style>

<div><dl><dt>Contexts in which element <a href="http://dev.w3.org/html5/spec-author-view/#the-style-element">style</a> may be used:</dt><dd>If the <a href="http://dev.w3.org/html5/spec-author-view/#attr-style-scoped">scoped</a> attribute is absent: where <a href="http://dev.w3.org/html5/spec-author-view/#metadata-content">metadata content</a> is expected.</dd><dd>If the <a href="http://dev.w3.org/html5/spec-author-view/#attr-style-scoped">scoped</a> attribute is absent: in a <a href="http://dev.w3.org/html5/spec-author-view/#the-noscript-element">noscript</a> element that is a child of a <a href="http://dev.w3.org/html5/spec-author-view/#the-head-element">head</a> element.</dd><dd>If the <a href="http://dev.w3.org/html5/spec-author-view/#attr-style-scoped">scoped</a> attribute is present: where <a href="http://dev.w3.org/html5/spec-author-view/#flow-content">flow content</a> is expected, but before any other <a href="http://dev.w3.org/html5/spec-author-view/#flow-content">flow content</a> other than <a href="http://dev.w3.org/html5/spec-author-view/#inter-element-whitespace">inter-element whitespace</a>, and not as the child of an element whose content model is <a href="http://dev.w3.org/html5/spec-author-view/#transparent">transparent</a>.</dd><dt>Content model for element <a href="http://dev.w3.org/html5/spec-author-view/#the-div-element">div</a>:</dt><dd><a href="http://dev.w3.org/html5/spec-author-view/#flow-content">Flow content</a>.</dd></dl></div>

After some digging around, I found out it was the plugin Social Essentials which was causing these errors. A WordPress pluging for sharing your posts to social networks.

For now I’ll be using Simple Social Sharing, till I might find a better alternative.

Visual Studio 2012, Web Essentials 2012, Net 4.5

The 15th of August Microsoft released Visual Studio 2012 and .NET Framework 4.5 to Web.
Several usefull tools and blog posts followed the hours after.
Download: Visual Studio 2012

Mads Kristensen from Microsoft also released a new version of Web Essentials for Visual Studio 2012. The essenstials extension let you perform common task faster and easier. Pretty essential indeed ;)
Download: Web Essentials 2012

While your at it, remember to grab the newest versions of JetBrains ReSharper for Visual Studio, which makes your life a lot easier as a programmer. Once you tried it, you wonder how you could ever live without. Resharping, code elimination, autocomplete, etc, etc…
Download: ReSharper

Schott Hanselman wrote a blogpost and posted several videos on getting up to speed with .NET 4.5 and Visual Studio 2012: Visual Studio 2012 and .NET Framework 4.5 is RELEASED – Here’s 5 minute videos to get you up to speed quick

Jason Zander, Vice President for the Visual Studio team wrote a “Top 12 of Visual Studio 2012

Visual Studio 2012

Add href to all img jQuery

This simple function will add a href to all images on your page and link them to the img src

$('img').each(function ()
{
    var currImg = $(this);  // cache the selector
    currImg.wrap("<a href='" + currImg.attr("src") + "'></a>");
});

It is also possible to only append href to images with a certain class or in a specific div

    $(".myDiv").find('img').each(function () {
        var currImg = $(this); // cache the selector
        currImg.wrap("<a href='" + currImg.attr("src") + "'></a>");
    });

I have used this option to load images with Lightbox2, using the following code

    $(".myDiv").find('img').each(function () {
        var currImg = $(this); // cache the selector
        currImg.wrap("<a href='" + currImg.attr("src") + "'" + "rel='lightbox'" + "title='Caption...'" + "></a>");
    });

Umbraco 3.0.6 to 4.7.1.1 Upgrade

As I have been struggling with upgrading Umbraco 3.0.6 to 4.7.1.1, I thought I would post a small guide for later use, as I most likely have to go through this again.

Please be aware of this guide is for Umbraco 3.0.6 to 4.7.1.1
Upgrading from prior version of Umbraco, vil require you to upgrade to 3.0.6 first.

1. Take backup of your binaries and database!

2. Upgrade from Umbraco 3 > 4.0.4.2 (upgrading from 3 > 4.7 will make the upgrade stall at 20%)
2.1 Download the binaries and extract them to your Umbraco dir
Note: Umbraco 3 and 4.0.4.2 must both run on ASP.NET 2.0 Classic Application Pools

Umbraco 4.0.4.2: http://umbraco.codeplex.com/releases/view/37337
Umbraco 4.7.1.1: http://umbraco.codeplex.com/releases/view/73692

3. Upgrade from Umbraco 4.0.4.2 > 4.7.1.1
3.1 Download the binaries and extract them to your Umbraco dir
3.2 Run your site and a automated upgrade will start – looking just like the normal Umbraco 4.7 installation
Note: Change Application Pool to ASP.NET 4.0 (Integrated pipeline mode) before you run the upgrade

Umbraco install screen

4. XML schemes
Umbraco 4.5 and forth uses a new XML shcema, therefor you have to make sure it’s enabled
in /config/umbracoSettings.config

<!-- to enable new content schema, this needs to be false -->
false

Love the double meaning aye? ;)

5. Passwords
Version prior to Umbraco 4 used clear typed passwords – therefor your old passwords are stored as clear type in the database.
Umbraco 4.7 however uses hashed passwords, but because your passwords are stored in clear type, we have to enable the feature
in web.config.

Set both the “UmbracoMembershipProvider” and “UsersMembershipProvider” to passwordFormat=”Clear” like shown below

6. If you are using XSLT, which you probably are, since Razor first got introduced in Umbraco 4.7, you have to manually
go through your scrips and and change them to fit the new schema. There are some scripts out there which can help you, but
they don’t work 100%.
I have been lucky though, to get _some_ of my XSLT convertet to the new schema with “XsltUpdater for Umbraco
Use at your own risk – if you dare. ;)

Reference about the new chages:
http://our.umbraco.org/wiki/reference/xslt/45-xml-schema

7. Republishing
Now log in to your Umbraco installation http://site.com/umbraco/

Go through all your nodes and republish them (don’t just hit republish entire site, or it won’t work and you probably will break something)
This step is important to make all your XSLT work again with the new schema.
Please note that you most likely will loose some relations and sort orders in tabs, but not more than it’s pretty fast to fix.

/Paul Sørensen

The create dialog for “Media” does not match anything defined in the “~/umbraco/config/create/UI.xml”

After upgrading an Umbraco installation from 3.0 to 4.7.1.1, I got the error:

"The create dialog for "Media" does not match anything defined in the "~/umbraco/config/create/UI.xml" while trying to upload images.

To fix this, simply open UI.xml located in: /umbraco/config/create/
Search for:

<nodetype alias="media"></nodetype>

and rename it to uppercase:

<nodetype alias="Media"></nodetype>

Restart IIS and problem should be solved.

The create dialog for Media...

Download Windows 8 & Windows Server 8

After I have been running Windows 8 Developer Preview since the launch, and Windows 8 Consumer Preview got released last week, I decided to download and test it as well. I have been very positive with Windows 8 Developer Preview as working station OS for normal web development and every day use. As a developer OS, Windows 8 ain’t ready yet, as it conflicts with eg. Windows Phone SDK and Silverlight SDK, to mention the ones I have tried.

Either way, I thought it would share some download links.

Windows 8 Consumer Preview ISO 32/64bit
Product key: DNJXJ-7XBW8-2378T-X22TX-BKG7J

Windows Server 8 Beta 64bit

Windows 8 official logo