Jump to content


Use Xinha to insert Snippet


  • You cannot reply to this topic
3 replies to this topic

#1 Labsy

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 07 September 2006 - 03:07 PM

I faced with usual problem when using Etomite:
end users are not familiar with coding, and entering something like [!SomeSnippet?ID=123!] is too much for them to learn. Also, even I as admin must take a look at Snippets library or existing Snippet insertions to determine the proper formatting.

So, my idea was to use Xinha (or other editor) and to implement Snippet insertion into comething click-to-insert.

I found "Insert Snippet" plugin in Xinha, but I am totally lost with plugin settings.

What would I like to do?
- In editor there would be a button to insert snippet. This might be simply done by enabling "insert Snippet" plugin for Xinha.
- When user clicks on button, new window opens and there are some sample Snippets there. I would like there to have, for example:
Encode Mail Link
Insert FeedbackForm
Insert Guestbook

User would simply click the desired option and editor would insert properly formated snippet code.

Anybody yet tried something like this?

#2 Labsy

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 07 September 2006 - 03:29 PM

Actually,
I have problems getting Xinha to work with .php, not .js portion of InsertSnippet plugin.

InsertSnippet plugin has a section, which says:
HTMLArea.Config.prototype.InsertSnippet =
{
  'snippets' : _editor_url+"plugins/InsertSnippet/snippets.js",
  'css' : ['../InsertSnippet.css'],
  'showInsertVariable': true
};
If I change lline 3 at the end to call snippets.php instead of snippets.js, plugin does not work anymore.

Anyone more experienced?

#3 Labsy

    Etomite Forum Newbie

  • Member
  • 23 posts

Posted 08 September 2006 - 07:48 AM

To further self-discuss this post,
I managed to use Xinha InsertSnippet plugin to insert snippets into new web pages, for example:
[[email_encode?email=my@mail.com]]
or
[!Gallery?galid=abcd!]
or
[!CommentsForm?id=abcd!]

My idea by using InsertSnippet plugin with .PHP instead of .JS was to automatically append parameters to snippet code, so user would not need to adjust parameters manually. But I do not have enough knowledge of Java to pass and use parameters from Xinha editor to this plugin, for example, I would like to pass selected e-mail address to append it to snippet as parameter, or generate random code to append it to CommentsForm as id...
Anyways, regardless to some manual work after you add snippet, this Xinha functionality is very usefull.

End of blog :rolleyes:

#4 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,524 posts
  • Gender:Male

Posted 08 September 2006 - 01:19 PM

I wouldn't get too worked up over the idea of having the Etomite development team writing plugins for the available WYSIWYG editors... It's more difficult than one might initially imagine and, due to the fact that we don't have control over third-party software changes, doing so could be a logistical nightmare... Sure, additional plugins are a neat idea - but...

It should be noted that all suggestions and ideas are taken into consideration for inclusion in future releases where integrations might be easier but, at the same time, are evaluated as to how they can be implemented and maintained... :eto:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users