Save text in Rich Text Editor to page.

Permalink
I have added a rich text editor to one of my profile pages where a user should be able to input text, save it as a .txt to this same page, then come back later to either edit or download the file. I've got the editor in place. How do I create the action to make this happen? Is the method get or post? I don't understand how form action works. But this can't be that difficult. It's going on right here, at this page with questions and answers. How'd they do that?

 
jordanlev replied on at Permalink Reply
jordanlev
Is this a one-off thing on just that one page of your site, or do you intend it to be placed in other places throughout the site as well? If you only need it in one place, you want to use the "single_page" feature. If it needs to go in multiple places, you can either build a block or create an "external form".

Depending on which way you go, you build it slightly differently, but the basic idea is you include a special tag in your form action and then there's a separate "controller" file that has a function which responds to that action.

The one thing that's going to be tricky for you is allowing inputted text to be downloaded as a .txt file. Not impossible, but requires a little bit of trickery.

Post some more details (specifically, if this needs to be a block or if it can just be on one page in your site) and I can help you out with next steps.

-Jordan
smallgoodthing replied on at Permalink Reply
Hey, Jordan. Thanks for your comment. Each user will have a Rich Text Editor at their profile, one of the subpages. So on the front-side there will be more than one page with a rich text editor, as long as more than one user has registered at the site; but only one page (/profiles/files) on the back-side. I previously attempted to use a file uploader, with which you helped me out, instead of this, the rich text editor / textarea. It doesn't really have to be a rich one. But the site's a place where writers can share their stories and poems, so a text box that's capable of italicizing text and changing a bunch of other stuff to make the text look jazzy within the area would be preferable.

So I've added a modified version of the private messages system (model, single_page, controller) and added a table, "UserSavedStories," to my mysql database. Believe it or not it works, kind of. But the mysql table's busted, which is probably my bad. I can only access the modified version of concrete5's user mailbox, "/profile/files/view_storybox." Some help would be great. Thanks again.
jordanlev replied on at Permalink Reply
jordanlev
Unfortunately I can't help much with your current issue -- I'm not too familiar with modifying the built-in profile/user system, and the problem you describe with the database could be any of a million different things. Without seeing the actual system it's impossible to answer on a forum -- sorry :(