Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Visual forma custom commandt
mishka
Hi,
I've tried to use an example provided in the tst.vf.600.dev.pdf (page 36) to create a simple custom command for the VF. The command gets displayed on the menu bar, however it doesn't do anything. Perhaps I'm misreading the instuctions, can anyone tell where exactly the customised Js function
function eWebEditProExecCommand(sEditorName, strCmdName, strTextData, lData)
{
if("jsextcompany" == strCmdName)
{
eWebEditPro.instances.MyContent1.editor.pasteHTML("My World Com®<BR>");
}
return(true);
}
should go in a datacapture.cfg
Thanks in advance!
Find more posts tagged with
Comments
Gregg Faus
I haven't read up on this but I would assume that it'd go in a script tag at just above the ruleset tag in datacapture.cfg. Or you could just save it out as a .js file and reference the .js file in datacapture.cfg.
mishka
Hi gfaus,
Thanks for the answer, but I've tried that, it didn't work. Even tried to create a small html page with the VF editor, still no luck. :-(
Regards,
Misha.
Gregg Faus
I just took a look at the VisualFormat document and this code must be reference in the visual format config file, not the datacapture.cfg. You'll need to provide a custom config in the text field in datacapture.cfg like so:
<textarea cols="41" rows="20" wrap="virtual" external-editor="visualformat" external-editor-
external-editor-config="custom.xml"/>
Then in your VF config (custom.xml), place your custom code. I haven't done this so I cannot tell you where exactly, but it is in the document.
Hope that helps.
Lex
Whenever I've added custom commands to the VisualFormat control it's a two step process:
1) Add the elements to to the .xml config file for VisualFormat
2) Add the handler in ewebeditproevents.js.
If you look at the format of the existing commands in ewebeditproevents.js you can figure out what you'll need to do. Ektron's website may have additional information on this.
Darryl Luther
darryl.luther@weyerhaeuser.com
Senior Web Analyst
Weyerhaeuser
mishka
Lex,
After putting the js function into ewebeditproevents.js, it's seems to be working fine! Thanks for the help!
It's just not what it says in manual. According to it you can put the js code anywehre you want ... :-(
Regards,
Misha.
jerm
Yep.. that will work fine..
But one problem is with upgrades and sometimes patches and/or SPs the ewebeditproevent.js file gets replaced. The documentation says you should include in the customevents.js file (or the like) your custom command and to include this as an include element in ewebeditpro.js as such:
var eWebEditProIncludes = [
"ewebeditproevents.js",
"customevents.js",
"ewebeditprodefaults.js",
"ewebeditpromedia.js",
eWebEditProMsgsFilename,
"ewep.js"];
But, of course, this doesn't work. Do you know of another way to get a custom include js file to work, instead of modifying the ewebeditproevent.js file?
It would be good to not have to put all our custom code in ewebeditproevent.js.
Thanks
Lex
I don't know of any other way to get it to work. Trust me, I tried everything the documentation said to do and it was all to no avail. As for the file being replaced during a patch, etc... we keep all of the modified files in source control and maintain a master list of modified TS files. We have applied several patches to date and have not had a problem with it.
Darryl Luther
darryl.luther@weyerhaeuser.com
Senior Web Analyst
Weyerhaeuser
jerm
<Smiles>.. I was hoping you wouldn't say that. Thanks for your response on this.
- Jermaine