Saturday, December 20, 2008

Embedding fonts using SIFR

I've been around on the net since 1995, and have seen at least 3 ways to embed fonts on webpages: The microsoft way, the netscape way and now a cross platform way - SIFR.

As I try to put my threads short, I will just write a way to implement SIFR custom fonts on your website

  1. Locate a TTF font you whish to use on your webpage
  2. Goto the page which offers to convert the font to a "flash swf font" (used by SIFT):
    http://www.sifrgenerator.com/wizard.html
  3. Follow the wizard guide and choose version 2 in the end.
  4. Download the SWF file to a path near your website, say in a folder named "fonts"

Now the font is ready, all you need to do now is to try another free service appearing as a plugin for JQUERY - the sIFR plugin!

  1. Goto the website http://jquery.thewikies.com/sifr/
  2. Download the "Jquery sIFR plugin version 2" All in one.zip file
  3. unpack it and follow the guide

To be able to use the font you generated yourself - copy'n'paste the font into the "fonts" directory in the unpacked "all-in-one" zip file.

That's it! :-)

Friday, December 19, 2008

How to rename a Dynamicweb Stylesheet

In Dynamicweb CMS you have so-called "Stylesheets" which are used as containers for various page/site related settings: Layout, navigation etc. You cannot by default rename them - but if you are lucky to have access to the SQL database in which your soloution is store you can use these sql queries below to rename your stylesheets:

  1. Find the information about the excisting stylesheets:
    select * from StylesheetStylesheet where StylesheetStylesheetParentID = 0

    You will get information like this:
    StylesheetStylesheetID [Integer]
    StylesheetStylesheetParentID [Integer]
    StylesheetStylesheetNodename [String]
  2. To rename a given Stylesheet, use the above information to generate your sql query, for instance:
    UPDATE StylesheetStylesheet SET StylesheetStylesheetNodename = 'My new name'WHERE (StylesheetStylesheetID = '4')

Friday, December 12, 2008

DwTemplateTags in XSLT templates

Well, to find out which template tags are availiable when working with XSLT templates in Dynamicweb CMS you need to insert this:

<xsl:text disable-output-escaping="yes"><![CDATA[<!--@DwTemplateTags-->]]></xsl:text>

Thursday, November 13, 2008

Code snippets - lets unite!!

As I was browsing for some help for doing a simpel task I came across a site which contains Snippets - http://snipplr.com. Wow! That sounded interesting - the snippet I first clicked on was: "Opacity Hack. I was a litle disapointed, not with the snippet in question, but the fact that it was nothing but simpel text...

For years in the back of my head I have had the thought that code snippets should unite! :-) My hopes that snipplr.com was such a united snippet spot was spoiled...

But I tried to write my POWs about snippets - which was not 100% allowed by their comment system, so here goes - a (hopefully) working copy of what I tried to write about snippets standardlization:


Hi, In general I like the Idea of snippets, no doubt about that! But I would love to see some kind of standardilzation of them, preferable in a combination of XML, XSD (schema). You could then transform your XML snippet to what ever purpose you would need it in - say a HTML context. You can validate the input to the snippet using XSD. And some clever programmer might create add-ins for say MS Visual Studio 2008 or other commenly used development tools.
Here is my first thoughts about how it could be put together - based on this snippet for opacity:
<?xml version="1.0" encoding="utf-8"?>
<snippets>
<snippet>
<name>Opacity hack</name>
<version>1.0</version>
<context>CSS</context>
<template>
<outputRaw><![CDATA[selector { filter: alpha(opacity=60); /* MSIE/PC */ -moz-opacity: 0.6; /* Mozilla 1.6 and older */ opacity: 0.6;}]]></outputRaw>
<output>
<input id="alpha" type="string" default=".selector" /> {
filter: alpha(opacity=<input id="opacity" type="int" default="60"/>); /* MSIE/PC */
-moz-opacity: <eval id="moz-opacity"><![CDATA[opacity/100]]></eval>; /* Mozilla 1.6 and older */
opacity: <eval id="moz-opacity"><![CDATA[moz-opacity]]></eval>;
}
</output>
</template>
</snippet>
</snippets>

Friday, November 7, 2008

Snippet: External javascript Eval window

Below a code which (especially) in MSIE will be helpfull when debugging a webpage in frontend. The script opens a small window containing a textarea where you may enter your javascript code. When you Evaluete the code it will be in the context of the current window, so you can examine or edit the DOM tree of the document which is in the window where you clicked the Snippet.

You should create your snippet by

  1. Create a bookmark (any page)
  2. Place the bookmark in the "links" area, so that it will be available in your toolbar
  3. Edit the bookmark (right click) and paste the code below into the URL
  4. Rename it (to say "EVAL")

Here is the code:



Thursday, November 6, 2008

Published directly from Picasa2


This image has been published directly from my PC using Picasa2. I choose the image (of my daughter and me) and simply pressed "Blogg this!". After having gone some simpel choices (for instance which layout) it was done! Simpel! and nice!

Posted by Picasa

Sunday, October 26, 2008

Video for websites - tools you need (TUN)

CamStudio - video capturing/converting tool


The network speed - bandwidth - I use has grown from 9,600 BITS/second in 1995 to my current 20 Mbits/second so ofcause you can put more "heavy" stuff on the net. One of the relative heavy items is video clips.


You may have a digital video recorder, a webcam, a camera or perhaps a phone which will produce for instance .AVI files. I found though that publish AVI files is not so perfect for several reasons. Yesterday I found soloution (for my PC) which is an open source application called "CamStudio", it seems to be the answer to my needs to be able to publish video - here are some of the features:

  • Optional compressing of the video

  • Choice to include audio

  • SWF video + autogenerated HTML which embeds it


That is enough for me! - and BTW I found it here: http://www.webappers.com/category/components/video/