Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Clarification of Tab name

...

  1. Create a new file called superHero.cfc and save this into your project's ./packages/types directory.
  2. Copy the following code into this file, save and review with the instructor
    Code Block
    title./myproject/packages/types/superHero.cfc
    <cfcomponent name="superHero" extends="farcry.core.packages.types.types" output="false" displayname="Super Hero">
    
    	<cfproperty
    		name="title" type="string" default="" hint="Super hero title." />
    	<cfproperty
    		name="secretHideout" type="string" hint="The secret hideout location of the super hero" />
    	<cfproperty
    		name="teaser" type="longchar" default="" hint="Mini intro for super hero biography." />
    	<cfproperty
    		name="biography" type="longchar" default="" hint="Super hero biography." />
    	<cfproperty
    		name="imgHero" type="string" hint="The image of the hero" />
    
    </cfcomponent>
    
  3. Go to the FarCry Webtop and deploy the content type: ADMIN > Developer Utilities > COAPI Tools > Types
  4. Locate your new content type, "superHero" and select DEPLOY.
  5. Click on the [Scaffold] button now to create an Administration scaffold
  6. Select the checkbox next to "Create type admin interface",
    1. put in a title for your administration list
    2. select label and imgHero as the fields to appear in your list
      Info
      titleBasic Scaffolding

      The Scaffold option for deployed content types generates some sample code you can use to get started right away.
      "Create type admin interface" creates a small XML file that generates a menu item for you in the FarCry webtop.
      The framework provides a default edit handler and display view so no need to add anything else here just yet.

  7. Reload your Application. This time you will need to update the [Webtop] option
  8. Go to the Custom Content Tab. Locate your Super Hero admin and create some Heroes (or Villains!)
    Info
    titleEditing Content Types

    When you created your first superHero object you may have noticed a rudimentary edit handler allowing you to key in details, save and update. That's not actually part of the scaffold code that was generated at all. The edit handler is dynamically generated at run time based on the metadata associated with the superHero component's cfproperty tags. Ok. So its pretty minimalist now but wait.. it's only the beginning.

    Warning
    titleWait Up!

    Make sure you understand the concept of extends, displayname and property type before the instructor starts babbling on about something else.

...

Code Block
titleSample Code from ./myproject/packages/dmCarouselItem.cfc
<cfproperty name="imageSourceID" type="string"
	ftSeq="2" ftFieldset="General Details" ftLabel="Source Image"
	ftType="uuid" ftJoin="dmImage"
	ftHint="Select an image from the image library or create a new image.">

<cfproperty name="imageCarousel" type="string"
	ftSeq="3" ftFieldset="General Details" ftLabel="Carousel Image"
	ftType="image" ftDestination="/images/dmCarouselItem/imageCarousel"
	ftAllowUpload="false" ftSourceField="imageSourceID:SourceImage"
	ftAutoGenerateType="center" ftImageWidth="620" ftImageHeight="200"
	ftQuality="0.8" ftInterpolation="blackman">
		
<cfproperty name="imageThumbnail" type="string"
	ftSeq="4" ftFieldset="General Details" ftLabel="Thumbnail Image"
	ftType="image" ftDestination="/images/dmCarouselItem/imageThumbnail"
	ftAllowUpload="false" ftSourceField="imageSourceID:SourceImage"
	ftAutoGenerateType="center" ftImageWidth="95" ftImageHeight="30"
	ftQuality="0.8" ftInterpolation="blackman"
	ftHint="">