Warning | ||
---|---|---|
| ||
Updating the course for FarCry 6.x. If you can help let us know! Put your notes in the comments for the page. Section will be expanded to include:
|
Objective
Excerpt |
---|
By the end of this unit, we should have an understanding of how FarCry navigates our project and plugins to find both content type metadata and relevant webskin locations. |
Plugins
Every aspect of a project can be repackaged and used in another project as a plugin. This might be the entire project or just a small part of it. Most applications are combinations of several plugins. Community plugins include solutions for Google Maps, blogging, content management, free-text search engines and many, many more.
...
- content types
- webskins or views
- webtop configuration
- publishing rules
- formtools (components used to render form elements)
- components (effectively content types without database persistence)
Installing Plugins
If you nominate a plugin during the initial installation of your project, its code and content types should be automatically registered and deployed. However, if you are deploying a plugin to an established project you will need to get your hands just a little bit dirty.
...
Info | ||
---|---|---|
| ||
You can use updateapp=1 to reload the entire application, or you can log into the webtop and just reload config data:
|
Walkthrough: Installing Google Maps Plugin
- Download the Google Maps Plugin
- Copy the code base to the plugins folder of your installation
- Update your farcryConstructor.cfm configuration file to include GoogleMaps
- Re-initialise the application
- Go to the Admin > Developer Utilities > COAPI Tools > Types and deploy the Google Maps content types
- Go to the Admin > Developer Utilities > COAPI Tools > Rules and deploy the Google Maps publishing rules
- Login to the webtop and update the Config for Google Maps with your API key
- Create a publish a Google Map
Plugins & Content Types
Now that we understand the cascading relationship between FarCry Core, Plugins and a Project, the order of initialisation of the metadata for a particular content type is straightforward.
...
Tip | ||
---|---|---|
| ||
If you know the exact structure your are looking for you can type it up the top and click [dump], or browse using the preset scopes listed on the left of the viewer. |
Walkthrough: Extending the News Content Type
Using this concept, we are going to extend the dmNews.cfc found in the farcrycms plugin and add some new properties.
- Create a new file in projectName/packages/types/dmNews.cfc
- Paste the following:
Code Block <cfcomponent extends="farcry.plugins.farcrycms.packages.types.dmNews" displayname="News" hint="Dynamic news data"> <cfproperty name="author" type="string" ftSeq="10" ftFieldset="Publishing Details" ftWizardStep="General Details" ftLabel="Author" /> </cfcomponent>
- Notice the value of
extends
: this says we are extending the properties and functionality found in farcry.plugins.farcrycms.packages.types.dmNews - Deploy our new property
- Update our COAPI Metadata
- Create a new News item in the webtop from "Content / CMS Content / News"
- Notice our new
author
property now located in the correct position in the wizard
Webskin Inheritance
Once all of the types have been initialized in the fashion above, FarCry then finds all the webskins that are relevant for each type.
...
This allows us to override behaviour defined in core or a plugin and so on.
Lab: Override the displayPageFull News Webskin
Go ahead and update the full page display webskin for dmNews to include the new author
property.