Overview
Code examples of functionality that can be created in FarCry. We're focused on sample code here so in many instances there is little explanation beyond the code comments.
Code Samples
FarCry 5.x.x Code Examples
Code examples from older FarCry versions; should still work just fine, but be mindful that there may be more modern techniques available.
- Basic search form for dmNews — This is a basic search form which enables you to place a search option for dmNews, you can build it further as required.
- CAS + LDAP Unique Example — Here is a small example for creating your own User Directory that might be interfacing with some unique situations. Here there is a combined CAS for login + LDAP for group identification.
- Flush ColdFusion trusted cache from Farcry Webtop — You can improve (production) performance by turning on trusted cache for your ColdFusion server. However, it's easy to forget that trusted cache is on when you do an update. Here is how to add this functionality to the FarCry Webtop so you can flush cache when you re-initialise the application.
- ftWatch Example — Here is a quick primer on how to use ftWatch in a formtool. Basically, two things get passed into the functions of a formtool (such as edit() or display())
- Link Array Formtool — Ever wanted to allow users to capture a bunch of links in a property that you can output? You could always use the FarCry CMS Link content type, but its a bit unwieldy, especially if your links are really only related to one specific content item and don't make sense in a library. Well you are in luck
- Sample iTunes Feed — Building an iTunes feed is relatively straightforward in ColdFusion. The trick in FarCry Framework is knowing where to put the code. This example is taken directly from the webDU Developer Conference website.
- Sample RSS Feed — Building an RSS feed is very straightforward in ColdFusion. The trick in FarCry Framework is knowing where to put the code. This example is taken directly from the Fullasagoog website.
- Simple polling — This rule provides a very simple widget that can be added to any container, presenting users with a question and list of options then displaying the results after they choose.
FarCry 4.x.x Code Examples
Code examples from older FarCry versions; should still work just fine, but be mindful that there may be more modern techniques available.
- Image Gallery Rule — Try this very simple image gallery rule. Grey box is basically a pop up window that doesn't suck. Just install the existing FarCry Greybox plugin and you are all set. Select the images you want from the image library and display them using Grey Box.
- Sample Promotional Tile — We needed a simple promotional tile for placing on the website. This was used to promote other areas on the site or external subsites of the clients. The tile can have either a fixed horizontal image or a vertical image. The individual tiles will be placed onto the site using the "hand-picked" publishing rule.
- Showing Related Content — One of FarCry's real strengths is the ability to easily create and display cross related content. All you need is a content type that records the references using an array or library property (for example, dmHTML the content type for standard HTML pages) and some presentation logic in your view.