Thanks for the excellent suggestions and the tips on where to edit. I was able to get a slightly varied version of the News type (which is what I needed) working in about a half hour or so :)
Rachel
On 3/29/06, Rachel Maxim <[EMAIL PROTECTED]> wrote:
Wow thanks for all the info! I'll give it a try!Rachel
On 3/28/06, Beenish <[EMAIL PROTECTED]> wrote:
Using PLP's is alot simpler then you think it is and the Brendan Sisson
example is way out of date and missing too much stuff. Infact I think
it's easier using a plp rather then writing your own edit handler and
alot faster too.
All you need to do is copy and paste everything from
farcry_core/packages/types/_dmNews to
<your_application_name>/packages/types/<your_customtype_folder>.
The only files I use are edit.cfm and under the plpEdit folder I use
start.cfm, categories.cfm and complete.cfm and dump the rest. You can
use them if you want.
Then I delete the form fields that aren't needed and add all my form
fields into start.cfm, like
<label for=""> <input type="text" name="fieldname" id="fieldname" /><br />
</label>
Don't even think about anything else in that file.
I'm using ctStaff as my custom type here. In edit.cfm change the line
that says
<cfset tempObject =
CreateObject("component",application.types.dmnews.typepath )> to
<cfset tempObject =
CreateObject("component",application.types._ctStaff.typepath)>. (line
27)
Don't really know what this line does.
Change <cfset
cancelCompleteURL="#application.url.farcry#/content/dmnews.cfm"> to
<cfset
cancelCompleteURL="#application.url.farcry#/admin/customadmin.cfm?module=._ctStaff/list.cfm">
(line 31) to return to your list page if you click cancel in plp.
Change stepDir="/farcry/farcry_core/packages/types/_dmNews/plpEdit" to
stepDir="/farcry/#application.applicationname#/packages/types/_ctStaff/plpEdit"
(line 40).
Comment out or delete the lines that say
<widgets:plpstep
name="#application.adminBundle[session.dmProfile.locale ].bodyLC#"
template="body.cfm">
<widgets:plpstep
name="#application.adminBundle[session.dmProfile.locale].relatedLC#"
template="related.cfm">
because they are not being used. Keep them if you decide to use them.
Thats all the changes to make to edit.cfm. 3 lines to edit 2 to comment
out!
Don't need to make any changes to categories.cfm or to complete.cfm.
They are a pure copy and paste.
Don't need to write any code to add, update or delete. It's all taken
care of. Shouldn't take you more then 20-30min to do the first time.
Before you do all this make sure you have your list.cfm page set up and
in your custom type cfc you have
<cffunction name="edit" access="public">
<cfargument name="objectid" required="yes" type="UUID">
<!--- getData for object edit --->
<cfset stObj = this.getData(arguments.objectid)>
<!--- hack to make arguments available to included file --->
<cfset stArgs = arguments>
<cfinclude template="_ctStaff/edit.cfm">
</cffunction>.
list.cfm (under <application_name>/customadmin/ctStaff) should be
<cfsetting enablecfoutputonly="yes">
<cfimport taglib="/farcry/farcry_core/tags/admin/" prefix="admin">
<cfimport taglib="/farcry/farcry_core/tags/widgets/" prefix="widgets">
<!--- set up page header --->
<admin:header>
<widgets:typeadmin
typename="ctStaff"
title="Provet Staff"
description="Staff Object"
handlerRoot="/#application.applicationname#/handlers"
metadata = "True"
permissionset="news"
>
</widgets:typeadmin>
<!--- setup footer --->
<admin:footer>
<cfsetting enablecfoutputonly="no">
It took me a really long time to get to this point with the extreme
lack of documentation but it is really simple once you get your head
around it. I hope this helps others too.
Good Luck
Beenish
Rachel Maxim wrote:
> Does anyone have a sample edit handler for a Custom Type you've developed
> that you'd be willing to share as an example? I'm trying to use the
> example/tutorial off of Brendan Sisson's old website, but the code for the
> edit handler is not in the PDF I have and the site is no longer online.
> Still trying to grasp just what goes on in the edit.cfm page and what I need
> to write manually vs what Farcry already does. I checked out the
> built-in type files but they all use the PLP syntax (not quite up to speed
> on that yet) and I'm looking for just traditional html/cf.--
Rachel Maxim
[EMAIL PROTECTED]
h 301.770.8932
c 240.355.8041
w 240.235.9748
--
Rachel Maxim
[EMAIL PROTECTED]
h 301.770.8932
c 240.355.8041
w 240.235.9748
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "farcry-dev" group.
To post to this group, send email to farcry-dev@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/farcry-dev
-~----------~----~----~----~------~----~------~--~---
Reply via email to