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

Flash Problem in Synkron VIA’s File Snippet

Synkron VIA

No Comments


Share this post

Synkron VIA’s default file snippet has en error when outputting Flash – The error is that it doesn’t create a <embed> tag – Which means – IT ONLY WORKS IN IE – That’s not good enough….

Anyway, it’s in easy fix – Simply add these lines to the code:

<xsl:variable name="height"><xsl:value-of select="Field[@Name='Height']" /></xsl:variable>
<xsl:variable name="width"><xsl:value-of select="Field[@Name='Width']" /></xsl:variable>
<embed src="{@Src}" quality="high" width="{$width}" height="{$height}" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />

Now your template that outputs the Flash tag should look like this:

<!--Flash object tag -->
  <xsl:template match="FileConfigurationEdition[@Extension='swf']">
		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{@Width}" height="{@Height}" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0">
		  <!-- Attributes should be attributes to the object tag, there for we need to apply these before any param tags will be written -->
		  <xsl:apply-templates select="Field[@Name='Attributes']"/>
		  <xsl:apply-templates select="Field"/>
		  <param name="movie" value="{@Src}"/>
		  <xsl:variable name="height"><xsl:value-of select="Field[@Name='Height']" /></xsl:variable>
		  <xsl:variable name="width"><xsl:value-of select="Field[@Name='Width']" /></xsl:variable>
		  <embed src="{@Src}" quality="high" width="{$width}" height="{$height}" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
		</object>
  </xsl:template>

Read more

Allow new filetypes in Synkron VIA

Synkron VIA

No Comments


Share this post

Synkron VIA only allow X numbers of different filetypes to be uploaded – So what if the file you want to upload isn’t allowed to be uploaded?
It is possible to extend VIA to allow new filetypes to be uploaded, if you have a little database knowledge.

Here is a little step by step guide on how to allow new filetypes.

  1. Log onto the server, or your own computer if it’s a local VIA installation.
  2. Open the Microsoft SQL Server Management Studio, or the Enterprise manager, and open the Database.
  3. Find the FileType table.
  4. Here you can create a new entry for the filetype you wish to add (see list of table colums below)
    For .docx insert:
    A. Extension: docx
    B. CategoryId: 2
    C. UseConfigurationFormDefinitionFromTypeId: NULL
    D. ConfigurationFormDefinition: NULL
    E. ReadFileContentFromDisk: 0
    F. Embeddable: 0
    G. DefaultIcon: yourImage.gif
  5. Touch the web.config or run an IIS reset
  6. Add the file type to the list of MIME types in the IIS (if it isn’t already there):
    A. In the ISS Manager select Properties on the server node and click MIME Types.
    B. Click New and enter the MIME type and the extension.
    C. Run an ISS reset.

Table columns explained
TypeId: Unique type id for the file type. Is auto generated.
Extension: for instance “flv”
CategoryId: Images = 1,
Video = 2
Audio = 3,
Archive = 5,
OfficeDocuments = 6,
Web = 8,
Other = 9
UseConfigurationFormDefinitionFromTypeId: Use FormDefinitionXML from another typeid
ConfigurationFormDefinition: FormDefinitionXML that defines the “File Configuration” interface in the workspace area.
ReadFileContentFromDisk: 1= True: Reads the content of the file and includes it in the XML.
Embeddable: 1=True: the filetype can be displyed/run on a page, for instance .mov and .jpg as opposed til .pdf. The general file snippet in Via will need to be updated to handle any new embeddable file types that are added.
DefaultIcon: Default icon

Source: http://dynamicweb.dk/Files-24122.aspx?ProductID=PROD42

Read more

Create a valid RSS date from VIA’s XML date output

Synkron VIA

No Comments


Share this post

Synkron VIA’s outputs XML which you can transform with XSLT – But I recently came across when making an RSS feed, that Synkron VIA’s <XmlDate> wasn’t a valid RSS date.

The date that Synkron VIA outputs in the <XmlDate> is:

<XmlDate>2008-07-18T13:22:45.387Z</XmlDate>

So for making this into a valid RSS feed, I made a little example what you can use.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
	<xsl:output method="html" indent="yes"/>
	<xsl:template match="Page">
		<h1>Via datetime to RSS datetime</h1>
		<h2>Example Via datetime:</h2>
		<pre>
			<xsl:text disable-output-escaping="no">
			<![CDATA[
			<Date UtcYear="2008" UtcMonth="7" UtcDay="18" UtcHour="13" UtcMinute="22" UtcSecond="45" UtcMillisecond="387" Region="da-DK" TimeZone="RomanceStandardTime" UtcOffset="60">
			<Day>fredag</Day>
			<AbbreviatedDay>fr</AbbreviatedDay>
			<Month>juli</Month>
			<AbbreviatedMonth>jul</AbbreviatedMonth>
			<XmlDate>2008-07-18T13:22:45.387Z</XmlDate>
			<LongDate>18. juli 2008</LongDate>
			<ShortDate>18-07-2008</ShortDate>
			<ShortTime>15:22</ShortTime>
			<LongTime>15:22:45</LongTime>
			<LongDateLongTime>18. juli 2008 15:22:45</LongDateLongTime>
			<ShortDateLongTime>18-07-2008 15:22:45</ShortDateLongTime>
			<ShortDateShortTime>18-07-2008 15:22</ShortDateShortTime>
			</Date>
			]]>
			</xsl:text>
		</pre>
		<h2>Example RSS datetime:</h2>
		<pre>
			<xsl:text disable-output-escaping="no"><![CDATA[<pubDate>Wed, 02 Oct 2002 08:00:00 EST</pubDate>]]></xsl:text>
		</pre>
		<xsl:call-template name="getRSSDateTimeFromViaDateTime">
			<xsl:with-param name="viaDateTime" select="Date"/>
		</xsl:call-template>
	</xsl:template>
	<xsl:template name="getRSSDateTimeFromViaDateTime">
		<xsl:param name="viaDateTime"/>
		<xsl:variable name="upper" select="'ABCDEFGHIJKLMNIPQRSTUVWXZYÆØÅ'"/>
		<xsl:variable name="lower" select="'abcdefghijklmnipqrstuvwxzyæøå'"/>
		<xsl:variable name="month">
			<xsl:choose>
				<xsl:when test="$viaDateTime/AbbreviatedMonth='okt'">Oct</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="concat(translate(substring($viaDateTime/AbbreviatedMonth, 1, 1), $lower, $upper),substring($viaDateTime/AbbreviatedMonth, 2, 2))"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<xsl:variable name="day">
			<xsl:choose>
				<xsl:when test="$viaDateTime/Day='mandag'">Mon</xsl:when>
				<xsl:when test="$viaDateTime/Day='tirsdag'">Tue</xsl:when>
				<xsl:when test="$viaDateTime/Day='onsdag'">Wed</xsl:when>
				<xsl:when test="$viaDateTime/Day='torsdag'">Thu</xsl:when>
				<xsl:when test="$viaDateTime/Day='fredag'">Fri</xsl:when>
				<xsl:when test="$viaDateTime/Day='lørdag'">Sat</xsl:when>
				<xsl:when test="$viaDateTime/Day='søndag'">Sun</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="concat(substring($viaDateTime/Day, 1, 1), substring(translate($viaDateTime/Day, $upper, $lower), 2, 2))"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<pre>
			<xsl:value-of select="concat($day, ', ', $viaDateTime/@UtcDay, ' ', $month, ' ', $viaDateTime/@UtcYear, ' ', $viaDateTime/LongTime, ' UT')"/>
		</pre>
	</xsl:template>
</xsl:stylesheet>

You can download the snippet here:

  Format VIA to RSS (2.9 KiB, 89 hits)

Read more

Enable HTML mode in Visual Editor

Synkron VIA

No Comments


Share this post
Q: How to enable HTML mode in the Visual Editor

A: To enable the HTML mode in the visual editor you have to change a value in the Default.aspx file. This file is usually located under ..\admin\editor.

Open the Default.aspx file in an editor and locate the following value:
ShowHtmlMode=”false”

change the value to true:
ShowHtmlMode=”true”

This will enable HTML mode in the visual editor.

Read more