iCreative Website

Jeg skaber smukke og funktionelle websites - Skal vi snakke?

Paging with a Document List

Synkron VIA

No Comments


Share this post

Synkron VIA’s module Document List doesn’t by default contains Paging, which can result in a long list of items which isn’t pretty or user friendly.

I’ve seen alot of websites running on Synkron VIA, where this issue haven’t been taking into consideration – Personally i think it’s a flaw that this function isn’t supported by the standard snippet – So I created an XSLT snippet to solve this issue.

If you’ve got any questions regarding the code, or any ideas how to make it better, please leave a comment or email me :)

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

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

Read more

Learn how to make an A-Ã… Navigation in Synkron VIA

Synkron VIA

No Comments


Share this post

Have you ever had the need to list all of your pages in an A-Ã… overview, sorted by a letter, and then in alphabetically order ?

Example:

A:

A page

Animal

Axure

B:

Beautifull

Bold

C:

Creative

Etc….

In this little blogpost I’ll show you how to do this.

First of all, we need to login to our Backend – When logged in, you start by creating a new Module Template – Call this A-Ã… Navigation:

After you have created the Module Template, then create the Module that uses the Module template you’ve just created.

Give the module a name:

Now we need to configure our module – Open the module, and choose “Settings” – Create the Settings as showed:

Click Ok – You’ve done configuring the Navigation module.

Next up is that we need to create our XSLT snippet – To do this, go to Developer -> XSLT Snippets and create a new snippet, of the type: Navigation

Great – Hope you are still with me? :)

Now that we have created our snippet, we need to add it to our Page Template’s HTML Channel.

Go to Developer -> Page Templates – Open the HTML Channel for the Page Template you wish to add the snippet to.

Map the snippet to the correct module template:

Pheeew….

Ok, next thing… We need to create a new page in our sitetree – Then add the module to the page, and press OK.

Now for the fun part – We need to modify out snippet for our needs – Open your XSLT snippet and modify the code to this:

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

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

Read more

Create an ul li based submenu in WordPress

Wordpress

No Comments


Share this post

Ever wanted to create a submenu in WordPress? – Here is how to create an <ul><li> based left menu for your wordpress site.

<?php
if(!$post->post_parent){
	// will display the subpages of the top level - Y
	$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
}else{
	// diplays only the subpages of the parent level
	//$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
 
	if($post->ancestors)
	{
		// now you can get the the top ID of this page
		// wp is putting the ids DESC, thats why the top level ID is the last one
		$ancestors = end($post->ancestors);
		$children = wp_list_pages("title_li=&child_of=".$ancestors."&echo=0");
		// you will always get the whole subpages list
	}
}
 
if ($children) { ?>
	<ul>
		<?php echo $children; ?>
	</ul>
<?php } ?>

Read more

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

Get Parent Page/Post title in WordPress

Wordpress

No Comments


Share this post

Do you need to get the parent page or post title in your WordPress theme?

Here is how….

<?php
$parent_title = get_the_title($post->post_parent);
echo $parent_title;
?>

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

My firefox plugins, what’s yours?

General, SEO, Webdesign

No Comments


Share this post

As a webdeveloper i use different kindda plugins for Firefox, here my list, what’s yours?

Read more

Paul Irish on HTML5 Boilerplate

General, Webdesign

No Comments


Share this post

All frontend developers should take a look at this video:

and continue to http://html5boilerplate.com for downloading…. ITS AWESOME!!!

Read more