I'd like to use the new version of FCKEditor, but the user files structure does not match our existing content management system.
I would like the capability to set the User Files Path as an attribute of the CFMODULE function, directly where the editor is loaded. I'm scrambling through the code to make this happen, but I'm not sure how to pass the attribute to the connector.
Is there a quick and efficient way to do this? I'm hoping FCKEditor will support this capability in the future, as it seems useful for many users.
Thanks in advance,
Ron Raley
I would like the capability to set the User Files Path as an attribute of the CFMODULE function, directly where the editor is loaded. I'm scrambling through the code to make this happen, but I'm not sure how to pass the attribute to the connector.
Is there a quick and efficient way to do this? I'm hoping FCKEditor will support this capability in the future, as it seems useful for many users.
Thanks in advance,
Ron Raley
RE: Changing the User Files Path in ColdFusion
you might want to consider using a different file manager... maybe...
http://www.webworksllc.com/cffm
CFFM integrates nicely with fckEditor, and you can use your existing coldfusion skills to manage the userFiles directory stuff however you want.
Rick
RE: Changing the User Files Path in ColdFusion
Thanks for the recommendation. However.... ew. The CFFM needs some alignment and css to make it look nicer.
It would also be better to not have to manage two separate systems.
Any other suggestions? There has to be a way to pass the attribute easily. Thanks - Ron.
RE: Changing the User Files Path in ColdFusio
Email me if you want and I'll dig out the mods I made and fire'em off your way.
RE: Changing the User Files Path in ColdFusion
Since it is session specific, a user can open a browser and load FCKEditor. Lets say they decide to multitask and open another browser window with FCKEditor. When they go back to the original window, it will have incorrect mappings.
I think I'm going to stay with it though unless someone comes up with an easier way. Thanks!
RE: Changing the User Files Path in ColdFusion
Lets say your web site has the following structure:
/ (root)
/includes/
/tags/
/uploads/
/uploads/page001files/
/uploads/page023files/
/uploads/page097files/
Where the uploaded files go into the sub-subfolders above, based on one subfolder per page (or user or whatever).
/Uploads/ is never going to change in such a layout, right? As such, go ahead and set application.userFilesPath as recommended in the FCK docs. If it does change, then add in session.userFilesPath as described in previous posts.
Next, put this code in just before you call the editor:
<cflock scope="SESSION" type="EXCLUSIVE" timeout="10">
<cfset session.theFolder="page097files">
</cflock>
Now, in connector.cfm replace
<cfparam name="URL.Type" type="string">
with
<!--- <cfparam name="URL.Type" type="string"> --->
<cflock scope="Session" type="readonly" timeout="3">
<cfset url.Type=session.ThisPage>
</cflock>
There is no need to fool with form posts to remove doubled slashes. Also, assuming your root/parent upload folder will never change, you can now set that as an application variable from within an isdefined, probably in /Application.cfm.
RE: Changing the User Files Path in ColdFusion
In connector.cfm, change this:
<cfparam name="URL.Type" type="string">
to this:
<!--- <cfparam name="URL.Type" type="string"> --->
<cfset url.Type="">
This will force the folder type to an empty string and solve MOST of the problem. However placing any files with one of the browser tools will result in code like this
/userfiles//myimage.gif
/userfiles//mydoc.pdf
Note the doubled slash. It will work but to tidy it up I use this code where the form posts, which I would rather not but can't see an easier way around at the moment:
<cflock scope="server" type="READONLY" timeout="10">
<cfset UserFilesFind=server.userfilespath&"/">
<cfset UserFilesReplace=server.userfilespath>
</cflock>
<cfset form.wysiwyg=Replace(form.wysiwyg,UserFilesFind,UserFilesReplace,"ALL")>
I am using the server scope above because it is a part of the default file set. I have added a session scope to connector.cfm and use it on my own stuff as already described.
The code above is probably best handled by breaking it out into a cfinclude, coupled to a dynamic variable name for the sake of easy re-use. Haven't gotten further with the coding. Any improvements welcome as this is just roughed out with an axe.
RE: Changing the User Files Path in ColdFusion
RE: Changing the User Files Path in ColdFusion