iCreative Website

Jeg skaber smukke og funktionelle websites - Skal vi snakke?

Display Random Paragraph from a Paragraph Setup

Dynamicweb

No Comments


Share this post

Need to show a random paragraph from a paragraph setup in Dynamicweb ?

You can easily do this with a little html, xslt and javascript.

Here’s the code snippet i made for this.

 

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
	<xsl:output method="html" omit-xml-declaration="yes" indent="yes"  encoding="utf-8" />
	<xsl:param name="html-content-type" />
	<xsl:template match="/Template">
	<div style="clear:both; height: 1px; overflow: hidden; margin: -1px 0 0 0;">&#160;</div>
	<section id="mycols" style="width:220px; float: left;">
		<article id="para1" style="display:none">
			<xsl:value-of select="TemplateParagraph1" disable-output-escaping="yes" />
		</article>
 
		<article id="para2" style="display:none;">
			<xsl:value-of select="TemplateParagraph2" disable-output-escaping="yes" />
		</article>
 
		<article id="para3" style="display:none;">
			<xsl:value-of select="TemplateParagraph3" disable-output-escaping="yes" />
		</article>
 
		<article id="para4" style="display:none;">
			<xsl:value-of select="TemplateParagraph4" disable-output-escaping="yes" />
		</article>
 
		<script type="text/javascript">
		//Show random div with Javascript
		antal = 5;
		var randomnumber=Math.floor(Math.random()*antal);
		if(randomnumber == "0") {
			randomnumber = 1;
		}
 
		document.getElementById("para"+randomnumber+"").style.display = 'block';
		</script>
		<!-- Output XML -->
		<!--<textarea><xsl:copy-of select="." /></textarea>-->
	</div>
 
	</xsl:template>
</xsl:stylesheet>

Read more

New Dynamicweb Template Tags

Dynamicweb

No Comments


Share this post

For those who doensn’t know XSLT, or for those who doensn’t use it in Dynamicweb CMS, and cant benefit from the XSLT advances… Dont worry…. Dynamicweb has made a whole new bunch of template tags you can use

Examples with Areas:

<!--@If(DwAreaID>0)-->Area=1 <!--@If(DwAreaID=1)-->Area=1.1<!--@EndIf--> and end...<br /><!--@EndIf-->
<!--@If(DwAreaID>0)-->Area=1 <!--@If(DwAreaID=1)-->Area=1.1<!--@EndIf--> and end...<br /><!--@EndIf-->
<!--@If(DwAreaID=1)-->Area ID is <!--@DwAreaID--><br /><!--@EndIf-->
<!--@If(DwAreaName=Dynamicweb)-->Areaname=Dynamicweb<!--@If(DwAreaID>0)-->Area=1 <!--@If(DwAreaID=1)-->Area=1.1<!--@EndIf--> and end...<!--@EndIf--><br /><!--@EndIf-->
<!--@If(DwAreaID>1)-->Area ID is more than 1<br /><!--@EndIf-->
<!--@If(DwAreaID<>5)-->Area ID is different from 5<br />!--@EndIf--
<!--@If(DwAreaID2<>1)-->DwAreaID2 does not exists as tag<br /><!--@EndIf-->
<!--@If(CharSet=UTF-8)-->UTF8<br /><!--@EndIf-->
<!--@If(DwAreaName<>'')-->Areaname<>''<br /><!--@EndIf-->
<!--@If(DwAreaName<contains>'shop')-->contains shop <br /><!--@EndIf-->
<!--@If(DwAreaName<startswith>'Dyna')-->startswith Dyna <br /><!--@EndIf-->

Examples with products:

<!--@LoopStart(Products)-->
 
  <!--@If(Ecom:Product.Price.Price>100)-->- <!--@Ecom:Product.Name--> (Price: <!--@Ecom:Product.Price.Price-->) [Product.price.price>100]<br /><!--@EndIf-->
  <!--@If(Ecom:Product.Name=Desert)-->- <!--@Ecom:Product.Name--> [Product.Name=Desert]<br /><!--@EndIf-->
  <!--@If(Ecom:Product.LongDescription<contains>'mums')-->- <!--@Ecom:Product.Name--> [LondDescription contains 'mums']<br /><!--@EndIf-->
  <!--@If(Ecom:Product.Name<endswith>'s')-->- <!--@Ecom:Product.Name--> [Product.Name endswith 's']<br /><!--@EndIf-->
  <!--@If(Ecom:Product.MetaTitle<>'')-->- <!--@Ecom:Product.Name--> [MetaTitle with content]<br /><!--@EndIf-->
  <!--@If(Ecom:Product.Rating>3)-->- <!--@Ecom:Product.Name--> (<!--@Ecom:Product.Rating--> stars) [Product.rating > 3]<br /><!--@EndIf-->
  <!--@If(Ecom:Product.Name<startswith>'hy')-->- <!--@Ecom:Product.Name--> [Product.Name starts with 'hy']<br /><!--@EndIf-->
  <!--@If(Ecom:Product.Rating>3)--><!--@If(Ecom:Product.Price.Price>100)-->- <!--@Ecom:Product.Name--> (Price: <!--@Ecom:Product.Price.Price--> + <!--@Ecom:Product.Rating--> stars)) [Product.price.price>100 + Product.rating > 3]<br /><!--@EndIf--><!--@EndIf-->
  <!--@If(Ecom:Product.Price.Price=7000)-->- <!--@Ecom:Product.Name--> (Price: <!--@Ecom:Product.Price.Price-->) [Product.price.price=7000]<br /><!--@EndIf-->
  <!--@If(Ecom:Product.Price.Price!=7000)--><!--@If(Ecom:Product.Price.Price>300)-->- <!--@Ecom:Product.Name--> (Price: <!--@Ecom:Product.Price.Price-->) [Product.price.price>300 + Product.price.price!=7000]<br /><!--@EndIf--><!--@EndIf-->
 
<!--@LoopEnd(Products)-->

Read much more on this on Dynamicweb Engage

Read more

Get the XML from Dynamicweb

Dynamicweb

2 Comments


Share this post

If you are using XSLT templates in Dynamicweb, then you need to know the XML output from Dynamicweb.

That can be done in a couple of different ways….

One way to get the XML is to write after the URL:
&SaveTemplateXML=true or http://www.i-creative.dk/mynews?id=122&SaveTemplateXML=true

This will create a XML file in the backend of Dynamicweb with the XML structure – However I find this way to a bit time consuming – But fear not, there is a much more easier way to get the XML output.

In your XSLT snippet, simply create a textarea where your output the XML:

<textarea>
	<xsl:copy-of select="." />
</textarea>

Be sure that you create the textarea in the correct xslt template.

Ex. If it is a Dynamicweb paragraph xslt template, you would do it like this:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" omit-xml-declaration="yes" indent="yes" encoding="utf-8"/>
	<xsl:param name="html-content-type"/>
	<xsl:template match="/Template">
		<textarea>
			<xsl:copy-of select="." />
		</textarea>
		<xsl:value-of select="ParagraphText" disable-output-escaping="yes"/>
		<xsl:value-of select="ParagraphModule" disable-output-escaping="yes"/>
	</xsl:template>
</xsl:stylesheet>

Read more

Dynamicweb Online Tech Review

Dynamicweb

No Comments


Share this post

For those who didn’t made the Tech Review for the Dynamicweb 7.2 release can now sign up for an online tech review…

The Tech Review will give you an insight into the new features of the 7.2 eCommerce Powerpack soon to be released.
In addition, you will have the opportunity to give feedback and influence the future development.

The agenda for the Online Tech Review is:

  • New search options
  • Rating and review
  • Product comparison
  • SEO (Search Engine Optimization)
  • Order flows
  • Track & Trace
  • 30+ minor features

To sign up for the tech review, then go to:

http://engage.dynamicweb-cms.com/Default.aspx?ID=425

Read more

Dynamicweb design implementation in 10 minutes

Dynamicweb

No Comments


Share this post

In this video, Dynamicweb shows you how to implement a design in 10 minutes in the system – Very nifty :)

Dynamicweb design implementation in 10 minutes from Dynamicweb Software on Vimeo.

Read more

Videoes on Dynamicweb…

Dynamicweb

No Comments


Share this post

Here are all Dynamicweb Software‘s videos on Vimeo.

The list includes some interesting examples like:

You can watch the whole list right here: http://vimeo.com/user3310723/videos

Read more

Create a nice xslt menu in Dynamicweb (HTML5)

Dynamicweb

No Comments


Share this post

Here is a XSLT menu i’ve created for my navigation in Dynamicweb.

It can be used just about anywhere – Topnavigation, leftnavigation, breadcrumb and so on.

The outer element <ul> always has the class “nav” – And the <li> elements has the class “first” if it has position=1 and class “last” if the position is last.

The A elements can have the classes inpath or selected….

Here is an example of what it outputs.

<nav id="main-nav">
<ul class="navigation">
	<li class="first">
		<a href="" title="">
			<span>Linktext</span>
		</a>
	</li>
	<li>
		<a href="" title="" class="inpath">
			<span>Linktext</span>
		</a>
		<ul>
			<li class="first last">
				<a href="" title="" class="inpath selected">
					<span>Linktext</span>
				</a>
			</li>
		</ul>
	</li>
	<li class="last">
		<a href="" title="">
			<span>Linktext</span>
		</a>
	</li>
</ul>
</nav>

Now for the XSLT code that creates this:

Please pay a small for fee for continue reading the post, and getting access to the source files - Thx.... Only 5 DKK

Click to signin to see the content if you already bought it.

Read more

Dynamicweb online API Documentation

Dynamicweb

No Comments


Share this post

Look no further :)

Find API Documentation on Dynamicweb here:

Dynamicweb API Documentation: http://engage.dynamicweb-cms.com/api/dynamicweb/

Dynamicweb ECom Documentation: http://engage.dynamicweb-cms.com/api/ecommerce/

Read more