OK, I final have it sorted - gone around in circles, for those that have
been following my little adventure, but now have something I am (mostly)
happy with.
Tim suggested that I mod a core file, but as I am reluctant to do that,
I ended up just substringing the html link that comes from the site tree
when selecting 'insert'. Is it possible to added items to the case
statement from within my application, rather than making changes to the
core file (overview.cfm).
I have got rid of the idea of adding my custom type to the create
submenu. Instead, I have a button on the (plp) form that loads the site
menu into the right hand side of the page. Once the insert has been
selected, the function (on my form) puts a substringed portion into the
link field, then loads the custom menu back. I will have to get cancel
to do this too.
Code snippets from the form:
<input type="text" name="link" value="#output.link#"
class="formtextbox" maxlength="255">
<input type="button" value="Load Site Tree"
onClick="top.treeFrame.location='/farcry/navajo/overview_frame.cfm?rooto
bjectid=#APPLICATION.NAVID.HOME#';" title="Load site tree, right-click
page and select insert" style="width: 80px;">
<script language="JavaScript">
// make insert menu option appear
function insertHTML( html )
{
window.document.editform.link.value = html.substring(17,71);
//put custom menu back
top.treeFrame.location="/farcry/admin/customadminMenuFrame.cfm?parenttab
index=1&subtabindex=2";
}
</script>
Hope this is helpful for other people. Please let me know if there is a
better/easier way of doing this. I have spent like 4-5 hours working on
this to save the client 40 seconds a week of cut and paste time!!
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tim
Lucas
Sent: Sunday, 18 April 2004 10:35 AM
To: FarCry Developers
Subject: [farcry-dev] Re: added link from site tree - attempt 3
Andrew Mercer spoke the following wise words on 17/04/2004 8:43 PM EST:
> I would just like objectId=A3BF0A78-CF17-EE39-588BD87F8E47E4FD to be
> returned.
You need to redefine menuOption_Insert() if you want to change the HTML
that is being inserted. Have a look in:
farcry_core/tags/navajo/overview.cfm
If all you want to do is get the objectid using javascript, then:
function menuOption_Insert()
{
var p = parent['editFrame'];
if( p.insertaObjIds ) p.insertaObjIds( aSelectedIds );
else if( p.insertObjId ) p.insertObjId( lastSelectedId );
else p.myFunction(lastSelectedId);
}
It should call myFunction(objectid) when insert is called.
If you want to change the HTML that's inserted, then just copy and paste
menuOption_Insert() from overview.cfm and add another case for your
object type.
-- tim
www.toolmantim.com
---
You are currently subscribed to farcry-dev as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004