Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Configuring eWebEditPro Visual Formmatter
jamesgreen
Has anyone been able to successfully change the configuration of the eWebEditPro editor on the fly? I need to be able to point the control to a different style sheet from my template. The current config file has been modified to point to a master style sheet, but I need to be able to change to a different one for another template. Javascript sample in the documentation seems to apply to an html page and not an XML template. Any help or suggestions would be appreciated.
Tech notes: Running Teamsite 5.5.2 on Solaris 2.8. eWebEditPro has been patched to 2.6.0.7c.
James L Green
Programmer Analyst Specialist
Find more posts tagged with
Comments
dlukezic
In version 6.0, you can simply do this:
<textarea cols="60" external-editor="visualformat"
external-editor-config="vf_article.xml"
external-editor-inline="t" required="t" rows="10" wrap="off"/>
where vf_article.xml is my new configuration file. By default (without this attribute) it points to visualformatconfig.xml.
Regards,
Doreen
haplo
I don't know if it is something you can use but I had a problem like this.What I did is using a callout that call a script that create the ewebeditpro instance.
<b>the call out :</b>
<item name="HeaderBannerURL_FR" rowcontinue="t">
<text required="f" size="50" maxlength="1000">
<callout type="cgi" label="Edit Text" url="/iw-bin/iw_cgi_wrapper.cgi/test.ipl" window-features="width=800,height=600,resizable=no,toolbar=no,scrollbars=yes"/>
</text>
</item>
<b>the script :</b> I made a little quickly and is not really great,use it as example if you want.As you can see it use a xml file that here must be in you're workarea/config an must be named config_only_table...Just use a parameter to change it.
#!/ecmd/ecm/iw-home/iw-perl/bin/iwperl
use TeamSite::CGI_lite;
use TeamSite::Config;
$|=1;
my $cgi = TeamSite::CGI_lite->new();
$cgi->parse_data();
my $form_name = $cgi->{'form'}{'iw_form_name'};
my $area_path = $cgi->{'form'}{'area_path'};
my $field_value = $cgi->{'form'}{'eweb_field'};
my $element_name = $cgi->{'form'}{'iw_callback_var'};
my $item_value = $cgi->{'form'}{'iw_item_value'};
my $javascript_callback="";
#if true,the form was posted
if(length($field_value) >0)
{
#transform all " in '
$field_value=~s/\"/\'/g;
$javascript_callback="if(callback() == true) window.close();else alert('The system return an error.');";
}
else
{
#initialize the ewebeditpro with the value of the dcr
$field_value = $item_value;
}
#javascript used for the callback
print << "END";
<html>
<head>
<script language="JavaScript">
// <!--
function set_datacapture_item_value( )
{
if ((window.opener == null) ||
(window.opener.closed))
{
return false;
}
var calloutForm = eval($form_name);
if (!calloutForm)
{
return false;
}
var calloutElementFound = false;
for ( i = 0 ; i < calloutForm.elements.length ; i++ )
{
if (calloutForm.elements
.name == '$element_name')
{
calloutForm.elements
.value = document.forms[0].eweb_field.value;
calloutForm.elements
.focus();
calloutElementFound = true;
break;
}
}
if (!calloutElementFound)
{
return false;
}
return true;
}
function callback()
{
if (!set_datacapture_item_value())
{
alert('Fatal callout error.');
return false;
}
return true;
}
// -->
</script>
<title>test</title>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<script language="JavaScript1.2" src="/iw/ewebeditpro20/ewebeditpro.js"></script>
</head>
<body style="font-family: Arial; font-size: 10pt" onload="test();" >
<form method="post">
<input type=hidden name="area_path" value="$area_path">
<input type=hidden name="iw_callback_var" value="$element_name">
<input type=hidden name="iw_form_name" value="$form_name">
<table>
<tr>
<td>
END
call_eweb('eweb_field',600,300,$field_value);
print << "END";
</td>
</tr>
<tr>
<td>
<input type="submit" value="submit_it">
</td>
</tr>
<script langage="javascript">
$javascript_callback
</script>
</form>
</table>
</body>
</html>
END
sub call_eweb
{
#create an instance of ewebeditpro,config is the path to the ewebeditpro file that will be used
my $name =
@_[0]
;
my $width=
@_[1]
;
my $height=
@_[2]
;
my $value=
@_[3]
;
print << "END";
<input type=hidden name="$name" value="$value">
<script language="JavaScript1.2">
<!--
if (typeof eWebEditPro == "object")
{
with (eWebEditPro.parameters)
{
config = "/iw-mount$area_path/config/config_only_table.xml";
}
eWebEditPro.create("$name","$width","$height");
}
//-->
</script>
END
}
Migrateduser
All,
TS 5.5.2 AIX
I actually use this, and I have one different config file per branch:
<textarea
external-editor="visualformat"
external-editor-config="vf_config_royal.xml"
cols="50"
....
Paulo Gouveia
Royal Caribbean Cruises
"<i>Delivering Great Vacations Through Information Technology</i>"
patrickm
Yeah specifying a separate XML configuration file can also be done on 5.5.2 directly on the DCT, so you don't have to go upgrading!