htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Add-Ons:
Using Placeholder for CMS Comment Tags


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


Cy_Trek
New User

Nov 26, 2004, 2:16 AM

Post #1 of 1 (5358 views)
Shortcut
Using Placeholder for CMS Comment Tags Can't Post

Hi,
I'm writing a CMS and I use comment-tags for template replacement.
For example <!--#PAGE#home#--> is replaced from the CMS-processor with the content of the web-page "home".

Now I'm searching for a way to edit such tags with an img-placeholder in htmlArea v3.0rc-1.
Or in other words: I want to write a plugin wich have a button to insert such CMS-comment-tag,
visible as an clickable img-tag but when I submit the textarea I need the comment-tag in the html-code.

I found a solution in htmlarea v2 but I can't port it.
There I used a RegExp while updating the editor and switching the editor mode:


Code
  function editor_updateOutput(objname) {   
...
contents = contents.replace(
/<img id=\"PAGE_INFO#((.|\s)+?)\" ((.|\s)+?)name=\"MyPageInfo\">/gi,
'<!--#PAGE_INFO#$1#-->');
...
}


function editor_setmode(objname, mode) {
...
if (mode == "textedit" || editor_obj.tagName.toLowerCase() == 'iframe') {
...
contents = contents.replace(
/<img id=\"PAGE_INFO#((.|\s)+?)\" ((.|\s)+?)name=\"MyPageInfo\">/gi,
'<!--#PAGE_INFO#$1#-->');
...
} else {
...
contents = contents.replace(
/<!--#PAGE_INFO#(.*?)#-->/gi,
'<img id=\"PAGE_INFO#$1\" src=\"images/ed_about.gif\" title=\"PageInfo \($1\)\" name=\"MyPageInfo\">');
...
}
...
}



I found this solution while checking out http://www.webstationone.com/test/htmlarea/
cause there is an button to insert an anchor-tag but visible as an img.

Have anyone an idea wich things are necessary to implement such function in an v3.0 plugin?

(This post was edited by Cy_Trek on Nov 26, 2004, 2:21 AM)

 
 
 


Search for (options)