Hey guys, I have a instance where i'm using FCKEditor to create an HTML article. The users should be able to use the templates to pre-load templates we've created for them. That works out great, my challenge is that I'm actually REGEX'ing out the Title, subtitle, information out of the finalized HTML.
The method I was using was filling the FCKEditor with HTML... where the user would type in the "title" of the article i was placing a
<!-- startTitle -->Type in the title here<!-- endTitle -->
then i was regexing out the data between the two comments.
I've just found out that if the user backspaces to remove the initial text line "Type in the title here" then backspaces again, its actually removing the comment as well...
Any ideas on a uniq identifier to place in the cell so i can regex out the data?
Thanks guys,
Jason
The method I was using was filling the FCKEditor with HTML... where the user would type in the "title" of the article i was placing a
<!-- startTitle -->Type in the title here<!-- endTitle -->
then i was regexing out the data between the two comments.
I've just found out that if the user backspaces to remove the initial text line "Type in the title here" then backspaces again, its actually removing the comment as well...
Any ideas on a uniq identifier to place in the cell so i can regex out the data?
Thanks guys,
Jason
RE: using FCKeditor to create articles, ideas
Why not use a normal text input on the same page for the title and other metadata?
If you have to do it this way, take a look at the ProtectedSource feature - this might solve your problem.
Another option ... if its just title, you'd be better off using a tag rather than comments. <h1> is probably safest .. that way it can be reapplied in the event that it is deleted (enable the FontFormat option in the toolbar, which can be customised to)
Maybe you could use other heading styles (h2, h3 etc) for any other metadata. Then you can also apply CSS so it stands out. The CSS could even put a little image to the left of the title to show what it is.
RE: using FCKeditor to create articles, ideas?
I know... using free form to edit structured data does seem like an overly comlicated challenge and there is a small learning curve to any user desiring to use these features (which all are going through a training session anyway, so its not that much of a challenge)
The biggest thing is that eventually they have to have control over the look of the final product anyway! so even if i use set in stone forms to create the structured data, they still should be able to edit it... then the same challenge of "how do i save this data" comes right back around full circle.
So I'll check out the ProtectedSource idea... seems like that may be a nice solution.
Thanks for the ideas!
Jas