YAFLogo

exhumed
  • exhumed
  • 54.4% (Neutral)
  • YAF Camper Topic Starter
11 years ago
Hi All,

I am creating a site based around the yaf sample web application, and I need to include an editor for users to submit feedback on a single page.

Rather than grab the CKEditor.NET assembly and use it as outlined here  I was swondering if it would be easy to create an instance of the standard yafEditor on my page using some javascript functions?

If I included the following in my aspx page how easy if at all possible is it to hook up the yafEditor to it?

I'm guessing I'd have to use something like <%=YafTextEditor.ClientId%> in the javascript as the control id will obviously be different when the page is rendered.

Any help or advice is appreciated

Thanks

Exhumed

Sponsor
s3b4k
  • s3b4k
  • 59.6% (Neutral)
  • YAF Camper
10 years ago
actually I tried the exact same thing but failed(was getting a bunch of javascript errors). Look at the implementation of forum/controls/postmessage.ascx you will see that you need to use the class forumeditor

// get the forum editor based on the settings

string editorId = this.Get().ForumEditor;

if (this.Get().AllowUsersTextEditor)

{

// Text editor

editorId = !string.IsNullOrEmpty(this.PageContext.TextEditor)

? this.PageContext.TextEditor

: this.Get().ForumEditor;

}

// Check if Editor exists, if not fallback to default editorid=1

this._forumEditor = this.Get>().GetBy(editorId, false)

?? this.Get>().GetBy("1");

// Override Editor when mobile device with default Yaf BBCode Editor

if (this.PageContext.IsMobileDevice)

{

this._forumEditor = this.Get>().GetBy("1");

}

this.EditorLine.Controls.Add(this._forumEditor);


the signature
robert82
  • robert82
  • 51.2% (Neutral)
  • YAF Forumling
8 years ago
Did you find a solution or someone else?

Would like to do the same

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
8 years ago

Did you find a solution or someone else?

Would like to do the same

Originally Posted by: robert82 

No that is not possible. The editor can onyl work inside yaf.