<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <atom:link href="http://nicolaipedersen.com/" rel="self" type="application/rss+xml" />
    <title>nicolaipedersen.com - Dynamicweb Ahead</title>
    <link>http://nicolaipedersen.com</link>
    <description><![CDATA[]]></description>
    <pubDate>Wed, 29 Jun 2016 09:30:00 GMT</pubDate>
    <lastBuildDate>Wed, 29 Jun 2016 09:30:00 GMT</lastBuildDate>
    <generator>Dynamicweb Blog Engine</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>10</ttl>
    <image>
      <url>http://nicolaipedersen.com/Files/Templates/Designs/Blog/images/dwaheadColor.png</url>
      <title>nicolaipedersen.com - Dynamicweb Ahead</title>
      <link>http://nicolaipedersen.com</link>
    </image>
    <item>
      <title>Dynamicweb 8 - Files and Images folder</title>
      <link>http://nicolaipedersen.com/blog/2012/1/dynamicweb-8-files-and-images-folder.aspx</link>
      <description><![CDATA[<h2 class="h2">All files in Dynamicweb are located in subfolders under /Files which is the root of the file manager. 2 of the subfolders are named &ldquo;Billeder&rdquo; and &ldquo;Filer&rdquo; &ndash; Danish names from back in last millennium.</h2>
<br />
<h3 class="h3">The change</h3>
Since Dynamicweb is an international product, having Danish names in the file structure is unwanted. In templates etc. these names are included in paths to images and files.<br />
<br />
With Dynamicweb 8 the names for these 2 folders change to the English equivalents, Images and Files. <br />
<br />
This is only on new Dynamicweb 8 installations &ndash; Dynamicweb 7 installations upgrading to Dynamicweb 8 will keep the names.<br />
<br />
<h3 class="h3">What does that mean?</h3>
If you have sites made in Dynamicweb 7 you would have image references like this:<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: xml">
&lt;img src=&rdquo;/Files/Billeder/MyProduct.jpg&rdquo; /&gt;</pre>
</div>
</div>
In websites installed as Dynamicweb 8 the same reference will look like this:<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: xml">
&lt;img src=&rdquo;/Files/Images/MyProduct.jpg&rdquo; /&gt;</pre>
</div>
</div>
Dynamicweb 8 installations have another set of templates where all references to the /Files/Billeder folder has been updated.<br />
<br />
<h3 class="h3">Can the names be changed on upgraded solutions?</h3>
Yes &ndash; but it can be a hassle. Usually you would have some hardcoded paths in your templates, in the editor ect. so changing would require some work.<br />
<br />
Use some search and replace on the templates, and use the database search &amp; replace tool in Dynamicweb Management Center to locate content in the editor with hard coded references.<br />
<br />
To update what folder Dynamicweb will use in its code base, an update of /Files/GlobalSettings.aspx is required &ndash; add these 2 keys to it, and Dynamicweb will switch to using these folder names.<br />
<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: xml">
&lt;System&gt;
&lt;Filesystem&gt;
&lt;FilesFolderName&gt;Files&lt;/FilesFolderName&gt;
&lt;ImagesFolderName&gt;Images&lt;/ImagesFolderName&gt;
&lt;/Filesystem&gt;
&lt;/System&gt;
</pre>
</div>
</div>
All from here.]]></description>
      <author>np@dynamicweb.dk (Nicolai Høeg Pedersen)</author>
      <pubDate>Wed, 18 Jan 2012 06:39:30 GMT</pubDate>
      <guid isPermaLink="true">http://nicolaipedersen.com/blog/2012/1/dynamicweb-8-files-and-images-folder.aspx</guid>
    </item>
    <item>
      <title>Dynamicweb 8 - Changes to template extenders</title>
      <link>http://nicolaipedersen.com/blog/2012/1/dynamicweb-8-changes-to-template-extenders.aspx</link>
      <description><![CDATA[<h2 class="h2">Dynamicweb 7 offers a number of template extenders that allows 3rd party developers to extend the rendering of elements in Dynamicweb. They are changed in Dynamicweb 8.</h2>
<br />
<h3 class="h3">Background</h3>
In Dynamicweb 7 the template extenders works in 2 different ways making the API in this point inconsistent. With Dynamicweb 8 we&rsquo;ve aligned the way template extenders work and also implemented template extender base. This will improve the usability on the API.<br />
<br />
I.e. the product template extender looks like this:<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
public class ProductTemplateExtender1 : ProductTemplateExtender
{
public override void ExtendTemplate(Dynamicweb.Templatev2.Template template)
{
template.SetTag(&quot;myTag&quot;, &quot;myValue&quot;);
}
}
</pre>
</div>
</div>
And the page template extender looks like this:<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
public class PageTemplateExtender1 : PageTemplateExtender
{
public override void RenderTemplate(Dynamicweb.Templatev2.Template template)
{
template.SetTag(&quot;myTag&quot;, &quot;myValue&quot;);
}

}
</pre>
</div>
</div>
So to different names on the member that needs to be overridden.<br />
<br />
Also some of the template extenders have more than one parameter on their EextendTemplate or RenderTemplate method.<br />
<br />
<h3 class="h3">The change</h3>
In Dynamicweb 8 all template extenders are based on the same Template Extender base, Dynamicweb.Extensibility.TemplateExtender &ndash; so all template extenders in Dynamicweb now derives from this base class.<br />
<br />
This means that all template extenders follow the same way of implementation. They all have a RenderTemplate method with one parameter, a template instance.<br />
If there are need for other context information in the template extender, i.e. the product being extended, it will be a property on the template extender itself and not a parameter in the extended method.<br />
<br />
So taking a look at the page template extender when used in Dynamicweb 8:<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
public class PageTemplateExtender2 : PageTemplateExtender
{
public override void ExtendTemplate(Dynamicweb.Rendering.Template template)
{
template.SetTag(&quot;myTitle&quot;, this.PageView.Meta.Title());
}

}
</pre>
</div>
</div>
<h3 class="h3">New extenders</h3>
3 new template extenders have also been added to Dynamicweb.&nbsp;
<ul>
    <li>User management
    <ul>
        <li>User template extender</li>
        <li>Group template extender</li>
    </ul>
    </li>
    <li>eCommerce
    <ul>
        <li>Group template extender</li>
    </ul>
    </li>
</ul>
<h3 class="h3">Upgrading existing template extenders</h3>
If you have code already using template extenders upgrading is fairly easy. References are the same, so in the cases where the overridden member has been renamed, your implementation of that method needs a new name &ndash; and you are up and running again. <br />
<br />
So just a quick update of a method name and a recompilation and you template extender is up and running again.<br />]]></description>
      <author>np@dynamicweb.dk (Nicolai Høeg Pedersen)</author>
      <pubDate>Tue, 17 Jan 2012 07:10:46 GMT</pubDate>
      <guid isPermaLink="true">http://nicolaipedersen.com/blog/2012/1/dynamicweb-8-changes-to-template-extenders.aspx</guid>
    </item>
    <item>
      <title>Dynamicweb 8 - Dynamicweb.Ecom7 namespace</title>
      <link>http://nicolaipedersen.com/blog/2012/1/dynamicweb-8-dynamicweb-ecom7-namespace.aspx</link>
      <description><![CDATA[<h2 class="h2">Dynamicweb 8 does not have the Dynamicweb.Ecom7 namespace as we know it from Dynamicweb 7. Here&rsquo;s why and were it has been moved.</h2>
<h3 class="h3"><br />
Background</h3>
With Dynamicweb 7.1 we introduced a new cart (Cartv2) and checkout procedure for the eCommerce platform. These features were placed in Dynamicweb.Ecom7 namespace. With Dynamicweb 8 all the things in this namespace are moved to Dynamicweb.eCommerce namespace.<br />
<br />
The update to this change is extremely easy &ndash; simply change your namespace reference from Dynamicweb.Ecom7 to Dynamicweb.eCommerce:<br />
<br />
<b>Dynamicweb 7:</b><br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
using Dynamicweb.Ecom7.Cart;</pre>
</div>
</div>
<br />
<b>Dynamicweb 8:</b><br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
using Dynamicweb.eCommerce.Cart;</pre>
</div>
</div>
If you have i.e. a CheckoutHandler this is the only change needed to be done before a recompile can be done.<br />
<br />
<h3 class="h3">Notifications</h3>
In Dynamicweb 7 the Ecom7 namespace contains all the notifications for the cart &ndash; they are found in Dynamicweb.Ecom7.Cart.Notifications.<br />
<br />
In Dynamicweb 8 these notifications are moved from the namespace to the Dynamicweb.Notifications namespace and can now be found in this location: Dynamicweb.Notifications.eCommerce.Cart<br />
<br />
Below how notification subscribers looks like in Dynamicweb 7 and Dynamicweb 8<br />
<br />
<b>Dynamicweb 7</b><br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
[Dynamicweb.Extensibility.Subscribe(Dynamicweb.Ecom7.Cart.Notifications.BeforeRenderingEmptyCart)]
public class EcomCartCreatedObserver1 : Dynamicweb.Extensibility.NotificationSubscriber
{
public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
{
Dynamicweb.Ecom7.Cart.Notifications.BeforeRenderingEmptyCartArgs cArgs = (Dynamicweb.Ecom7.Cart.Notifications.BeforeRenderingEmptyCartArgs)args;

}
}</pre>
</div>
</div>
<b>Dynamicweb 8</b><br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
[Dynamicweb.Extensibility.Subscribe(Dynamicweb.Notifications.eCommerce.Cart.BeforeRenderingEmptyCart)]
public class EcomCartBeforeRenderingEmptyCartObserver1 : Dynamicweb.Extensibility.NotificationSubscriber
{
public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
{
Dynamicweb.Notifications.eCommerce.Cart.BeforeRenderingEmptyCartArgs beforeRenderingEmptyCartArgs = args as Dynamicweb.Notifications.eCommerce.Cart.BeforeRenderingEmptyCartArgs;

}
}</pre>
</div>
</div>
<h3 class="h3">Why this change?</h3>
This change was made because having an Ecom7 namespace was a little confusing. So this was done for usability reasons. The notifications were moved so they are located in the same structure as other notifications.<br />
<br />]]></description>
      <author>np@dynamicweb.dk (Nicolai Høeg Pedersen)</author>
      <pubDate>Mon, 16 Jan 2012 08:47:14 GMT</pubDate>
      <guid isPermaLink="true">http://nicolaipedersen.com/blog/2012/1/dynamicweb-8-dynamicweb-ecom7-namespace.aspx</guid>
    </item>
    <item>
      <title>Dynamicweb 8 - Default.aspx, Global.asax and web.config changes</title>
      <link>http://nicolaipedersen.com/blog/2012/1/dynamicweb-8-default-aspx--global-asax-and-web-config-changes.aspx</link>
      <description><![CDATA[<h2 class="h2">With Dynamicweb 8 we&rsquo;ve made some changes to how Default.aspx and Globals.asax needs to be handled in custom solutions. For solutions running a standard Dynamicweb, no changes are required.</h2>
<h3 class="h3"><br />
Background</h3>
When making Dynamicweb custom solutions there are 3 files in the frontend implementation which is copied to the custom solution and therefore does not inherit all code from the version of Dynamicweb API. When upgrading custom solutions from Dynamicweb 7 to Dynamicweb 8, these files need to be upgraded due to a number of minor but important changes.<br />
<br />
<h3 class="h3">Global.asax</h3>
In Dynamicweb 7 custom solutions need a reference to Dynamicweb.Admin to get hold of references to the events fired in Global.asax. That gives code like this:<br />
<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
Dynamicweb.Admin.Global GlobalAsax = new Dynamicweb.Admin.Global();
public void Application_Start(object sender, EventArgs e)
{
// Fires when the application is started
GlobalAsax.Application_Start(sender, e);
}</pre>
</div>
</div>
<br />
With Dynamicweb 8 we&rsquo;ve introduced a new GlobalAsaxHandler that is placed in Dynamicweb.Frontend namespace in Dynamicweb.dll and this handler now takes care of all Dynamicweb related events in Global.asax. That is things like URL-rewriting, security, application start-up etc.<br />
This simplifies custom solutions a little bit since they now do not need a reference to Dynamicweb.Admin.dll.<br />
This makes Global.asax look like this:<br />
<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: vbnet">
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Dynamicweb.Frontend.GlobalAsaxHandler.Application_Start(sender, e)
End Sub</pre>
</div>
</div>
If you have a custom solution being upgraded from Dynamicweb 7, removing the reference to Dynamicweb.Admin.dll and changing the Global.asax is recommended but not strictly needed &ndash; it will still work, but give compile warnings.
<h3 class="h3"><br />
Default.aspx</h3>
We&rsquo;ve also simplified how Default.aspx codebehind should be implemented. In Dynamicweb 7 there is a need for some required code in the code behind for the pageview to execute correctly. We see bugs and unwanted behavior from time to time due to missing elements in these implementations in custom solutions.<br />
This is how the implementation looks like in Dynamicweb 7:<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
protected void Page_Load(object sender, EventArgs e)
{
//Set a timer to monitor performance
long StartTime = DateTime.Now.Ticks;
//Initiate the pageview object that handles a Page view in Dynamicweb
Dynamicweb.Frontend.PageView Pageview = new Dynamicweb.Frontend.PageView();

//Load data, templates and settings in the pageview object
Pageview.Load();

Dynamicweb.Frontend.PageviewControl pvCtrl = new Dynamicweb.Frontend.PageviewControl();
Output.Controls.Add(pvCtrl);
pvCtrl.Pageview = Pageview;
pvCtrl.ParseControls();

//Output.Text = Pageview.Output();

//Collect the last performance counter and print if requested
Pageview.Execution.Add(&quot;After output&quot;);
string strDebug = Base.ChkString(Base.Request(&quot;Debug&quot;));
if (strDebug == &quot;True&quot;)
{
Status.Text = Server.HtmlEncode(&quot;&lt;!-- Exe time: &quot; + Convert.ToString((DateTime.Now.Ticks - StartTime) / 10000000 + &quot; &quot; + Pageview.StatusText.ToString() + &quot; --&gt;&quot;) + Pageview.Execution.getExecutionTable() + Pageview.OutputPages());
}
else
{
Status.Text = &quot;&lt;!-- Exe time: &quot; + Convert.ToString((DateTime.Now.Ticks - StartTime) / 10000000) + &quot; &quot; + Pageview.StatusText.ToString() + &quot; --&gt;&quot;;
}
}</pre>
</div>
</div>
<br />
And the new implementation looks like this:<br />
<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: vbnet">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Output.Controls.Add(New Dynamicweb.Frontend.PageviewControl())
End Sub
</pre>
</div>
</div>
Much more simple &ndash; minimizing the possibility of making mistakes in the implementation.
<h3 class="h3"><br />
Web.config</h3>
The most important change to these 3 files is in web.config. A lot of things have changed and added to web.config because of the upgrade to .NET 4, new features, compatibility issues, better IIS 7 support etc.<br />
<br />
So if you have a custom solution being upgraded from Dynamicweb 7 to Dynamicweb 8 it is required that you take a new copy of web.config and move settings to this new copy if you have any. Dynamicweb 8 will simply not work correctly if web.config is not updated.<br />
<br />
<h3 class="h3">How to upgrade.</h3>
You can get hold of these 3 files along with the custom solutions project in the Visual Studio Templates for Dynamicweb 8. Create a new custom project, and copy these 3 files from the new project to the solution you are upgrading, and move code to the new files &ndash; if you have any. Most custom solutions do not have customizations to these files.<br />]]></description>
      <author>np@dynamicweb.dk (Nicolai Høeg Pedersen)</author>
      <pubDate>Sun, 15 Jan 2012 18:02:28 GMT</pubDate>
      <guid isPermaLink="true">http://nicolaipedersen.com/blog/2012/1/dynamicweb-8-default-aspx--global-asax-and-web-config-changes.aspx</guid>
    </item>
    <item>
      <title>Dynamicweb 8 - Out now!</title>
      <link>http://nicolaipedersen.com/blog/2011/12/dynamicweb-8-out-now.aspx</link>
      <description><![CDATA[<h2 class="h2">Glad to announce that Dynamicweb 8 is now available for Download to build and go live with new Dynamicweb implementations.</h2>
<br />
Yesterday QA finished the test work and had the last items resolved, and this morning we hit the build button to build the final Dynamicweb 8.<br />
<br />
So it is now available for download at the developer site: <br />
<a href="http://developer.dynamicweb-cms.com/downloads/dynamicweb-8.aspx">http://developer.dynamicweb-cms.com/downloads/dynamicweb-8.aspx</a><br />
<br />
In the download section you will find Dynamicweb 8, updated installation guides, new Visual Studio templates supporting both Dynamicweb 7 and Dynamicweb 8 (For VS2010+2011). <br />
<br />
You will also find DefaultEmptyData for Dynamicweb 8. <br />
<br />
Be aware that new solutions using the Dynamicweb 8 DefaultEmptyData have some minor differences in the UI than solutions upgraded from 7 to 8.<br />
I.e. new solutions will only have UI for Designs &amp; Layout and not the old Stylesheet system, the module list is more lean, and options and checkboxes around the system can no longer be found because they have to do with things related to old things.<br />
<br />
<h3 class="h3">Whats next?</h3>
Eventhough the build is now out there, we are not all done. We are in full progress with writing and updating documentation - it will be published during the next weeks.<br />
<br />
New Dynamicweb solutions will be based on Dynamicweb 8 - the general roll-out to upgrade Dynamicweb 7 solutions has not yet been planned but will not begin until beginning of February. If you want to upgrade&nbsp;a solution it is not a problem. Simply contact the service desk.<br />
<br />
At the <a href="http://partnerkonference.dynamicweb.dk">partner conference</a> you can hear more about what we will develop on next. But it will be eCommerce, OMC and some other interesting stuff.<br />
<br />
Hope you will enjoy the new shiny, speedy and delicious Dynamicweb 8 release. You hopefully have a lot&nbsp;ideas for improvements, some things you do not like&nbsp;and feedback. Please write here or go the <a href="http://developer.dynamicweb-cms.com/forum/beta-feature-testing.aspx">Feedback forums</a>.]]></description>
      <author>np@dynamicweb.dk (Nicolai Høeg Pedersen)</author>
      <pubDate>Thu, 15 Dec 2011 14:42:47 GMT</pubDate>
      <guid isPermaLink="true">http://nicolaipedersen.com/blog/2011/12/dynamicweb-8-out-now.aspx</guid>
    </item>
    <item>
      <title>Dynamicweb 8 - mobile websites</title>
      <link>http://nicolaipedersen.com/blog/2011/12/dynamicweb-8-mobile-websites.aspx</link>
      <description><![CDATA[<h2 class="h2">With Dynamicweb 8 we introduce some new features that make the implementation of mobile websites a lot easier.</h2>
<br />
<h3 class="h3">What it does</h3>
The new mobile feature detects the kind of device the visitor is using for browsing the website. The new features make it possible to apply different device specific layouts so mobile devices has a mobile friendly layout and normal pages has a normal website layout.<br />
<br />
It is also possible to hide specific pages from i.e. mobile devices in the navigation &ndash; so only a desktop or tablet will be able to see that navigation item.<br />
<br />
<h3 class="h3">How it works</h3>
Dynamicweb detects 2 things &ndash; the device type and the platform.<br />
<br />
<b>Possible Device types</b>
<ul>
    <li>Mobile</li>
    <li>Tablet</li>
    <li>Desktop</li>
</ul>
<b>Possible Platform types</b>
<ul>
    <li>Ios</li>
    <li>Android</li>
    <li>Windows</li>
    <li>Osx</li>
    <li>Ux</li>
    <li>Other</li>
</ul>
So, if a device is detected as mobile running the IOS platform, it would be an iPhone. If it is detected Mobile running the Android platform it would be an Android based phone.<br />
<br />
<h3 class="h3">How to use it</h3>
In the layout section on websites properties it is possible to apply different layouts for different types of devices.<br />
<br />
<i><b>Website properties &ndash; selecting device layout.</b></i><br />
<img alt="" src="/Files/Billeder/NPBlog/Mobile/WebsitePropertiesSettingLayoutTemplates.JPG" /><br />
<br />
Then based on the device type a different design implementation can be used. In this way it is possible to have i.e. a mobile and touch friendly design and navigation for mobile devices and a normal design for desktop devices.<br />
<br />
In the example above there is one layout template chosen for the main layout &ndash; desktops, and another one (SmartPhone) layout chosen for use in mobile devices.<br />
<br />
That gives different renderings and navigation on the two types of devices:<br />
<br />
<i><b>Desktop layout<br />
</b></i><img alt="" src="/Files/Billeder/NPBlog/Mobile/DesktopLayout.JPG" /><br />
<br />
<i><b>Smart phone layout</b></i><br />
<img alt="" src="/Files/Billeder/NPBlog/Mobile/PhoneLayout.JPG" /><br />
<br />
<br />
This is how to&nbsp;share the same content using different layouts.<br />
<br />
But you might not need exactly the same content in the mobile website as in the full website. It is possible to specify which pages should be included in the navigation based on the device type.<br />
<br />
<i><b>Page properties, hide for device types</b></i><br />
<img alt="" src="/Files/Billeder/NPBlog/Mobile/PageProperties.JPG" /><br />
<br />
So, by checking the checkboxes it is possible to hide navigation items from the navigation based on the device type.<br />
<br />
In the example above, the module navigation item is hidden for mobile devices.<br />
<br />
<i><b>Navigation items hidden from mobile device - Desktop navigation. Notice the Module navigation item</b></i><br />
<img alt="" src="/Files/Billeder/NPBlog/Mobile/DesktopNavigation.JPG" /><br />
<br />
<strong><em>Navigation items hidden from mobile device - Desktop navigation. Notice the Module navigation item is no longer there<br />
</em></strong><img alt="" src="/Files/Billeder/NPBlog/Mobile/SmartphoneNavigation.JPG" /><br />
<br />
<h3 class="h3">Module templates and device specific rendering</h3>
The above features make it possible to implement different layouts for different devices. Rendering inside module templates or paragraph templates may also differ based on the device &ndash; i.e. you might want to scale image sizes on mobile devices.<br />
<br />
This can be done by using a set of new global template tags available.<br />
&nbsp;
<ul>
    <li>Global:Device.IsMobile</li>
    <li>Global:Device.IsTablet</li>
    <li>Global:Device.IsDesktop</li>
    <li>Global:Device.IsBot</li>
    <li>Global:Device.IsAndroid</li>
    <li>Global:Device.IsIOS</li>
    <li>Global:Device.IsWindows</li>
    <li>Global:Device.IsOther</li>
    <li>Global:Device.IsIPhone</li>
    <li>Global:Device.IsAndroidPhone</li>
    <li>Global:Device.IsWindowsPhone</li>
    <li>Global:Device.IsIPad</li>
    <li>Global:Device.IsAndroidTablet</li>
    <li>Global:Device.IsWindowsTablet</li>
    <li>Then it is possible to do like this in i.e. a paragraph template:</li>
</ul>
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: xml">
&lt;!--@If(Global:Device.IsMobile=true)--&gt;
&lt;img src=&quot;Image.jpg&quot;&gt;
&lt;!--@EndIf--&gt;

&lt;!--@If(Global:Device.IsMobile&lt;&gt;true)--&gt;
&lt;img src=&quot;Image.jpg&quot;&gt;
&lt;!--@EndIf--&gt;</pre>
</div>
</div>
This feature makes it possible to target the implementation specifically for the device type.<br />
<br />
<h3 class="h3">Notes</h3>
<ul>
    <li>The feature can also be found on 7.2.6</li>
    <li>Changing the layout is only available for websites using Designs &amp; Layouts</li>
    <li>Hiding navigation items for specific devices also works for the old design implementation</li>
</ul>
<h3 class="h3">A note about the detection</h3>
Device and platform type is detected based on the UserAgent string and some other mobile device properties, and is as such not very accurate for &ldquo;old&rdquo; mobile device types. They are detected in most cases, but not all.<br />
<br />
This feature is meant to address the &ldquo;new generation&rdquo; of smart phones. Android, iPhone and Windows Phone 7 &ndash; maybe BlackBerry and Opera Mobile if requested.<br />
<br />
Android Tablets will in most cases be detected as Android Smartphones. This is because of the UserAgent that most Android Tablets use.<br />
<br />
<h3 class="h3">Extensibility points</h3>
If a more precise detection is required on the solution, there is a notification that can be subscribed to &ndash; in that notification subscriber the detection can be overruled by making an implementation of i.e. WURFL or other mobile detection engines.<br />
<br />
<i><b>C# notification subscriber</b></i><br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
[Extensibility.Subscribe(Dynamicweb.Notifications.Standard.Page.DeviceDetected)]
	public class DeviceDetectedObserver : Dynamicweb.Extensibility.NotificationSubscriber
	{

		public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
		{
			if (args == null)
			{
				return;
			}

			var loadedArgs = (Dynamicweb.Notifications.Standard.Page.DeviceDetectedArgs)args;

			if (loadedArgs.Device == Dynamicweb.Frontend.PageView.DeviceType.Desktop)
			{
				//No mobile device detected by Dynamicweb.

				var myOwnDeviceDetectionFoundSomething = false;

				//Utilize other detection mechanism, i.e. WURFL. I.e. Dynamicweb detection of Android tablets is not 100%.
				//myOwnDeviceDetectionFoundSomething = WurflDetection()

				//If we found something else, set the information
				if (myOwnDeviceDetectionFoundSomething)
				{
					loadedArgs.Device = Dynamicweb.Frontend.PageView.DeviceType.Tablet;
					loadedArgs.Platform = Dynamicweb.Frontend.PageView.PlatformType.Android;
				}

			}
		}

	}</pre>
</div>
</div>
<br />
<br />
<i><b>VB.NET notification subscriber</b></i><br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: vbnet">
&lt;Extensibility.Subscribe(Dynamicweb.Notifications.Standard.Page.DeviceDetected)&gt; _
	Public Class DeviceDetectedObserver
		Inherits Dynamicweb.Extensibility.NotificationSubscriber

		Public Overrides Sub OnNotify(ByVal notification As String, ByVal args As Dynamicweb.Extensibility.NotificationArgs)

			If args Is Nothing Then
				Return
			End If

			Dim loadedArgs As Dynamicweb.Notifications.Standard.Page.DeviceDetectedArgs = DirectCast(args, Dynamicweb.Notifications.Standard.Page.DeviceDetectedArgs)

			If loadedArgs.Device = Frontend.PageView.DeviceType.Desktop Then
				'No mobile device detected by Dynamicweb.

				Dim myOwnDeviceDetectionFoundSomething As Boolean

				'Utilize other detection mechanism, i.e. WURFL. I.e. Dynamicweb detection of Android tablets is not 100%.
				'myOwnDeviceDetectionFoundSomething = WurflDetection()

				'If we found something else, set the information
				If myOwnDeviceDetectionFoundSomething Then
					loadedArgs.Device = Frontend.PageView.DeviceType.Tablet
					loadedArgs.Platform = Frontend.PageView.PlatformType.Android
				End If

			End If
		End Sub

	End Class</pre>
</div>
</div>
<br />
<br />
<h3 class="h3">What else?</h3>
Go use it!<br />
<br />
If you need anything else, do not hesitate to contact me.<br />]]></description>
      <author>np@dynamicweb.dk (Nicolai Høeg Pedersen)</author>
      <pubDate>Thu, 08 Dec 2011 14:52:39 GMT</pubDate>
      <guid isPermaLink="true">http://nicolaipedersen.com/blog/2011/12/dynamicweb-8-mobile-websites.aspx</guid>
    </item>
    <item>
      <title>Dynamicweb 8 - the new login dialog</title>
      <link>http://nicolaipedersen.com/blog/2011/12/dynamicweb-8-the-new-login-dialog.aspx</link>
      <description><![CDATA[<h2 class="h2">First impressions are important. The login dialog for Dynamicweb has been changed with Dynamicweb 8. Not only the look, but also changed behavior and features.</h2>
<br />
<h3 class="h3">The changes</h3>
First of all the design has been upgraded quite a bit to be more welcoming and up-to-date with larger and clearer text, inputs and buttons.<br />
<br />
Furthermore the 3 remember user name, password and auto login options have been merged into a single &ldquo;Remember me&rdquo; option as you would know from all other services supplying logins. This new option does the same as setting the 3 checkboxes in Dynamicweb 7.<br />
<br />
<b>The login dialog of Dynamicweb 7</b><br />
<img alt="Dynamicweb 7 login" src="/Files/Billeder/NPBlog/Login/Dynamicweb7Login.png" /><br />
<br />
<strong>The login dialog of Dynamicweb 8<br />
</strong><img alt="The login dialog of Dynamicweb 8" src="/Files/Billeder/NPBlog/Login/Dynamicweb8Login.png" /><br />
<br />
<h3 class="h3">User interface language</h3>
The user interface of Dynamicweb comes in 13 different languages. In Dynamicweb 7 there is an add-on module so editors can choose their preferred language. If you did not have this module, all editors used the same language as set by the system administrator.<br />
<br />
With Dynamicweb 8 this feature is now included in all editions. It has also changed in how it works. When an editor first accesses the /Admin, Dynamicweb detects the preferred language from the browser (Accept-languages) and set the language accordingly.<br />
<br />
Language can be changed from the &ldquo;Change language&rdquo; link in the login dialog.<br />
<br />
<b>Change language dialog</b><br />
<img alt="" src="/Files/Billeder/NPBlog/Login/Dynamicweb8LoginChangeLanguage.png" /><br />
<br />
<h3 class="h3">License and partner information</h3>
Another new feature is the possibility for the partners to personalize the login. You can now show the customer logo and partner contact information directly in the login screen.<br />
<br />
In Management Center, System, Solution settings, there are a set of new settings for this.<br />
<br />
<b>Login screen settings<br />
</b><img alt="" src="/Files/Billeder/NPBlog/Login/Dynamicweb8LoginSettings.JPG" /><br />
<br />
Filling out this information will expand the login dialog with the information<br />
<br />
<b>Dynamicweb 8 login dialog with information</b><br />
<img alt="" src="/Files/Billeder/NPBlog/Login/Dynamicweb8LoginInformation.png" /><br />
<h3 class="h3"><br />
What else?</h3>
There are a couple of other important changes on the code side, primarily some security enhancements and changes to the login procedure.<br />
<br />
Hope you&rsquo;ll enjoy the new login. Feel free to comment!<br />]]></description>
      <author>np@dynamicweb.dk (Nicolai Høeg Pedersen)</author>
      <pubDate>Thu, 08 Dec 2011 09:48:29 GMT</pubDate>
      <guid isPermaLink="true">http://nicolaipedersen.com/blog/2011/12/dynamicweb-8-the-new-login-dialog.aspx</guid>
    </item>
    <item>
      <title>I’m the best in the world!</title>
      <link>http://nicolaipedersen.com/blog/2011/11/im-the-best-in-the-world.aspx</link>
      <description><![CDATA[<h2 class="h2">I write flawless software &ndash; I&rsquo;ve never ever made code with a bug. So I think of myself as God&rsquo;s gift to developers&hellip;<b><br />
</b></h2>
<br />
<h3 class="h3"><b>Damn I&rsquo;m good.</b></h3>
<p>Well, just needed to catch your attention....<br />
<br />
As much as I want the above to be true I've finally faced that is not true. So I need your help.<br />
<br />
The beta of Dynamicweb 8 is out. The reason for releasing a beta is to have you download and test the new version, and we already have some test upgrades out there. Thanks for doing that.<br />
<br />
Our 4 QA-Engineers have done a lot of testing. Part of the test procedure is test upgrading a lot of websites by copying them, make the upgrade and go through the entire site to see if it still behaves as it should. <br />
<br />
But to be able to release the most stable final release, we need to test the software in real life &ndash; that is going live with websites based on DW8. This site, the developer site and the template reference is already live on DW8. All our Dynamicweb.xxx is live in just a second&hellip;<br />
<br />
But we need more sites.<br />
<br />
This is where you come in.</p>
<h3 class="h3">Win an iPad!</h3>
<p>&hellip; or any other gadget thingie of your choice (within reasonable limits - no batmobile!)<br />
<br />
We need websites to go live on Dynamicweb 8 Beta in order to test how Dynamicweb behaves in the real world.<br />
<br />
If you upgrade any of your customer&rsquo;s websites to Dynamicweb 8 Beta you can win a cool device.</p>
<h3 class="h3">How to participate</h3>
<p>It is simple to participate &ndash; simply upgrade a solution to Dynamicweb 8 and let it go live. Here are the steps.</p>
<ul>
    <li>Contact service desk and have them make a copy the solution and update it to DW8</li>
    <li>Test the copy with DW8</li>
    <li>Let it go live</li>
    <li>Send me an e-mail with the link</li>
</ul>
<p>So pretty simple&hellip;<br />
<br />
The first 10 reported upgrades will attend the draw for the device of your choice. And you are more than welcome to upgrade several solutions &ndash; each solution counts.</p>
<h3 class="h3">Why you should participate</h3>
<p>Apart from the chance to win, you will get special attention. If you find issues we will fix them right away, and you will be able to get things into DW8 if you have any ideas, comments or feedback. <br />
<br />
You also help us release the best possible product. That is partnership&hellip;<br />
<br />
Thanks in advance.</p>]]></description>
      <author>np@dynamicweb.dk (Nicolai Høeg Pedersen)</author>
      <pubDate>Wed, 16 Nov 2011 09:43:11 GMT</pubDate>
      <guid isPermaLink="true">http://nicolaipedersen.com/blog/2011/11/im-the-best-in-the-world.aspx</guid>
    </item>
    <item>
      <title>New EU rules on consumer rights</title>
      <link>http://nicolaipedersen.com/blog/2011/11/new-eu-rules-on-consumer-rights.aspx</link>
      <description><![CDATA[<h2 class="h2">Back in October 2011 EU's Council of Ministers finally approved the final version of the 2008 proposal to strengthen consumer&rsquo;s rights across the countries that are member of the EU union.</h2>
<p>&nbsp;</p>
<h3 class="h3">Background</h3>
As a website owner with an eCommerce solution that sells goods and services online throughout several countries, a lot of challenges are faced. Some of them are VAT, shipping, currencies, different prices &ndash; and not the least different rules in different countries. <br />
<br />
VAT, shipping, currencies, prices and a lot of other stuff is handled by Dynamicweb eCommerce software package, but with the approval of this new legislation, a lot of things get a little easier because the countries within the EU have to adapt to this new set of rules within 2 years.<br />
<br />
Of course the purpose of the new legislation is to protect consumers, not to simplify how eCommerce owners do business. <br />
<br />
<h3 class="h3">The new rules</h3>
Below you will find 10 of the new consumer rights covered by this new directive. It is a copy-paste from the official press release you will find here: <a href="http://europa.eu/rapid/pressReleasesAction.do?reference=MEMO/11/675&amp;type=HTML">http://europa.eu/rapid/pressReleasesAction.do?reference=MEMO/11/675&amp;type=HTML</a> <br />
<br />
<b>1. The proposal will eliminate hidden charges and costs on the Internet<br />
</b>Consumers will be protected against &quot;cost traps&quot; on the Internet. This happens when fraudsters try to trick people into paying for &lsquo;free&rsquo; services, such as horoscopes or recipes. From now on, consumers must explicitly confirm that they understand that they have to pay a price.<br />
<br />
<b>2. Increased price transparency<br />
</b>Traders have to disclose the total cost of the product or service, as well as any extra fees. Online shoppers will not have to pay charges or other costs if they were not properly informed before they place an order.<br />
<br />
<b>3. Banning pre-ticked boxes on websites</b><br />
When shopping online &ndash; for instance buying a plane ticket &ndash; you may be offered additional options during the purchase process, such as travel insurance or car rental. These additional services may be offered through so-called &lsquo;pre-ticked&rsquo; boxes. Consumers are currently often forced to untick those boxes if they do not want these extra services. With the new Directive, pre-ticked boxes will be banned across the European Union.<br />
<br />
<b>4. 14 Days to change your mind on a purchase<br />
</b>The period under which consumers can withdraw from a sales contract is extended to 14 calendar days (compared to seven days legally prescribed by EU law today). This means that consumers can return the goods for whatever reason if they change their minds.<br />
<br />
Extra protection for lack of information: When a seller hasn&rsquo;t clearly informed the customer about the withdrawal right, the return period will be extended to a year.<br />
<br />
Consumers will also be protected and enjoy a right of withdrawal for solicited visits, such as when a trader called beforehand and pressed the consumer to agree to a visit. In addition, a distinction no longer needs to be made between solicited and unsolicited visits; circumvention of the rules will thus be prevented.<br />
<br />
The right of withdrawal is extended to online auctions, such as eBay &ndash; though goods bought in auctions can only be returned when bought from a professional seller.<br />
<br />
The withdrawal period will start from the moment the consumer receives the goods, rather than at the time of conclusion of the contract, which is currently the case. The rules will apply to internet, phone and mail order sales, as well as to sales outside shops, for example on the consumer's doorstep, in the street, at a Tupperware party or during an excursion organized by the trader.<br />
<br />
<b>5. Better refund rights</b><br />
Traders must refund consumers for the product within 14 days of the withdrawal. This includes the costs of delivery. In general, the trader will bear the risk for any damage to goods during transportation, until the consumer takes possession of the goods<br />
<br />
<b>6. Introduction of an EU-wide model withdrawal form</b><br />
Consumers will be provided with a model withdrawal form which they can (but are not obliged to) use if they change their mind and wish to withdraw from a contract concluded at a distance or at the doorstep. This will make it easier and faster to withdraw, wherever you have concluded a contract in the EU.<br />
<br />
<b>7. Eliminating surcharges for the use of credit cards and hotlines</b><br />
Traders will not be able to charge consumers more for paying by credit card (or other means of payment) than what it actually costs the trader to offer such means of payment. Traders who operate telephone hotlines allowing the consumer to contact them in relation to the contract will not be able charge more than the basic telephone rate for the telephone calls.<br />
<br />
<b>8. Clearer information on who pays for returning goods</b><br />
If traders want the consumer to bear the cost of returning goods after they change their mind, they have to clearly inform consumers about that beforehand, otherwise they have to pay for the return themselves. Traders must clearly give at least an estimate of the maximum costs of returning bulky goods bought by internet or mail order, such as a sofa, before the purchase, so consumers can make an informed choice before deciding from whom to buy.<br />
<br />
<b>9. Better consumer protection in relation to digital products<br />
</b>Information on digital content will also have to be clearer, including about its compatibility with hardware and software and the application of any technical protection measures, for example limiting the right for the consumers to make copies of the content.<br />
<br />
Consumers will have a right to withdraw from purchases of digital content, such as music or video downloads, but only up until the moment the actual downloading process begins.<br />
<br />
<b>10. Common rules for businesses will make it easier for them to trade all over Europe.<br />
</b>These include:<br />
<br />
A single set of core rules for distance contracts (sales by phone, post or internet) and off-premises contracts (sales away from a company&rsquo;s premises, such as in the street or the doorstep) in the European Union, creating a level playing field and reducing transaction costs for cross-border traders, especially for sales by internet.<br />
<br />
Standard forms will make life easier for businesses: a form to comply with the information requirements on the right of withdrawal;<br />
<br />
Specific rules will apply to small businesses and craftsmen, such as a plumber. There will be no right of withdrawal for urgent repairs and maintenance work. Member States may also decide to exempt traders who are requested by consumers to carry out repair and maintenance work in their home of a value below &euro;200 from some of the information requirements.<br />
<br />
<h3 class="h3">What does that mean?</h3>
So, that&rsquo;s some of the new rules that are going to be implemented throughout Europe in the next 2 years. Keep them in mind when doing new eCommerce sites. <br />
<br />
We will of course take these things into consideration for future eCommerce releases from us &ndash; and make sure that our software complies with this new rule set.<br />
<br />
Personally I&rsquo;m looking forward to finally being able to trust the price label on plane tickets :-).<br />]]></description>
      <author>np@dynamicweb.dk (Nicolai Høeg Pedersen)</author>
      <pubDate>Wed, 09 Nov 2011 08:46:53 GMT</pubDate>
      <guid isPermaLink="true">http://nicolaipedersen.com/blog/2011/11/new-eu-rules-on-consumer-rights.aspx</guid>
    </item>
    <item>
      <title>Dynamicweb 8 Dynamicweb.Templatev2 and Dynamicweb.Template refactoring</title>
      <link>http://nicolaipedersen.com/blog/2011/11/dynamicweb-8-dynamicweb-templatev2-and-dynamicweb-template-refactoring.aspx</link>
      <description><![CDATA[<h2 class="h2">All rendering of the frontend in Dynamicweb is handled by templates in either HTML or XSLT. This is handled by 2 different objects in Dynamicweb 7.</h2>
<br />
<h3 class="h3">Background</h3>
In Dynamicweb 7 there 2 different options available when writing frontend code that uses the template system. The original template object placed in Dynamicweb.Template that does not support loops, and the &ldquo;new&rdquo; template object Dynamicweb.Templatev2.Template which do support loops.<br />
<br />
The reason for having 2 is compatibility to custom code written prior to the introduction of Dynamicweb.Templatev2 which included a lot of changes to how the object worked.<br />
<br />
In the Dynamicweb 8 API refactoring process both of these objects have been merged into one single object that supports both approaches of using the API<br />
<br />
<h3 class="h3">The change</h3>
The old Dynamicweb.Template object have been totally deleted from the codebase of Dynamicweb 8. That means that all instances internally in Dynamicweb now use the new template engine, known as Dynamicweb.Templatev2 in Dynamicweb 7.<br />
<br />
The namespace name, Dynamicweb.Templatev2, is another issue that we want to deal with. It has been changed to Dynamicweb.Rendering.<br />
<br />
<b>Old naming</b>
<ul>
    <li>Dynamicweb.Template (Deleted)</li>
    <li>Dynamicweb.Templatev2.Template (Namespace renamed)</li>
</ul>
<b>New naming</b>
<ul>
    <li>Dynamicweb.Rendering.Template</li>
</ul>
<h3 class="h3">Compatibility with Dynamicweb.Templatev2.Template</h3>
A LOT of custom functionality depends on Dynamicweb.Templatev2 namespace. To make sure you do not hate us too much, a Dynamicweb.Templatev2 namspace is still in the API, hidden and not available in intellisense, but it is there &ndash; so already referencing/compiled code will continue to run.<br />
<br />
There is only a proxy template object available in Templatev2 namespace, so as long as you have code that only uses the Template object and loops, it is compatible without rewriting. If you reference anything in Template.Tags or any other member of the Dynamicweb.Templatev2 namespace, your code needs upgrading.<br />
<br />
<h3 class="h3">Compatibility with Dynamicweb.Template</h3>
Dynamicweb.Template uses the method &ldquo;SetTemplateValue(object, object)&rdquo; to set template tags. Templatev2.Template uses a number of &ldquo;SetTag&rdquo; methods.<br />
<br />
To keep code upgrades as simple as possible, the Rendering.Template object supports both syntaxes. SetTemplateValue is of course hidden and deprecated, but existing code still using this method will still compile.<br />
<br />
<h3 class="h3">Frontend.Pageview compatibility</h3>
The pageview object has 2 public template instances &ndash; the TemplateMaster and TemplatePage which in Dynamicweb 7 is the old type (Dynamicweb.Template). They of course have been upgraded to Rendering.Template.<br />
<br />
So if you have any code using these properties, it needs reference the Dynamicweb.Rendering namespace to recompile. See the &ldquo;How to upgrade&ldquo; section below.<br />
<br />
<h3 class="h3">Public members</h3>
Another major change is the amount of publically available types and members in the namespace. Previously internal helper types where public like Loop, LoopData etc. After this update only 3 types are available:<br />
<br />
<ul>
    <li>Rendering.Template (The main template object)</li>
    <li>Rendering.Tag (A tag and value)</li>
    <li>Rendering.TagCollection (Collection of tags)</li>
</ul>
If you for some reason have references to some of the now internal types, you need to rewrite code.<br />
<br />
Also some of the methods and properties on the Template object itself is now internal - to keep the object simple to use.<br />
<br />
<h3 class="h3">Dynamicweb.Rendering.Template sample</h3>
Below a sample of how the template object should be used in Dynamicweb 8.<br />
<br />
<b>C#</b><br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: csharp">
using System;
using Dynamicweb.Rendering;

namespace Dynamicweb.Examples.CSharp.Rendering
{
	class TemplateSample
	{
		public string RenderTemplate()
		{
			//Load template from /Files/Templates/MyModuleName/List.html
			var t = new Template(&quot;MyModuleName/List.html&quot;);

			//Render string template tag &lt;!--@WelcomeMessage--&gt;
			t.SetTag(&quot;WelcomeMessage&quot;, &quot;Hello world&quot;);

			//Render boolean template tag &lt;!--@IsTuesDay--&gt;
			t.SetTag(&quot;IsTuesday&quot;, DateTime.Now.DayOfWeek == System.DayOfWeek.Tuesday);

			//Render a datetime template tag &lt;!--@TodaysDate--&gt; - and also the &lt;!--@TodaysDate.*--&gt; date time extensions
			t.SetTag(&quot;TodaysDate&quot;, DateTime.Now);

			//Test if the loaded template contains a specific tag - if not do not do expensive work.
			if (t.TagExists(&quot;MyCalculation&quot;))
			{
				t.SetTag(&quot;MyCalculation&quot;, &quot;CallExpensiveMethod()&quot;);
			}

			//Test if the loop MyItems is present in the loaded template, and if not the code will not be executed.
			if (t.LoopExists(&quot;MyItems&quot;))
			{
				//Create a loop in the template &lt;!--@LoopStart(MyItems)--&gt;&lt;!--@LoopEnd(MyItems)--&gt;
				Template t2 = t.GetLoop(&quot;MyItems&quot;);
				for (var i = 1; i &lt;= 5; i++)
				{
					//Render a counter as a template tag inside the loop &lt;!--@MyCounter--&gt;
					t2.SetTag(&quot;MyCounter&quot;, i);
					//Commit the loop and make ready for the next iteration
					t2.CommitLoop();
				}
			}

			//Render the template html with the parsed template tags and loops.
			return t.Output();
		}

	}
}
</pre>
</div>
</div>
<b>VB.NET</b><br />
<br />
<div class="code-outer">
<div class="code-inner">
<pre class="ruler: true; brush: vbnet">
Imports Dynamicweb.Rendering

Public Class TemplateSample
	Public Function RenderTemplate() As String
		'Load template from /Files/Templates/MyModuleName/List.html
		Dim t As New Template(&quot;MyModuleName/List.html&quot;)

		'Render string template tag &lt;!--@WelcomeMessage--&gt;
		t.SetTag(&quot;WelcomeMessage&quot;, &quot;Hello world&quot;)

		'Render boolean template tag &lt;!--@IsTuesDay--&gt;
		t.SetTag(&quot;IsTuesday&quot;, Now.DayOfWeek = System.DayOfWeek.Tuesday)

		'Render a datetime template tag &lt;!--@TodaysDate--&gt; - and also the &lt;!--@TodaysDate.*--&gt; date time extensions
		t.SetTag(&quot;TodaysDate&quot;, Now)

		'Test if the loaded template contains a specific tag - if not do not do expensive work.
		If t.TagExists(&quot;MyCalculation&quot;) Then
			t.SetTag(&quot;MyCalculation&quot;, &quot;CallExpensiveMethod()&quot;)
		End If

		'Test if the loop MyItems is present in the loaded template, and if not the code will not be executed.
		If t.LoopExists(&quot;MyItems&quot;) Then
			'Create a loop in the template &lt;!--@LoopStart(MyItems)--&gt;&lt;!--@LoopEnd(MyItems)--&gt;
			Dim t2 As Template = t.GetLoop(&quot;MyItems&quot;)
			For i As Integer = 1 To 5
				'Render a counter as a template tag inside the loop &lt;!--@MyCounter--&gt;
				t2.SetTag(&quot;MyCounter&quot;, i)
				'Commit the loop and make ready for the next iteration
				t2.CommitLoop()
			Next
		End If

		'Render the template html with the parsed template tags and loops.
		Return t.Output()
	End Function
End Class</pre>
</div>
</div>
<br />
<br />
<h3 class="h3">How to upgrade</h3>
It is VERY simple.<br />
<br />
<b>Upgrading from Dynamicweb.Template</b><br />
Simply add a &ldquo;using&rdquo; (C#) or &ldquo;Imports&rdquo; (VB.NET) of Dynamicweb.Rendering namespace in the top of your file.<br />
<br />
<b>Upgrading from Dynamicweb.Templatev2.Template</b><br />
All of your code would reference Templatev2.Template. Simply replace Templatev2.Template with Rendering.Template and your code will compile again.<br />
<br />
The Templatev2 namespace is still available and you can still compile using that namespace. But you might as well spend the few minutes it takes to upgrade if you are recompiling anyways. Templatev2 namespace will probably be deleted with Dynamicweb 9.<br />
<br />
<h3 class="h3">What else?</h3>
This update is very extensive because almost any module and frontend feature in Dynamicweb uses the template engine.<br />
<br />
That said the upgrade is very simple as you have seen. <br />
<br />
Personally, I&rsquo;m REALLY glad to get rid of Dynamicweb.Templatev2 namespace &ndash; because of the name.]]></description>
      <author>np@dynamicweb.dk (Nicolai Høeg Pedersen)</author>
      <pubDate>Tue, 08 Nov 2011 13:15:00 GMT</pubDate>
      <guid isPermaLink="true">http://nicolaipedersen.com/blog/2011/11/dynamicweb-8-dynamicweb-templatev2-and-dynamicweb-template-refactoring.aspx</guid>
    </item>
  </channel>
</rss>