Home
TeamSite
using custom CSS in visual editor
suresh_anand
I wd like to use my CSS ,to customize visualformat editor.The document says i have to put some java script code on the page.Which page is this one?datacapture.cfg?or presentation templates?This is not clear?Any help wd be appreciated
Thansk
Find more posts tagged with
Comments
LooseCannon
The VF refereneces the css in the visualformatcfg.xml:
.
.
<standard autoclean="true" publish="cleanhtml">
<style publishstyles="false" href="[eWebEditProPath]/ektnormal.css" preservewordstyles="true"/>
.
.
To apply your custom css change the href value, for example:
.
.
<standard autoclean="true" publish="cleanhtml">
<style publishstyles="false" href="[eWebEditProPath]/mycustom.css" preservewordstyles="true"/>
.
.
suresh_anand
I have different CSS files .I want to change editor for different pages.I want to use something like applying stylesheets to editor per page.The document says ,we need top put some javascript on the pages.But which page ?Is it datacapture.cfg?,or presentation templates...The document is not a clear one
LooseCannon
Sounds like you want to apply custom VF editors to different DCTs???
If thats true, do the following to each datacapture.cfg
Explicitly call the custom visualformat cfg file for the TextAreas
DCT1 use:
<item name="Example_1">
<textarea rtf="t" external-editor="visualformat" external-editor-config="visualformatcfg.xml" rows="200" cols="600" required="t" wrap="virtual"></textarea>
</item>
DCT2 use:
<item name="Example_2">
<textarea rtf="t" external-editor="visualformat" external-editor-config="visualformatcfg2.xml" rows="200" cols="600" required="t" wrap="virtual"></textarea>
</item>
and so on ...
What doc are you looking at?
suresh_anand
I am looking at VisualFormat Developers guide .In that there is a section which says Style sheet.Under that another section Applying Style sheets.It says like this
Adding a Style Sheet to a Single Page
1. Open the page to which you want to add a style sheet.
2. Set the styleSheet parameter by adding JavaScript to the page
before the editor is created.
<script language="JavaScript1.2">
<!--
eWebEditPro.parameters.styleSheet = "/yourpath/xyz.css";
// -->
</script>
<!-- code to place the editor on the page goes here -->
Where i should place this java Script? in .cfg or presentation template?
LooseCannon
I assume your in the 5.5.2 environment?? I'm still in 5.0.1 and have to use the style tag for each VF instance. Seems to me one would add the javascript to the page your using the VF. So if your using VF's in a DCT than the javascript should be in the datacapture.cfg. I don't understand why you would apply the css in the page unless you want to dynamically change it?
suresh_anand
I tried adding the javascript at the top of datacapture.cfg
like this
<script language="JavaScript1.2">
eWebEditPro.parameters.styleSheet = "policies.css";
</script>
But i am getting Error like this.Do you hv a sample of .cfg with Javascript in it
Templating Error Page
An exception was thrown: Error parsing Data Capture Template of sureshcategory/sureshdatatype: Stopping after fatal error: The XML declaration may only appear at the very beginning of the document
LooseCannon
I've never applied a style sheet to a VF the way you're trying to. I have come up with the same result though, using the first of the three methods described under 'Applying Style Sheets'
Gregg Faus
The text from the manual is taken out of Ektron's documentation and isn't really relevant to VisualFormat environment. This particular section describes javascript you would add if you had control over the page in which the editor was placed. In this case, it's the datacapture servlet page. But of course you cannot modify that so you stuck with setting the stylesheet manually in the visualformat config file.
So do as LooseCannon described and use a custom visual config file and stylesheet for every DCT you wish to use it on.
-gf
suresh_anand
Thank you.Now i got what it is.I tried writing different config files for diff DCT.It works
Thank you guys