<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Trond Ulseth&apos;s Blog - FarCry</title>
			<link>http://trond.ulseth.no/index.cfm</link>
			<description>Trond Ulseth</description>
			<language>en-us</language>
			<pubDate>Wed, 02 Jan 2008 19:49:33 -0600</pubDate>
			<lastBuildDate>Tue, 31 Jul 2007 02:47:00 -0600</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>trond@ulseth.no</managingEditor>
			<webMaster>trond@ulseth.no</webMaster>
			
			
			
			
			
			<item>
				<title>New FarCry form builder plugin released</title>
				<link>http://trond.ulseth.no/index.cfm/2007/7/31/New-FarCry-form-builder-plugin-released</link>
				<description>
				
				With this plugin you can let users of FarCry add custom forms to their websites. Each form submission will be emailed to an address that is defined for each form, as well as being logged and available from the FarCry administration.

This is the full version of the plugin that was started in my FarCry plugin tutorial.

A pdf file with documentation is enclosed in the download.

This plugin is open-source under the &lt;a href=&quot;http://www.apache.org/licenses/LICENSE-2.0&quot; target=&quot;_blank&quot;&gt;Apache License, Version 2.0&lt;/a&gt;

If you have questions or would like to contribute in further enhancing the plugin, please contact me.

Also if you use the plugin in your FarCry projects I&apos;d love to hear about it.

&lt;h2&gt;&lt;a href=&quot;http://trond.ulseth.no/enclosures/idlform.zip&quot; target=&quot;_blank&quot;&gt;DOWNLOAD&lt;/a&gt;&lt;/h2&gt;

This plugin is released by &lt;a href=&quot;http://www.idl.no&quot; target=&quot;_blank&quot;&gt;IDLmedia AS&lt;/a&gt;
				
				</description>
				
				<category>FarCry</category>
				
				<pubDate>Tue, 31 Jul 2007 02:47:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2007/7/31/New-FarCry-form-builder-plugin-released</guid>
				
				<enclosure url="http://trond.ulseth.no/enclosures/idlform.zip" length="394878" type="application/zip"/>
				
			</item>
			
		 	
			
			
			<item>
				<title>FarCry 4 tutorial everybody should see?</title>
				<link>http://trond.ulseth.no/index.cfm/2007/7/4/FarCry-4-tutorial-everybody-should-see</link>
				<description>
				
				I just wrote a tutorial on making plugins in FarCry 4 making use of the FarCry Form Tools technology. I think it really shows some of the awesome powers of FarCry. Scaffolding, ORM, code- and application generation in a very smooth package is what this is about.

While FarCry is known to be an amazing CMS - it has developed into a full blown application framework - where CMS is just one of the plugins that you can make use of. In this tutorial I show you how to build another application/plugin - even though this plugin is mainly ment to be used together with the CMS.

Enough said - click the download link below to download the tutorial in pdf format.

&lt;a href=&quot;http://trond.ulseth.no/enclosures/Creating%20a%20plugin%20using%20Form%20Tools%2Epdf&quot; target=&quot;_blank&quot;&gt;DOWNLOAD&lt;/a&gt;
				
				</description>
				
				<category>FarCry</category>
				
				<category>ColdFusion</category>
				
				<pubDate>Wed, 04 Jul 2007 08:33:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2007/7/4/FarCry-4-tutorial-everybody-should-see</guid>
				
				<enclosure url="http://trond.ulseth.no/enclosures/Creating a plugin using Form Tools.pdf" length="1126844" type="application/pdf"/>
				
			</item>
			
		 	
			
			
			<item>
				<title>FarCry: Know your tag libraries intimately</title>
				<link>http://trond.ulseth.no/index.cfm/2007/5/15/FarCry-Know-your-tag-libraries-intimately</link>
				<description>
				
				In a comment to yesterdays post about the skin:buildLink tag Jack is asking;

&lt;em&gt;
What about parameters?

If we have parameters on link such as &amp;pagename=123&amp;language=en_us
&lt;/em&gt;

Now that is a good question, and David makes a good answer to that in a follow up coment.

&lt;em&gt;
The buildLink tags also takes a few nice args that let you manage other params etc.

* The stParameters arg will allow you to supply a struct that will be used to create the extra URL params
* Also the xCode arg will let you add other attributes to the (a) link tag (good for titles etc).
&lt;/em&gt;

But how do you learn about this? Where do you go to find out what parameters a tag can take? I find that the easiest is to go straight to the code in the core. For example, if you open the file core/tags/webskin/buildLink.cfm file you&apos;ll see the following (abreviated):

&lt;code&gt;
&lt;!--- 
|| ATTRIBUTES ||
$in: objectid -- navigation obj id$
$in: title -- link text $
$in: external -- external link for nav node $
$in: class -- css class for link$
$in: target -- target window for link$
$in: xCode -- eXtra code to be placed inside the anchor tag 
---&gt;

&lt;cfif thistag.executionMode eq &quot;Start&quot;&gt;
	&lt;cfparam name=&quot;attributes.linktext&quot; default=&quot;&quot;&gt;
	&lt;cfparam name=&quot;attributes.target&quot; default=&quot;_self&quot;&gt;
	&lt;cfparam name=&quot;attributes.bShowTarget&quot; default=&quot;false&quot;&gt;
	&lt;cfparam name=&quot;attributes.externallink&quot; default=&quot;&quot;&gt;
	&lt;cfparam name=&quot;attributes.id&quot; default=&quot;&quot;&gt;
	&lt;cfparam name=&quot;attributes.class&quot; default=&quot;&quot;&gt;
	&lt;cfparam name=&quot;attributes.urlOnly&quot; default=&quot;false&quot;&gt;
	&lt;cfparam name=&quot;attributes.r_url&quot; default=&quot;&quot;&gt;
	&lt;cfparam name=&quot;attributes.xCode&quot; default=&quot;&quot;&gt;
	&lt;cfparam name=&quot;attributes.includeDomain&quot; default=&quot;false&quot;&gt;
	&lt;cfparam name=&quot;attributes.stParameters&quot; default=&quot;#StructNew()#&quot;&gt;
	&lt;cfparam name=&quot;attributes.JSWindow&quot; default=&quot;0&quot;&gt;&lt;!--- Default to not using a Javascript Window popup ---&gt;
	&lt;cfparam name=&quot;attributes.stJSParameters&quot; default=&quot;#StructNew()#&quot;&gt;
&lt;/code&gt;

Some of the attributes the tag can take are explained in the comments to the tag, but not all. But looking at the cfparams you get a pretty good overview over what attributes you can use. Ok - it&apos;s not totally intuitive what they all do, but getting to know the attributes you can use and what they do plays a big part in using the tag libraries succesfully.

Happy FarCry&apos;ing
				
				</description>
				
				<category>FarCry</category>
				
				<pubDate>Tue, 15 May 2007 02:40:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2007/5/15/FarCry-Know-your-tag-libraries-intimately</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Farcry: Know your tag libraries - skin:buildLink</title>
				<link>http://trond.ulseth.no/index.cfm/2007/5/14/Farcry-Know-your-tag-libraries--skinbuildLink</link>
				<description>
				
				One of the tag library tags I use the most is skin:buildLink

This one you use to build links to any of the objects (articles, news, images etc.) within your application. All you need is the objectID. Let&apos;s say that you are showing a teaser, and want to link to the full article from a read more link.

You&apos;d do this (abreviated):

&lt;code&gt;
&lt;!--- tag libraries ---&gt;
&lt;cfimport taglib=&quot;/farcry/core/tags/webskin&quot; prefix=&quot;skin&quot; /&gt;

&lt;!--- the teaser ---&gt;
&lt;cfoutput&gt;
&lt;h3&gt;#stObj.title#&lt;/h3&gt;
#stObj.teaser#&lt;br /&gt;
&lt;/cfoutput&gt;
&lt;skin:buildLink objectid=&quot;#stObj.objectid#&quot;&gt;
&lt;cfoutput&gt;
Read More
&lt;/cfoutput&gt;
&lt;/skin:buildLink&gt;
&lt;/code&gt;

Notice that you escape cfoutput before calling the tag - this as part of limiting white space.

Very handy to know - especially if your site uses FUs

Happy Farcry&apos;ing
				
				</description>
				
				<category>FarCry</category>
				
				<pubDate>Mon, 14 May 2007 05:37:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2007/5/14/Farcry-Know-your-tag-libraries--skinbuildLink</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Farcry: Know your tag libraries - introduction</title>
				<link>http://trond.ulseth.no/index.cfm/2007/5/14/Farcry-Know-your-tag-libraries--introduction</link>
				<description>
				
				When developing applications in Farcry a lot of time and head scratching can be saved by knowing the available tag libraries and how to use them.

Tag libraries are usually included at the top of the page like this:

&lt;code&gt;
&lt;!--- tag libraries ---&gt;
&lt;cfimport taglib=&quot;/farcry/core/tags/container&quot; prefix=&quot;con&quot;&gt;
&lt;cfimport taglib=&quot;/farcry/core/tags/widgets&quot; prefix=&quot;widge&quot;&gt;
&lt;cfimport taglib=&quot;/farcry/core/tags/webskin&quot; prefix=&quot;skin&quot; /&gt;
&lt;/code&gt;

(The paths above are for Farcry 4. In Farcry 3 you would write &quot;farcry_core&quot; instead of &quot;core&quot;)

Typically you only include the tag libraries that you need. 

I will now and then post examples on how to work with the available tag libraries.

Stay tuned.
				
				</description>
				
				<category>FarCry</category>
				
				<pubDate>Mon, 14 May 2007 05:31:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2007/5/14/Farcry-Know-your-tag-libraries--introduction</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>FarCry - navigation in a multi language site</title>
				<link>http://trond.ulseth.no/index.cfm/2007/2/13/FarCry--navigation-in-a-multi-language-site</link>
				<description>
				
				A client wanted a site that should have content in Norwegian, English and French. In the design file there was separate choises for the three different languages, and then a navigation area, where the navigation should be in the currently selected language.

This could be solved in different ways. One could make three different page templates calling the three different language navigations - or one could make categories for each of the languages and make pages belong to one of these.

However we wanted to have only one template, and not to have categories. We wanted to sort it with three different top nodes in the site tree. Looking like this:

&lt;img src=&quot;/farcry_languages.gif&quot; /&gt;

Then we gave aliases to these three navigation nodes.

We then made a new method in a utilities cfc we use in our company, and call it like this from out header template (before the navigation section):

&lt;code&gt;
&lt;cfinvoke component=&quot;farcry.idlmedia_core.utilities&quot; method=&quot;searchForParentAlias&quot; returnvariable=&quot;parentAlias&quot;&gt;
	&lt;cfinvokeargument name=&quot;objectID&quot; value=&quot;#request.navid#&quot;&gt;
	&lt;cfinvokeargument name=&quot;aliases&quot; value=&quot;home,engelsk,fransk&quot;&gt;
&lt;/cfinvoke&gt;
&lt;/code&gt;

The method then checks if the current page, or any of it&apos;s ancestors have an alias of one of those provided with the cfinvokeargument. It then returns the alias, and we can make the navigation like so:

&lt;code&gt;
&lt;skin:genericNav navID=&quot;#application.navid[parentAlias]#&quot;
	id=&quot;nav&quot;
	depth=&quot;2&quot;
	bActive=&quot;true&quot;
	bIncludeHome=&quot;false&quot;&gt;
&lt;/code&gt;

Here&apos;s the code for the method (first version - it still needs some work):

&lt;code&gt;
&lt;cffunction name=&quot;searchForParentAlias&quot; access=&quot;public&quot; returntype=&quot;any&quot; hint=&quot;searches up the navigation tree for a node with alias from argument.aliases&quot;&gt;
	&lt;cfargument name=&quot;objectID&quot; hint=&quot;Navigation ObjectID&quot; type=&quot;uuid&quot; required=&quot;yes&quot; /&gt;
	&lt;cfargument name=&quot;aliases&quot; required=&quot;yes&quot; type=&quot;string&quot; hint=&quot;list of aliases to search for&quot;&gt;
		
		
	&lt;cfset qAncestors = request.factory.oTree.getAncestors(objectid=arguments.objectid)&gt;
	&lt;cfset listAncestors = QuotedValueList(qAncestors.objectid)&gt;
	&lt;cfset listAncestors = ListAppend(listAncestors,&quot;&apos;#arguments.objectid#&apos;&quot;)&gt;
			
	&lt;cfloop list=&quot;#arguments.aliases#&quot; index=&quot;i&quot;&gt;
				
		&lt;cfset thisaliasid = application.navid[i]&gt;
		
		&lt;cfif ListFind(listAncestors, &quot;&apos;#thisaliasid#&apos;&quot;)&gt;
			&lt;cfset foundParentAlias = i&gt;
		&lt;/cfif&gt;
			
	&lt;/cfloop&gt;
		
	&lt;cfreturn foundParentAlias&gt;
		
&lt;/cffunction&gt;
&lt;/code&gt;

By doing it this way we have a reusable way of handling this, without the hassle of managing several very similar templates, and with a very intuitive grouping of the different articles in the site tree.
				
				</description>
				
				<category>FarCry</category>
				
				<pubDate>Tue, 13 Feb 2007 07:06:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2007/2/13/FarCry--navigation-in-a-multi-language-site</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>FarCry tip: displaying teaser images</title>
				<link>http://trond.ulseth.no/index.cfm/2006/11/15/FarCry-tip-displaying-teaser-images</link>
				<description>
				
				If you display teasers you might want to display teaser images as well. However the default teaser templates do not include this option. So we need to tweak them a bit.

You find the teaser templates in the folders for the different datatypes in the webskin folder. They all have file names starting with displayTeaser.

As an example lets look at one of the teaser templates for news (slightly abreviated code to save space and focus on the topic): webskin/dmNews/displayTeaserFeature.cfm

&lt;code&gt;
&lt;cfoutput&gt;
&lt;h4&gt;&lt;a href=&quot;#Application.URL.conjurer#?objectID=#stObj.objectID#&quot;&gt;#stObj.title#&lt;/a&gt;&lt;/h4&gt;
	&lt;p&gt;#stObj.teaser#&lt;/p&gt;
	&lt;p&gt;Date published: #dateformat(stObj.PUBLISHDATE,&apos;DD/MM/YY&apos;)#&lt;/p&gt;
&lt;/cfoutput&gt;
&lt;/code&gt;

Now let us say that we want to display teaser images as well. And we&apos;ll have the teaser images float to the right of the teaser text.

First you might want to do a cfdump of the stObj. Here you&apos;ll find that there is a value called stObj.teaserimage, but however this is not the name of a image file as you might expect. It holds a UUID for the image object that is the teaser image.

What we will do is use the q4 library that is a part of FarCry to get the necasary information from the image object.

Here&apos;s the code:

&lt;code&gt;
&lt;cfimport taglib=&quot;/farcry/fourq/tags&quot; prefix=&quot;q4&quot;&gt;

&lt;cfoutput&gt;
&lt;h4&gt;&lt;a href=&quot;#Application.URL.conjurer#?objectID=#stObj.objectID#&quot;&gt;#stObj.title#&lt;/a&gt;&lt;/h4&gt;
	&lt;p&gt;
	&lt;cfif len(trim(stObj.teaserimage)) gt 0&gt;	
	&lt;q4:contentobjectget objectID=&quot;#stObj.teaserimage#&quot; r_stobject=&quot;getObject&quot;&gt;
	&lt;cfoutput&gt;&lt;img src=&quot;/images/#getObject.imagefile#&quot; align=&quot;right&quot; alt=&quot;#getObject.alt#&quot; /&gt;&lt;/cfoutput&gt;
	&lt;/cfif&gt;
	#stObj.teaser#&lt;/p&gt;
	&lt;p&gt;Date published: #dateformat(stObj.PUBLISHDATE,&apos;DD/MM/YY&apos;)#&lt;/p&gt;
&lt;/cfoutput&gt;
&lt;/code&gt;

At the top we import the q4 library. Then within the paragraph holding the teaser text, we check if there is a UUID value for a teaser image. If so we pass the UUID to a q4 method called contentobjectget. We then get all the needed properties of the image object back. Here we use imagefile and alt, but you can try to cfdump getObject to see all properties available.

Now you have no excuse for not getting some more pictures into your FarCry solutions ;)

Happy FarCry&apos;ing
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>FarCry</category>
				
				<pubDate>Wed, 15 Nov 2006 02:57:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2006/11/15/FarCry-tip-displaying-teaser-images</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>FarCry tip: background in TinyMCE</title>
				<link>http://trond.ulseth.no/index.cfm/2006/11/14/FarCry-tip-background-in-TinyMCE</link>
				<description>
				
				In the last FarCry post I linked to another post about configuring TinyMCE in FarCry. However most of the time I find that I use TinyMCE like it works right out of the box. It will use the same stylesheet that is configured for the site itself, so the formating you see in TinyMCE will pretty much be the same as on the site.

The only little problem with this is if you in your css have specified a background color or image for body. For example you have a black background for the site, but the content is black text in a div with a white background.

Now what happens is that TinyMCE will use the black background from the body as a background in the editor window.

The solution is quick and easy. In your css include the follwing code:

&lt;code&gt;
.mceContentBody {
	background-image: none;
	background-color: #FFFFFF;
	}
&lt;/code&gt;

Happy FarCry&apos;ing
				
				</description>
				
				<category>ColdFusion</category>
				
				<category>CSS</category>
				
				<category>FarCry</category>
				
				<pubDate>Tue, 14 Nov 2006 03:46:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2006/11/14/FarCry-tip-background-in-TinyMCE</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>FarCry - first post</title>
				<link>http://trond.ulseth.no/index.cfm/2006/11/1/FarCry--first-post</link>
				<description>
				
				I&apos;ve been meaning to start a FarCry category on my blog for a while now, so here it is - the first (of hopefully many) FarCry posts.

It&apos;s a bit lame though that I&apos;ll use the first post to highlight someone elses post instead of coming up with some original content. But Mark Kruger has written a &lt;a href=&quot;http://www.coldfusionmuse.com/index.cfm/2006/10/31/TinyMCE&quot; target=&quot;_blank&quot;&gt;very good post on how to configure TinyMCE and FarCry&lt;/a&gt; to give your clients just the amount of control they should have for formating content.

While not new for me, I always apprechiate a good reference instead of digging through old code to see how I&apos;ve done stuff earlier. Ok - I know - I should be better at documenting (I&apos;m getting there).

ps - while there check out Marks other posts in the FarCry category as well.
				
				</description>
				
				<category>FarCry</category>
				
				<pubDate>Wed, 01 Nov 2006 04:15:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2006/11/1/FarCry--first-post</guid>
				
			</item>
			
		 	
			</channel></rss>
<SCRIPT language="Javascript">
<!--

// FILE ARCHIVED ON 20080103014943 AND RETRIEVED FROM THE
// INTERNET ARCHIVE ON 20100801043801.
// JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
// ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
// SECTION 108(a)(3)).

   var sWayBackCGI = "http://web.archive.org/web/20080103014943/";

   function xResolveUrl(url) {
      var image = new Image();
      image.src = url;
      return image.src;
   }
   function xLateUrl(aCollection, sProp) {
      var i = 0;
      for(i = 0; i < aCollection.length; i++) {
         var url = aCollection[i][sProp];         if (typeof(url) == "string") { 
          if (url.indexOf("mailto:") == -1 &&
             url.indexOf("javascript:") == -1
             && url.length > 0) {
            if(url.indexOf("http") != 0) {
                url = xResolveUrl(url);
            }
            url = url.replace('.wstub.archive.org','');
            aCollection[i][sProp] = sWayBackCGI + url;
         }
         }
      }
   }

   xLateUrl(document.getElementsByTagName("IMG"),"src");
   xLateUrl(document.getElementsByTagName("A"),"href");
   xLateUrl(document.getElementsByTagName("AREA"),"href");
   xLateUrl(document.getElementsByTagName("OBJECT"),"codebase");
   xLateUrl(document.getElementsByTagName("OBJECT"),"data");
   xLateUrl(document.getElementsByTagName("APPLET"),"codebase");
   xLateUrl(document.getElementsByTagName("APPLET"),"archive");
   xLateUrl(document.getElementsByTagName("EMBED"),"src");
   xLateUrl(document.getElementsByTagName("BODY"),"background");
   xLateUrl(document.getElementsByTagName("TD"),"background");
   xLateUrl(document.getElementsByTagName("INPUT"),"src");
   var forms = document.getElementsByTagName("FORM");
   if (forms) {
       var j = 0;
       for (j = 0; j < forms.length; j++) {
              f = forms[j];
              if (typeof(f.action)  == "string") {
                 if(typeof(f.method)  == "string") {
                     if(typeof(f.method) != "post") {
                        f.action = sWayBackCGI + f.action;
                     }
                  }
              }
        }
    }


//-->
</SCRIPT>

