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)
Dynamically set CSS for VF config?
System
We have an infrastructure set up in TeamSite so that the DCT is dynamically put together when called. This allows for resuse of fields when possible and short DCT configurations.
Let's say you have 2 sites, each in its own branch. Each branch has its own css which is exactly the same except for the color palette (e.g. in Site_A the header is blue and in Site_B the header is red). Is there a way to use the same textarea item for both branches and configure the VF tool to accommodate the different color palettes with 2 different css?
In other words, could the VF_config.xml for the textarea of the DCT be determined depending on the branch? Or would you have to create two separate templates where each template was pointing to its own VF_config.xml ?
What we're hoping to avoid is having to recreate essentially the same template just to call a different VF_config.xml for a different color heading.
The version of TeamSite is 6.1
Thanks.
Find more posts tagged with
Comments
brandon1
If you read the Visual Format manual one way is to have the external-editor-config point to a valid url that returns xml. Hence a cgi could look at the branch (passed in of course) and return an appropriate xml string (vf config).
Current Project: TS 6.1
Environment: Windows
Migrateduser
Thanks for your comment, Brandon -
I still can't seem to dynamically switch CSS that the VFconfig is looking at dynamically. The platform is Solaris TS 6.1
I attached the DCT.
When I look at the access log, it doesn't look at the ektron.css that I've set in the script but at the css defined in the VF flash_table_img_v3.xml.
Anyone know if this is an issue in 6.1?
Thanks again
==================================
Here's a test DCT I created:
<?xml version="1.0" encoding = "UTF-8" standalone="no"?>
<!DOCTYPE datacapture SYSTEM "datacapture5.0.dtd">
<data-capture-requirements type="content" name="GenericPage">
<ruleset name="GenericPage">
<script>
var eWebEditPro = top._dcWin.eWebEditPro;
alert("eWebEditPro"+eWebEditPro);
alert(top._dcWin.top.eWebEditProPath);
var strsrc=top._dcWin.top.eWebEditProPath + "ektnormal.css";
alert(strSrc);
alert (eWebEditPro.properties.config);
eWebEditPro.properties.styleSheet = strSrc;
alert (eWebEditPro.properties.styleSheet);
</script>
<root-container name="test">
<item name="TEST_DESCRIPTION">
<label>Description:</label>
<textarea cols="60"
rows="13"
external-editor="visualformat"
external-editor-config="/iw/vf_configs/flash_table_img_v3.xml">
</textarea>
</item>
</root-container>
</ruleset>
</data-capture-requirements>
CodeMonster
I think he is saying to have a call to a CGI program replace the
flash_table_img_v3.xml file which would create and pass a dynamic XML file to the editor with the correct CSS link in it.
CodeMonster
If you want to use JavaScript, maybe this will help point you in the right direction. This is untested and I'm sure it won't work without updating the path to VFE (aka something like _dcrwinblahblah). Hopfully it will get you started.
<script language="JavaScript">
function setStyleSheet(strEditorName, strCSS)
{
eWebEditPro[strEditorName].setProperty("StyleSheet", strCSS);
}
</script>
<script language="JavaScript">
eWebEditPro.onready = "setStyleSheet(eWebEditPro.event.srcName, '/yourpath/xyz.css')";
</script>