Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Excerpt

A view decorator is a little bit of metadata that you can stick at the top of your view in FarCry to change its behaviour and the way its documented. FarCry Core framework is pretty clever and can work out a default in most cases depending on the file naming convention you have used. However, its good practice to be explicit about your decorators so be sure to put them in.

Adding them to your view couldn't be easier. Just add each decorator on its own line, in a ColdFusion comment, at the top of your view.

Code Block

<!--- @@Displayname: Full Page Display --->
<!--- @@Description: Complete view of the case study. --->
<!--- @@Viewstack: page --->
<!--- @@Viewbinding: object --->
<!--- @@Cachestatus: 1 --->
<!--- @@Cachetimeout: 60 --->
<!--- @@Fualias: page --->
<!--- @@postprocess: youtube(width=720,height=405);gist --->

View Decorators

What follows is a little cheat sheet of the most common decorators and how they work.

...

@@Fualias: friendly URL alias for the view
Friendly URL alias is great. You can rename your view, as it appears on the URL, to just about anything you like. So for a view with a file name of displayRSSFeed.cfm you get a default URL containing "displayRSSFeed". Using fualias you could change this to simply "rss".

@@postprocess: webskin post processing

Post processing can be used to modify the output of a webskin after it is generated. It can be used to remove white space, convert URLs into full embedded content, or support your own content macros. More details here.

@@Displayname: name of the template
@@Description: overview of template usage
Displayname and Description are used by the framework and documentation plugin to provide a friendly name and additional information about the view when its relevant. It's highly recommended you fill these in so your users get friendly and intuitive labels.