Modifying the content editor web part
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Modifying the content editor web part

 
Post new topic   Reply to topic    Windows Server Forum Index -> Windows Services
Author Message
Jill
Guest





Posted: Tue Oct 18, 2005 4:51 pm    Post subject: Modifying the content editor web part Reply with quote

Has anyone successfully modified the content editor webpart to employee
a specified style sheet? This is really important for our site. I
haven't been able to find another content editor that can accomplish
this. Has anyone else?

Please let me know.

Thanks,
Jill
Back to top
James Mueller
Guest





Posted: Tue Oct 18, 2005 8:51 pm    Post subject: RE: Modifying the content editor web part Reply with quote

In the source for the Content Editor WebPart you can control style and it
will over write the default ows.css. However keep in mind that data in the
Content Editor Web Part isn't searchable by the default WSS full-text search.
Content Editor Web Part data is held in binary format and there isn't a
conversion out of the box to report the results back to the user.
--
Thanks,

James Mueller
http://www.sharepointcommunity.com


"Jill" wrote:

Quote:
Has anyone successfully modified the content editor webpart to employee
a specified style sheet? This is really important for our site. I
haven't been able to find another content editor that can accomplish
this. Has anyone else?

Please let me know.

Thanks,
Jill

Back to top
Jill
Guest





Posted: Wed Oct 19, 2005 4:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

Hi James,

I've created a separate css file that overrides all of the necessary
pieces of the SPS and OWS css files... but for some reason, when I add
my new styles for the Content Editor updates, it does not take. Any
Ideas??

Here is what I added:
..ms-WPBody {
color: #000000;
font-size: 8pt;
font-family: verdana, arial, helvetica, sans-serif;

}
..ms-wpbody p h1, .ms-wpbody h1 {
font-family: Arial;
font-size: 16pt;
font-weight: 700;
Color: #dc5000;
padding-bottom:6px;
padding-left:5px;
padding-right:0px;
}
..ms-wpbody p h2, .ms-wpbody h2 {
font-family: Arial;
font-size: 14pt;
font-weight: 700;
Color: #dc5000;
padding-bottom:6px;
padding-left:5px;
padding-right:0px;
}
..ms-wpbody p h3, .ms-wpbody h3 {
font-family: Arial;
font-size: 10pt;
font-weight: 700;
Color: #dc5000;
padding-bottom:6px;
padding-left:5px;
padding-right:0px;
}
..ms-wpbody a:link {
font-family: Verdana, serif;
font-size: 8pt;
color: #ffb400;
font-weight: bold;
text-decoration: none;
}
..ms-wpbody a:visited {
font-family: Verdana, serif;
font-size: 8pt;
color: ffb400;
font-weight: bold;
text-decoration: none;
}
..ms-wpbody a:hover {
text-decoration: underline;
}
Back to top
James Mueller
Guest





Posted: Wed Oct 19, 2005 4:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

I'll give this a whirl, but I'm by far not a CSS expert. However, I do have
a few questions.

Regarding the (..) have you tried using 1 (.), I personally haven't seen the
double period used before. Also, have you tried wrapping the style in
<style></style> tags?

...ms-WPBody
{
color: #000000;
font-size: 8pt;
font-family: verdana, arial, helvetica, sans-serif;
}

When adding HTML code to the Source in a Content Editor Web Part I find that
using FrontPage 2003 to actually create the code or simply as an editor works
much better. Then you can utilize things like smart tags to help assist in
the development of the code.

--
Thanks,

James Mueller
http://www.sharepointcommunity.com


"Jill" wrote:

Quote:
Hi James,

I've created a separate css file that overrides all of the necessary
pieces of the SPS and OWS css files... but for some reason, when I add
my new styles for the Content Editor updates, it does not take. Any
Ideas??

Here is what I added:
..ms-WPBody {
color: #000000;
font-size: 8pt;
font-family: verdana, arial, helvetica, sans-serif;

}
..ms-wpbody p h1, .ms-wpbody h1 {
font-family: Arial;
font-size: 16pt;
font-weight: 700;
Color: #dc5000;
padding-bottom:6px;
padding-left:5px;
padding-right:0px;
}
..ms-wpbody p h2, .ms-wpbody h2 {
font-family: Arial;
font-size: 14pt;
font-weight: 700;
Color: #dc5000;
padding-bottom:6px;
padding-left:5px;
padding-right:0px;
}
..ms-wpbody p h3, .ms-wpbody h3 {
font-family: Arial;
font-size: 10pt;
font-weight: 700;
Color: #dc5000;
padding-bottom:6px;
padding-left:5px;
padding-right:0px;
}
..ms-wpbody a:link {
font-family: Verdana, serif;
font-size: 8pt;
color: #ffb400;
font-weight: bold;
text-decoration: none;
}
..ms-wpbody a:visited {
font-family: Verdana, serif;
font-size: 8pt;
color: ffb400;
font-weight: bold;
text-decoration: none;
}
..ms-wpbody a:hover {
text-decoration: underline;
}

Back to top
James Mueller
Guest





Posted: Fri Oct 21, 2005 4:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

Are you using the <style> tags around your elements?

Below is the example we setup in our environment that works fine. You can
also assign non-sharepoint styles, however this is a good example because it
shows how you can over write the styles using your own style elements
-------------------------------------------------------------------------------
<style>
..ms-wpbody
{
font-family: arial;
font-size: 12;
color: #GGGGGG;
font-weight: bold;
}
</style>

Testing Content Editor Web Part!

--------------------------------------------------------------------------------

--
Thanks,

James Mueller
http://www.sharepointcommunity.com


"Jill" wrote:

Quote:
Hi James,

I'm not using (..) anywhere. Just the single (.)
We wanted to keep the users from messing with Frontpage. Our content
owners are not developers and we don't want them changing things they
don't understand. Just a percaution.

I'm still trying to figure out why it doesn't pick up the changes??
Strange. Everything else does.

Thanks for trying though. Your time is greatly appreciated :)

Jill

Back to top
Jill
Guest





Posted: Fri Oct 21, 2005 4:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

Hi James,

I'm not using (..) anywhere. Just the single (.)
We wanted to keep the users from messing with Frontpage. Our content
owners are not developers and we don't want them changing things they
don't understand. Just a percaution.

I'm still trying to figure out why it doesn't pick up the changes??
Strange. Everything else does.

Thanks for trying though. Your time is greatly appreciated :)

Jill
Back to top
James Mueller
Guest





Posted: Tue Nov 08, 2005 5:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

You have 2 options when changing Styles in SharePoint.

1. Modify the existing OWS.CSS in the SharePoint file system on the
front-end web servers. This isn't recommended because when service packs are
applied later your styles will be overwritten.

2. Create a seperate .css file with your changes in then reference them
within the web parts. This only works for the page viewer and content editor
web parts. All the other web parts are assigned styles when the ows.css is
used.

3. Create your own <style> per web part which won't be overwritten when
service packs are applied. Because you are using the content editor web part
and you don't want to use FrontPage your best bet is to create your own
<style> and place it within the Code View of the web part.

--
Thanks,

James Mueller
http://www.sharepointcommunity.com


"Jill" wrote:

Quote:
Hi James,

When adding these styles to a new style sheet, there is no requirement
for the <STYLE> tags...
Am I just going about this the wrong way??

Thanks,
Jill

Back to top
Jill
Guest





Posted: Tue Nov 08, 2005 5:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

Hi James,

When adding these styles to a new style sheet, there is no requirement
for the <STYLE> tags...
Am I just going about this the wrong way??

Thanks,
Jill
Back to top
Jill
Guest





Posted: Tue Nov 08, 2005 9:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

Thanks !!!
Back to top
James Mueller
Guest





Posted: Tue Nov 08, 2005 9:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

You'll need to create a link to your css file in the <head> tags of the
Source Editor. Then reference the styles in your markup (html code).

Example:

<head>
<link rel="stylesheet" type="text/css" href="pathtocssfile">
</head>

<body>
<table class="cssreference">
<tr>
<td class="cssreference">Testing</td>
</tr>
</table>
</body>

Your reference points maybe different that the example however this should
get you started.
--
Thanks,

James Mueller
http://www.sharepointcommunity.com


"Jill" wrote:

Quote:
So for #2, how do I update the css file the content editor web part is
supposed to use??

Back to top
Jill
Guest





Posted: Tue Nov 08, 2005 9:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

So for #2, how do I update the css file the content editor web part is
supposed to use??
Back to top
Jill
Guest





Posted: Wed Nov 09, 2005 5:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

So for #3, how would I implement that change??

I can see all the properties for the web part in the dwp file, how do I
tell it to use a different style sheet?

Thanks,
Jill
Back to top
James Mueller
Guest





Posted: Wed Nov 09, 2005 5:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

The options were only specific to the Content Editor Web Part. To answer
your question you'll use <style> tags in the Source Editor.

For Example:

<style>
..yourstyle
{
font-family: arial;
font-size: 12;
color: #GGGGGG;
font-weight: bold;
}
</style>

<table>
<tr>
<td class="yourstyle">Test</td>
</tr>
</table>

--
Thanks,

James Mueller
http://www.sharepointcommunity.com


"Jill" wrote:

Quote:
So for #3, how would I implement that change??

I can see all the properties for the web part in the dwp file, how do I
tell it to use a different style sheet?

Thanks,
Jill

Back to top
James Mueller
Guest





Posted: Wed Nov 09, 2005 5:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

You can update the CDATA tags in the dwp but it's the data that is actually
held in the Content Editor Web Part. See example below:

<![CDATA[<head>
<title>New Page 1</title>
<link rel="stylesheet" type="text/css"
href="file:///C:/Documents%20and%20Settings/James%20Mueller/My%20Documents/style.css">
</head>
<body>
<table>
<tr>
<td class="body">
test
</td>
</tr>
</table>
</body>]]>

If you are looking to reuse the web part on multiple sites you can create 1
web part, then export it to hold the data with in.

--
Thanks,

James Mueller
http://www.sharepointcommunity.com


"Jill" wrote:

Quote:
So there's no way to udpate the dwp file to reference the css file I
need?

I know there are ways to take out div tags etc. through updating the
dwp file. Just thought there might be a way to incorporate my css file
at this level.

Thanks,
jill

Back to top
Jill
Guest





Posted: Wed Nov 09, 2005 5:51 pm    Post subject: Re: Modifying the content editor web part Reply with quote

So there's no way to udpate the dwp file to reference the css file I
need?

I know there are ways to take out div tags etc. through updating the
dwp file. Just thought there might be a way to incorporate my css file
at this level.

Thanks,
jill
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Windows Services All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB