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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Upload via Content page


Go to End


2 Posts   1584 Views

Avatar
Marlie511

Community Member, 36 Posts

29 September 2009 at 9:58am

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

Community Member, 131 Posts

30 September 2009 at 2:18pm

Edited: 30/09/2009 2:40pm

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:
http://doc.silverstripe.com/doku.php?id=htmleditorconfig
http://silverstripe.org/general-questions/show/259503?start=0#post259582
http://ssbits.com/customising-the-wysywig-editor-in-v2-3-2-tinymce/

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: http://doc.silverstripe.com/doku.php?id=modules:external-authentication
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: http://doc.silverstripe.com/doku.php?id=modules:external-authentication and/or here: http://ssbits.com/ and of course tell us about your post on the forums)

I hope I provided some usefull hints ;-)