Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

Upload via Content page


Reply

2 Posts   1127 Views

Avatar
Marlie511

29 September 2009 at 9:58am Community Member, 36 Posts

I am trying to figure out a way for users to upload straight from the content page when they link. This way they don't have to switch tabs. I know other CMS systems use with the FCKeditor and TinyMCE. What would I need to do to get this in Silverstripe? Can it be done?

Also, if we have users set with LDAP and logged in, is there a way to script their user account straight to a folder in assets with their name on it?
(I am going to have lots and lots of users who will be using the subsites.)

Avatar
theAlien

30 September 2009 at 2:18pm (Last edited: 30 September 2009 2:40pm), Community Member, 131 Posts

Hi,

On the first one: TinyMCE comes bundled with SilverStripe (it's the actual editor you see in the backend).
If you would like to modify the functionality of TinyMCE these links might help:
[url]http://doc.silverstripe.com/doku.php?id=htmleditorconfig[/url]
[url]http://silverstripe.org/general-questions/show/259503?start=0#post259582[/url]
[url]http://ssbits.com/customising-the-wysywig-editor-in-v2-3-2-tinymce/[/url]

If you need a separate upload-field, you can simply add it with:

$fields->addFieldsToTab("Root.Content.Main", array(
new ImageField("myImage","My Image Field")
));

This will add the field below the editor.

On the second one: I don't exactly know; I have no experience with this.
But after reading this article: [url]http://doc.silverstripe.com/doku.php?id=modules:external-authentication[/url]
I guess you have to get the username from the member-table.
Next digg into onBeforeWrite to learn how to automatically create a folder with their name on it
Then you have to figure out a way to link all ImageFields/FileFields automatically to the folder of the logged in-user - you might have to extend FileField and/or it's subclasses for that.
Please look into UncleCheese's ImageGallery-module to get a clue about automatically creating and opening specific assets-folders.
Finally: post back to the forums to tell us what you did (or even better: write a recipe, post it here: [url]http://doc.silverstripe.com/doku.php?id=modules:external-authentication[/url] and/or here: [url]http://ssbits.com/[/url] and of course tell us about your post on the forums)

I hope I provided some usefull hints ;-)