samedi 5 mai 2012

Managing the Rich Text Editor CSS and the RTE Menus for the Wiki Pages of a SharePoint 2010 Team Site

style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">color=#ff0000>Updated 2011 November 1st


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">Introduction


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">The
wiki pages are a new feature in SharePoint 2010 that seems to replace the base
pages of SharePoint 2007. With the wiki pages, SharePoint 2010 provides a way of
not only quickly publishing content within a SharePoint site page but even more,
to manage the layout of this content more easily.
The improvement of the
publishing is due to two new features provided by the new SharePoint 2010 ribbon
when displayed in edit mode:



style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">In
this post we will focus on the Styles and Markup Styles menus and explain
how they work and even more, how to remove, add, or modify some of their items.

Regarding the items adding, we will examine all the possible solutions
and it will be a chance for the developer that wants to familiarize
with SharePoint customization to see the different approaches when wanting to
customize the product and the drawbacks pending for each.
So if you are an
advanced developper or architect, or wants a quick synthesis on the topic, I
rather advice you to move to href="http://c-lien.blogspot.com/?aHR0cDovL21vc3Nob3d0by5ibG9nc3BvdC5jb20vMjAxMC8wNi9zaGFyZXBvaW50LTIwMTAtd2lraS1jdXN0b21pemluZy5odG1sIzEuMg==">this
section of this second post
.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Anyway,
here are all the steps described in this post with anchors for a quick
consultation:


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px"> href="http://c-lien.blogspot.com/?LzIwMDkvMTIvc2hhcmVwb2ludC0yMDEwLXdpa2ktc3R5bGVzLmh0bWwjMQ==">1 - How do the Styles and
Markup Styles Menus of the wiki pages work in SharePoint
2010?

   href="http://c-lien.blogspot.com/?LzIwMDkvMTIvc2hhcmVwb2ludC0yMDEwLXdpa2ktc3R5bGVzLmh0bWwjMS4x">1.1 information for
advanced end-users (knowing basic html and CSS) and web designers

   1.2
Information for web designers and developers - Location of the CSS and loading
mode

   href="http://c-lien.blogspot.com/?LzIwMDkvMTIvc2hhcmVwb2ludC0yMDEwLXdpa2ktc3R5bGVzLmh0bWwjMS4z">1.3 - Information for web
designers and developers - CSS syntax for these styles


href="http://c-lien.blogspot.com/?LzIwMDkvMTIvc2hhcmVwb2ludC0yMDEwLXdpa2ktc3R5bGVzLmh0bWwjMg==">2 - How to manage items in
the Styles Menus of the wiki pages in SharePoint 2010? (audience: SharePoint
developers and Architects)


   href="http://c-lien.blogspot.com/?LzIwMDkvMTIvc2hhcmVwb2ludC0yMDEwLXdpa2ktc3R5bGVzLmh0bWwjMi4x">2.1 - The 2 possible
locations for the Out Of The Box CSS of  the RTE styles and thus for the
definition of the styles menus items

   href="http://c-lien.blogspot.com/?LzIwMDkvMTIvc2hhcmVwb2ludC0yMDEwLXdpa2ktc3R5bGVzLmh0bWwjMi4y">2.2 - Creating and storing
a custom CSS file.

   href="http://c-lien.blogspot.com/?LzIwMDkvMTIvc2hhcmVwb2ludC0yMDEwLXdpa2ktc3R5bGVzLmh0bWwjMi4z">2.3 - First location for a
custom Style CSS: within an HTML Form Web Part inserted in  the wiki page

   2.4
- Referencing a custom CSS file within the code of the wiki page


   2.5 -
Modifying an existing SharePoint 2010 wiki page by using the WebDav and the
FrontPage RPC protocols with Visual Studio

   href="http://c-lien.blogspot.com/?LzIwMDkvMTIvc2hhcmVwb2ludC0yMDEwLXdpa2ktc3R5bGVzLmh0bWwjMi42">2.6 - Adding a new wiki
page in the Site Pages library by using a provisioning SharePoint 2010
Feature
   href="http://c-lien.blogspot.com/?LzIwMDkvMTIvc2hhcmVwb2ludC0yMDEwLXdpa2ktc3R5bGVzLmh0bWwjMi43">2.7 - First limitation of
the wiki pages in SharePoint 2010 Foundation: there is only one available
template

   href="http://c-lien.blogspot.com/?LzIwMDkvMTIvc2hhcmVwb2ludC0yMDEwLXdpa2ktc3R5bGVzLmh0bWwjMi44">2.8 - Second limitation of
the wiki page in SharePoint 2010: it is very difficult  to remove the OOTB
RTE style


3 -
Workaround to give  its own CSS to each wiki page library of a team
site


4 - To go
further


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">style="COLOR: red">Important: do not mistake a Wiki Page of a Team Site
for a Wiki Page of an Enterprise Wiki. They are totally different since an
Entreprise Wiki is a kind of publishing site, and a Wiki Page of an Enterprise
Wiki can be based on different Wiki Page Templates.

style="COLOR: red">In this post, I will examine the Wiki Pages for a Team
Site so that this information can be used for SharePoint foundation 2010.


For more information about Enterprise Wiki:

href="http://c-lien.blogspot.com/?aHR0cDovL3RlY2huZXQubWljcm9zb2Z0LmNvbS9lbi11cy9saWJyYXJ5L2VlNzIxMDU1LmFzcHg=">Enterprise Wikis
overview (SharePoint Server 2010)

href="http://c-lien.blogspot.com/?aHR0cDovL21zZG4ubWljcm9zb2Z0LmNvbS9lbi11cy9saWJyYXJ5L21pY3Jvc29mdC5zaGFyZXBvaW50LnB1Ymxpc2hpbmcuY29udGVudHR5cGVpZC5lbnRlcnByaXNld2lraXBhZ2UuYXNweA==">ContentTypeId.EnterpriseWikiPage
Property

href="http://c-lien.blogspot.com/?aHR0cDovL2NvbW11bml0eS5iYW1ib29zb2x1dGlvbnMuY29tL2Jsb2dzL3NoYXJlcG9pbnQtMjAxMC9hcmNoaXZlLzIwMDkvMTAvMjEvc3BjLWN1c3RvbWl6aW5nLWVudGVycHJpc2Utd2lraXMtaW4tc2hhcmVwb2ludC0yMDEwLXdpdGgtZ2FpbC1qYWNvYnktYW1wLXRlZC1wYXR0aXNvbi5hc3B4">SPC:
Customizing Enterprise Wikis in SharePoint 2010 with Gail Jacoby & Ted
Pattison


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">name=1>1 - How do the Styles and Markup Styles Menus of the wiki
pages work in SharePoint 2010?


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">name=1.1>1.1 information for advanced end-users (knowing basic html and
CSS) and web designers


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px"> 


    style="MARGIN-TOP: 5px; FONT-FAMILY: arial; MARGIN-BOTTOM: 5px; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal">
  • the "Markup Styles"

      style="MARGIN-TOP: 5px; FONT-FAMILY: arial; MARGIN-BOTTOM: 5px; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal">
    • nest the text and its HTML tag within the html tag specified in the
      style if the tag to nest is a <span> element
    • replace the current tag if is is not a <span> element
    • remove all the styles for the children elements
    • remove the html tag if the same style is applied a second time
      (this is a way of removing a Markup style for an end-user)

  • the "Styles"

      style="MARGIN-TOP: 5px; FONT-FAMILY: arial; MARGIN-BOTTOM: 5px; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal">
    • nest the text in a <span> tag with the style class if the text is
      not already inside an HTML tag
    • just add the class to the current HTML tag if this tag is not a
      <span> tag
    • replace the class of the HTML tag if this tag is a <span> tag
    • remove the html <span> tag if the same style is
      applied a second time (this is a way of removing a Style for an
      end-user)

style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Let
us illustrate this by a little example. Assume we want to populate our page with
five lines of text (I used Firefox 3.5 for the demo in order to show the cross
browser compatibility):.

href="http://c-lien.blogspot.com/?aHR0cDovLzQuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU10Q0ZzLXdwSS9BQUFBQUFBQUJVMC9oU0ZtWjMwd3M0ay9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzAzMCstK3BvcHVsYXRpbmcrUlRFLkpQRw==">style="WIDTH: 320px; HEIGHT: 149px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414220690943296146 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUBSvR39wXp_61_IUYAoyUBj_-MBWfFQLzd_4a4TU-SDpacdItyNmPTR1HSwOzjuEnzQ1fBAaNhZLpXQGmJRDlSRazK-2BMMUeZMkeTt7bOw4f-3-eDyLeqFiG2aKf4jIxtumBziXZVl2F/s320/SharePoint+2010+-+managing+styles+-+030+-+populating+RTE.JPG">



Then we apply


    style="MARGIN-TOP: 5px; FONT-FAMILY: arial; MARGIN-BOTTOM: 5px; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal">
  • to the first line the "Colored Heading 1" from the "Markup Styles"
    menu
  • to the second line "Highlight" style from the "Styles" menu
  • to the third line the "Paragraph" style from the "Markup Styles" menu
  • to the fourth line the "Call out 2" style from the "Markup Styles"
    menu

  • to the fifth line the
    "Call out 1" style from the "Markup Styles" menu

style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px"> and
we obtain the following result


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">

href="http://c-lien.blogspot.com/?aHR0cDovLzEuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU10Qnc3Y05WSS9BQUFBQUFBQUJVcy9fWGM2YUZTXy1zOC9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzAzNSstK2FwcGx5aW5nK3N0eWxlcy5KUEc=">style="WIDTH: 320px; HEIGHT: 142px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414220685366801746 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVKssT-DG3xPru0WI5tQuiCk64YMfiZaqlG5QbqtWoG7PXcMKMQtS0k9vAfO-hAybxolhihfMHq_8kZxHiIm6jNZsMX3BOgcimbZ7NqbDxo2NhhVIlWAyjArW6AU0LeLKk3t3Diw44KVNl/s320/SharePoint+2010+-+managing+styles+-+035+-+applying+styles.JPG">




style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px"> 


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">name=1.2>1.2 Information for web designers and developers - Location of the
CSS and loading mode


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">What
is fantastic in the inplementation of the Styles and Markup Styles menus in the
ribbon of the SharePoint 2010 wiki pages is that they are populated dynamically
by the client side code using Ajax when you activate the Edit Mode of the wiki
page. Furthermore, they are populated, based on ALL the
CSS styles that are available for a specific wiki page and thus, can be
stored:


    style="MARGIN-TOP: 5px; FONT-FAMILY: arial; MARGIN-BOTTOM: 5px; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal">
  • in the Out Of The Box Cascading Style Sheet of the 2010 version ( color=#000000
    face="Courier New">14\TEMPLATE\LAYOUTS\1033\STYLES\Themable\corev4.css
    )

  • in custom Cascading Style Sheets that are located in the Web Front End
    file system
  • in custom Cascading Style Sheets that are stored in the SharePoint 2010
    content databases
  • in Cascading Style Sheets that are stored in the SharePoint
    2010 content databases but were automatically generated by SharePoint
    (Themes).
  • within the wiki page client code (<style> tag)

style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">All
these locations may be parsed by the client side code of ribbon using XMLHTTP
requests when you activate the Edit Mode of a wiki page of a SharePoint 2010
team site. (I have debugged the Ribbon while loading the CSS, so if you want to
see it in action you can consult this href="http://c-lien.blogspot.com/?aHR0cDovL21vc3Nob3d0by5ibG9nc3BvdC5jb20vMjAxMC8wNi9zaGFyZXBvaW50LTIwMTAtd2lraS1jdXN0b21pemluZy5odG1sIzEuMQ==">section of
another post)


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">name=1.3>1.3 Information for web designers and developers - CSS syntax
for these styles


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">If
the wiki page HTML editor detects Cascading Style Sheet (CSS) classes whose
names have the prefix ms-rteStyle-XXXX, where XXXX is the display name of the
classes it populates the Styles menu with an item corresponding to this set of
styles. The new item displayed text is the value of the property ms-name.
You
can see below, an excerpt of the corev4.css file where you can notice the 2
first elements available in the Styles menu of an Out Of The Box SharePoint
2010 team site.

color=#000000 size=3 face="Times New Roman">

style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt"
lang=EN-CA>.ms-rteStyle-Normal


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>{


style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"
lang=EN-CA>-ms-name
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>:style="COLOR: blue">"Normal";


style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"
lang=EN-CA>font-family
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>:style="COLOR: blue">Verdana,Arial,sans-serif;


style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"
lang=EN-CA>font-size
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>:style="COLOR: blue">8pt;


style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt" lang=EN-CA>/*
[ReplaceColor(themeColor:"Dark1")] */
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA> style="COLOR: red">color:style="COLOR: blue">#676767;


style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt" lang=EN-CA>/*
[ReplaceColor(themeColor:"Light1")] */
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA> style="COLOR: red">background-color:style="COLOR: blue">#fff;


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>}


style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt"
lang=EN-CA>.ms-rteStyle-Highlight


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>{


style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"
lang=EN-CA>-ms-name
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>:style="COLOR: blue">"Highlight";


style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt" lang=EN-CA>/*
[ReplaceColor(themeColor:"Dark1-Darker")] */
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA> style="COLOR: red">color:style="COLOR: blue">#312a26;


style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt" lang=EN-CA>/*
[ReplaceColor(themeColor:"Accent6")] */
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA> style="COLOR: red">background-color:style="COLOR: blue">#fae032;


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"
lang=EN-CA>}

 

style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">If
the wiki page HTML editor detects Cascading Style Sheet (CSS) classes whose
names have the prefix ms-rteElement-XXXX, where XXXX is the display name of the
classes it populate the Markup Styles menu with an item corresponding to this
set of styles. The new item display text is the value of the property
ms-name.
You can see below, an excerpt of the corev4.css file where you can
notice the 2 first elements available in the Markup Styles menu of  an Out
Of The Box SharePoint 2010 team site.

face="Times New Roman">face="Times New Roman">face="Times New Roman">

style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt"
lang=EN-CA>H1.ms-rteElement-H1


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>{


style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"
lang=EN-CA>-ms-name
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>:style="COLOR: blue">"Heading 1";


style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"
lang=EN-CA>font-size
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>:style="COLOR: blue">2em;


style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"
lang=EN-CA>font-weight
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>:style="COLOR: blue">normal;


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>}


style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt"
lang=EN-CA>H2.ms-rteElement-H2


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>{


style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"
lang=EN-CA>-ms-name
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>:style="COLOR: blue">"Heading 2";


style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"
lang=EN-CA>font-size
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>:style="COLOR: blue">1.3em;


style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt"
lang=EN-CA>font-weight
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>:style="COLOR: blue">normal;


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"
lang=EN-CA>}

 

style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">We
are now going to examine all these locations their use and their impact on the
rendering of the contents published by using the Rich Text Editor within a
wiki page of a team site.


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 13px; PADDING-RIGHT: 0px; COLOR: #e9ab17; FONT-WEIGHT: bold; PADDING-TOP: 10px">name=2>2 - How to manage items in the Styles Menus of the wiki pages in
SharePoint 2010? (audience: SharePoint developers and Architects)


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">The
goal of the demonstartion is now to examine the different locations where
the RTE styles are stored or might be stored and to draw conclusions regarding
this location about branding operations.


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">name=2.1>2.1 The 2 possible locations for the Out Of The Box CSS
of  the RTE styles and thus for the definition of the styles
menus items


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">        
2.1.1 The first Out Of The Box location is the corev4.css file located
at:


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">color=#000000 face="Courier New">C:\Program Files\Common Files\Microsoft
Shared\Web Server
Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\Themable\corev4.css


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">If
you modify this file, you might modify the styles and the styles menus items of
the wiki pages for all the team sites of your SharePoint 2010 Farm except
if a theme is applied to the site. Most of all, if you modify this file, and you
have later to apply a SharePoint 2010 upgrade, hotfix, or maybe just run
the SharePoint Products and Technology Wizard, all your changes will be
overwritten by the OOTB corev4.css. So it is a very bad idea to modify
the RTE styles that way.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">        
2.1.2 The second Out Of The Box location if a theme is applied
- a /_theme/number site folder


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Now
we are going to go back to the previous example and change the theme of the site
to "Bittersweet"


href="http://c-lien.blogspot.com/?aHR0cDovLzQuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU10Qms0MFYwSS9BQUFBQUFBQUJVay8xaVJzNUg0ZWF6MC9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzA0MCstK2NoYW5naW5nK3RoZW1lLkpQRw==">style="WIDTH: 320px; HEIGHT: 183px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414220682134574914 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBGz2GlqyryNLZWUOGxBOzTO5jVTynrv_FHkm5vYamkjjNjQ75XK0aW-2kPNfZ-R8TAHEp6mvvZJxyroCnP3kGthFZliNCTDLEjyIGqZvxjCWJ9YDg1hjq1ihVenvlAxJyQNz9TVOkQc8v/s320/SharePoint+2010+-+managing+styles+-+040+-+changing+theme.JPG">



We obtain this:


onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"
href="http://c-lien.blogspot.com/?aHR0cDovLzEuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU0xYnJYRk1BSS9BQUFBQUFBQUJWcy9sdGdjV185SjVuUS9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzA1MCstK3RoZW1lK2NoYW5nZWQuSlBH">style="WIDTH: 320px; HEIGHT: 151px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414229926641741826 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_pKhf0WphxQrFImUvOGwz6vOaMOGSM0L3f2jA9k2HmiukTMJShAM8-LUDbGbZX6MBHt1QSa_Q16gb9Ac59d6B3hENsrbN8R4DDaXMhj-HL6bbXpE4jv0dBC7UVXtRt3hSPptAZLSAhLv1/s320/SharePoint+2010+-+managing+styles+-+050+-+theme+changed.JPG">




style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Notice
that all the styles was changed partially or totally by the new theme, except
the "Callout 2" style that remained exactly the same. This is due to several
things. Some of the SharePoint 2010 rte styles are explicitly defined to change
when the theme is changing, like the Markup style
"Paragraph" for which are defined the following instruction regarding
the SharePoint themes: 

face="Courier New">[ReplaceColor(themeColor:"Dark2-Darker")]
*/

Some others are defined to remain unchanged while applying a
theme. The "Callout 2" style was not planned to change when the theme
changes because it overwrites the elements of the theme CSS so it will
remain exactly the same even if you change for any theme of SharePoint
2010. 
(The "Callout 1" style that was delivered by Microsoft with an
error in the color property that prevents it from overwriting the default text
color defined by the theme CSS).
 


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Now
that the "Bittersweet" theme is applied to the site, if you try to modify the
corev4.css file, you won't see any modification because the CSS are now stored
in a file automatically generated by SharePoint 2010 and located in a site
folder with this kind of url:


/_themes/20/corev4-8A0ABD2F.css?ctag=21


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">The
SharePoint site will reuse the corev4.css file only if you apply the default
option for the SharePoint site themes, that is to mean, no theme.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">That
means that it is really not a good idea to modify the styles by customizing
the OOTB themable/corev4.css file since these modifications won't be
visible for any sites for which a SharePoint 2010 theme is
applied execpted if the theme is applied after the corev4.css
customizations. It is not a good idea neither to modify the CSS after
having applied a theme by customizing the CSS stored in the theme folder. Were
are now considering different approaches to store custom CSS.


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">name=2.2>2.2 Creating and storing a custom CSS file.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">From
now, we could either use a <style> tag or  a <link> tag,
but assume we have chosen to store the custom CSS in a .css file. We are
now going to create a file for the custom styles and try to find the best way to
reference it in the SharePoint 2010 wiki page in order to have these custom
styles populating the Styles and Markup Styles menus of the Rich text Editor
within the SharePoint 2010 ribbon.


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Create
a sub folder named contoso-marketing in the folder of the themable/corev4.css :


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">color=#000000 face="Courier New">C:\Program Files\Common Files\Microsoft
Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\1033\STYLES\Themable


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">

onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"
href="http://c-lien.blogspot.com/?aHR0cDovLzEuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU0xYm9vRkgxSS9BQUFBQUFBQUJWay9iRFRnU2hxN1FSYy9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzA2MCstK25ldytydGUrc3R5bGVzK3N1Yitmb2xkZXIuSlBH">style="WIDTH: 320px; HEIGHT: 85px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414229925907734354 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGdTdMdFxrFxHx4mX4tQ4UvVdGN636xzP-MlMZiFhOZTbTVYNZDEiEQlXPTRnkVSlrfOVeWMs4AMs9KZOmtrncgWnj3Zmf1j4tpWQZUhFUVl3gnfq9Y0oglYqS9v0xjKx1cS86OqbOFibH/s320/SharePoint+2010+-+managing+styles+-+060+-+new+rte+styles+sub+folder.JPG">




style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">create
a new css file named also corev4.css
in this file paste the following
code:



lang=EN-CA>

style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt" lang=EN-CA>/*
_lcid="1033" _version="14.0.4536"*/


style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt"
lang=EN-CA> 


style="FONT-FAMILY: 'Courier New'; COLOR: green; FONT-SIZE: 10pt"
lang=EN-CA> 


style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt"
lang=EN-CA>DIV.ms-rteElement-mkg-H1


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>{


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>    style="COLOR: red">-ms-name: style="COLOR: blue">"marketing-header"color=#000000>;


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>    style="COLOR: red">color: style="COLOR: blue">#d65c26;


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>    style="FONT-FAMILY: 'Courier New'; COLOR: red; FONT-SIZE: 10pt">font-familystyle="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">:
Verdana,Geneva,sans-serifcolor=#000000>;


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">color=#000000>    style="COLOR: red">font-weight: style="COLOR: blue">normal;


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">color=#000000>    style="COLOR: red">font-size: style="COLOR: blue">2em;


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">color=#000000>}



style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">name=2.3>2.3 First location for a custom Style CSS: within an HTML Form Web
Part inserted in  the wiki page


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">HTML
and JavaScript code and text content are now two things really separated in
SharePoint 2010.

A wiki page of a SharePoint 2010 team site provide
contributors with a new HTML Editor tool but you cannot add tags like
<link>, <style> or JavaScript <script> in the wiki page
by using this tool.
It is certainly because some of the great publishing
functionalities provided by SharePoint 2010 has been implemented client side by
using DHTML and Ajax and this also allows users to write malicious code by
using client side code henceforth. So the client side code security has been
enhanced and there is consequences with limited HTML and JavaScript code
prohibition for the Out Of The Box editing tools.

However there is now
the HTML Form Web Part that can be insert into a SharePoint 2010 wiki page, and
allows users to write HTML form controls and JavaScript within a wiki page.

I tried then to use this Web Part to insert a <link> tag referencing
the custom CSS within the wiki page and it worked like a charm.

href="http://c-lien.blogspot.com/?aHR0cDovLzIuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeVIxWmU2LTNNSS9BQUFBQUFBQUJZcy9KV1FJN1FKdlBhUS9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzE1NSstK01hcmt1cCttZW51K3VwZGF0ZWQuSlBH">style="WIDTH: 320px; HEIGHT: 206px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414581732663811266 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVEd36vE58JCCOy4WCf41apk7URDBXU_J3lX1-fpM93Mf97xT8Uv7ARFw0-QaOCmyabuM-tqC8HmbZCZED3G5J0Fzt3x8xrbx0xemPdUuT30s-MndWCAChjB8H2W7YHhRFEHJaBLdt5yUe/s320/SharePoint+2010+-+managing+styles+-+155+-+Markup+menu+updated.JPG">



Unfortunately, even if it is a good way of testing code in our case,
this cannot be used that way in a company, because for each created page you
will have to insert a web part with the <link> tag and if a contributor
delete the Web Part you will lose your CSS link.
Anyway, having separated
the client side code edition in two different Web Parts, one for the HTML tags
that contain text and multimedia content (Content Editor Web Part) and one for
its layout and publishing improvement like the styles, the DHTML features,
etc.(HTML Form Web Part) is a very good idea because you can now limit the use
of advanced client side code to power users by tuning the permissions for the
HTML Form Web Part.


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">name=2.4>2.4 Referencing a custom CSS file within the code of the wiki
page


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Now,
we have to reference our custom CSS file in a wiki page in order the styles of
this file can be used in the wiki page and can populate one of the
two menus of the Rich Text Editor displayed in the SharePoint 2010 ribbon
when the wiki page is in edit mode. To be allowed to do that we have to modify
one of the wiki page. That can be made in three different ways:


    style="MARGIN-TOP: 5px; FONT-FAMILY: arial; MARGIN-BOTTOM: 5px; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal">
  • Modifying an existing wiki page by using the WebDav and the FrontPage RPC
    protocols either with SharePoint Designer or Visual Studio
  • Creating a new wki page by writing its code in Visual Studio and then
    deploying it in the Site Pages library by using a provisioning SharePoint 2010
    Feature
  • Finding a way to modify an existing wiki page while letting it in a
    ghosted state

style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">name=2.5>2.5 Modifying an existing SharePoint 2010 wiki page by using the
WebDav and the FrontPage RPC protocols with Visual Studio


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Instead
of customizing the page with the SharePoint Designer (that uses the WebDav
FrontPage RPC protocols) I want to show that it is also possible to do the
same with Visual Studio!


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">You
will notice that it is much more difficult to get the code of a SharePoint
2010 Wiki Page than for a SharePoint 2007 Base Page since you are not allowed
anymore to open a site page document library by using the Windows Explorer mode
or to download a copy of the page on your desktop. But it is still possible by
using the following workaround:


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Open
in Explorer mode one of your site document library.

onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"
href="http://c-lien.blogspot.com/?aHR0cDovLzEuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU0xYkhWTFF0SS9BQUFBQUFBQUJWYy9XSy1zOHMtdEJsUS9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzA3MCstK29wZW4rZG9jdW1lbnQrbGlicmFyeStpbitleHBsb3Jlcittb2RlLkpQRw==">style="WIDTH: 320px; HEIGHT: 118px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414229916970074834 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi0bLp2VFqFcuKsX6zjsd7mRl13Zc5Ne4xDwVkxacZGq3VwXVd-7vhm-U2MEMlfvJNZwdenW6lGFB06XwitljfycBvJRSWnUKRrZv0rZZDi5v2DehGmrxmxLgTe6gnrJGboVxpXkKEEZkQ/s320/SharePoint+2010+-+managing+styles+-+070+-+open+document+library+in+explorer+mode.JPG">




You will be now allowed to navigate until your SharePoint 2010 Site
Pages document library.

onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"
href="http://c-lien.blogspot.com/?aHR0cDovLzMuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU0xYkFIeFQ1SS9BQUFBQUFBQUJWVS9GZGtqWmRuMUN1WS9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzA4MCstK25hdmlnYXRlK3NpdGUrZm9sZGVycytpbitleHBsb3Jlcittb2RlLkpQRw==">style="WIDTH: 320px; HEIGHT: 164px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414229915034800018 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKuwIM6bNalDdn861-moGoKS2rNln10zhgiPMjsDJjserVuPhVsAMs165Rm127Vce3Jr2eza1FV5uLpsNkDggj9xvlJ-Rye75uCLbt8Ag6DR0FLFGmnRhm9xpuS87qIgnQaKvSONRO6UiZ/s320/SharePoint+2010+-+managing+styles+-+080+-+navigate+site+folders+in+explorer+mode.JPG">



href="http://c-lien.blogspot.com/?aHR0cDovLzMuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU0xYV9lT2xRSS9BQUFBQUFBQUJWTS9lb0l3b01pZ2pkMC9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzA5MCstK25hdmlnYXRlK3NpdGUrZm9sZGVycytpbitleHBsb3Jlcittb2RlLkpQRw==">style="WIDTH: 320px; HEIGHT: 212px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414229914860557570 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDlZM6JyYfwIKife6Iv3Q0FseDFGwV7vB3vufGsM7XmPpqEFR-xM4NVkjVuanP6zz3dH3Fa_TAq-0d38yVxOznbO9cM87O3cc7OSWxtHU-ui9oJ7J2nyB_fVBcFMRVNcJxOC3CcjrttAcv/s320/SharePoint+2010+-+managing+styles+-+090+-+navigate+site+folders+in+explorer+mode.JPG">



href="http://c-lien.blogspot.com/?aHR0cDovLzEuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU01Q3VVVnpjSS9BQUFBQUFBQUJXcy9UaHNGdzdxLUl1cy9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzEwMCstK25hdmlnYXRlK3NpdGUrZm9sZGVycytpbitleHBsb3Jlcittb2RlLkpQRw==">style="WIDTH: 320px; HEIGHT: 167px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414233895985335746 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv9mcijoHuxe4YDD9pReEfTONH1E4hbNlFJU0bb92i104mnJS_9pkBp3gO4erZymdiyOqPp2Hh8JfuPkMgkFOgWrhWY2jB9G8DJRsV76zbR1KkNtJiubEH_gXfNLhGrNPodA-vm4rMNzO1/s320/SharePoint+2010+-+managing+styles+-+100+-+navigate+site+folders+in+explorer+mode.JPG">



Right click the page you want to customize, and open it with Visual
Studio. (Now you could also copy and paste a page on your desktop to have the
source code of a wiki page)

onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"
href="http://c-lien.blogspot.com/?aHR0cDovLzEuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU01Q2NabS1ISS9BQUFBQUFBQUJXay9lT0ttMDJESFF6ay9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzExMCstK29wZW5pbmcrd2lraStwYWdlK3dpdGgrVlMrMjAwOCt1c2luZyt3ZWJkYXYuSlBH">style="WIDTH: 320px; HEIGHT: 195px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414233891175594098 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgupKppR_PnVU0mtzFpiquVnldau4sfTweOyJR7uw_bRQJZxvTorKdj2sMQl3TriAifQvISm_FvadXN0fhyphenhyphenNOThFJPk_sEXPHe64aOair4Fey69rbm_X5-V1a6UuLBdK2eVSqX7vzwCaSKN/s320/SharePoint+2010+-+managing+styles+-+110+-+opening+wiki+page+with+VS+2008+using+webdav.JPG">



then in the Place Holder Aditionnal Page Head paste a reference to
the the previous custom style sheet and save the page.


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>        style="COLOR: blue">< link style="COLOR: red">type ="text/css"
relstyle="COLOR: blue">="stylesheet" style="COLOR: red">hrefstyle="COLOR: blue">="/_layouts/1033/styles/themable/contoso-marketing/corev4.css"
/>


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">

onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"
href="http://c-lien.blogspot.com/?aHR0cDovLzIuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU01Q0xmVUljSS9BQUFBQUFBQUJXYy95QXlPVktJSXBVdy9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzEyMCstK3Bhc3RpbmcrY3NzK3JlZitpbit3aWtpK3BhZ2Urd2l0aCtWUysyMDA4K3VzaW5nK3dlYmRhdi5KUEc=">style="WIDTH: 320px; HEIGHT: 162px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414233886636122562 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgS5aAzOy3ZXPp458RcQD3qzuWlTuSprbqdPbRezhS24ik9VdmbmdH6FiDCjB7AqnvHc74M1lPt19Zi3gcNVVHEjfxhTjzD4ykNnJYFg-ABntojm6X_EnDCWt8kImYB5QkxsgTYQYDbH3Ux/s320/SharePoint+2010+-+managing+styles+-+120+-+pasting+css+ref+in+wiki+page+with+VS+2008+using+webdav.JPG">




style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Then,
when you refresh the page, SharePoint warns you that the page has been
customized and give you a way to revert it to its template (if you do so, you
will lose your changes...).

onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"
href="http://c-lien.blogspot.com/?aHR0cDovLzQuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU01Qi1vX20tSS9BQUFBQUFBQUJXVS80V1VhLXdZb0ZMby9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzEzMCstK3dpa2krcGFnZStjdXN0b21pemVkK3Byb21wdC5KUEc=">style="WIDTH: 320px; HEIGHT: 144px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414233883187059682 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNFPWoA33_5AH9WPqhy1aIu7Ijt_-t_MF3_gRQS8Ynhv3-7bPphgqPb3LAQ0dU4Z4Y9lCfJDx3q1QMyu4H_DIBSyUhSSin3MIsNFkr8fJbKSu88j2Tvfvr5vxqgAQdHk9SDBspK_jAVoKa/s320/SharePoint+2010+-+managing+styles+-+130+-+wiki+page+customized+prompt.JPG">



But you can notice when switching to Edit Mode than the Markup menu has
been updated and that a new item has been added based on the new style sheet.


href="http://c-lien.blogspot.com/?aHR0cDovLzMuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU01QmdyRDlKSS9BQUFBQUFBQUJXTS93QkxEb0hyRkJBcy9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzE0MCstK01hcmt1cCttZW51K3VwZGF0ZWQuSlBH">style="WIDTH: 320px; HEIGHT: 178px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414233875142669458 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP0URAtfZjPqoBKaUMYvpzT3q3-EnJUgkc8mbAP6mfCooWnJZIS-eFVQbvmX8TUWXnbhOI9MPflnJ5Sw-IO_w69fTWiVWSE0EeNkZKdrslrv_2Up-iZ3ZQBoticylB6bjbQbpVpvXnmb7s/s320/SharePoint+2010+-+managing+styles+-+140+-+Markup+menu+updated.JPG">



And it actually does work!

onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"
href="http://c-lien.blogspot.com/?aHR0cDovLzQuYnAuYmxvZ3Nwb3QuY29tL185ZnNnRHF1TjlNSS9TeU03QUJ1Njd4SS9BQUFBQUFBQUJYVS81M0QxRUViRkt2MC9zMTYwMC1oL1NoYXJlUG9pbnQrMjAxMCstK21hbmFnaW5nK3N0eWxlcystKzE1MCstK01hcmt1cCttZW51K3VwZGF0ZWQuSlBH">style="WIDTH: 320px; HEIGHT: 182px; CURSOR: hand"
id=BLOGGER_PHOTO_ID_5414236048680742674 border=0 alt=""
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTq0dcl0GZwTrsWFikiaCExd8SZ4OSSvHyaQsU4Iq7JNHmybXFKEBBi3tLhVa2DxggBNKpanWp_XEheJnal_tUeEBNoWouN53MHW9wLvnHsKvMM4vPfXq8GOy_BqjtBBc6cHjMCY7BnE4I/s320/SharePoint+2010+-+managing+styles+-+150+-+Markup+menu+updated.JPG">



style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">color=#000000 size=3 face="Times New Roman">

 So this test
shows that you can easily update the menus by creating a custom CSS and
reference it by customizing an existing wiki page, but the result is not so good
since the page is now customized.
So we will now use a provisioning
feature to have a new page within the wiki page document library with the menu
updated while preserving its ghosted state .


style="PADDING-BOTTOM: 10px; MARGIN: 1px 0px; PADDING-LEFT: 26px; COLOR: #e9ab17; FONT-WEIGHT: normal; PADDING-TOP: 10px">name=2.6>2.6 - Adding a new wiki page in the Site Pages library by using a
provisioning SharePoint 2010 Feature


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">
Previously,
we have open a wiki page in Visual Studio. It is a way to get the source
code of a wiki page. You can now create 3 new wiki pages in Visual Studio
by creating 3 new .aspx pages and pasting the source code of the page we
had opened previously, and this time instead of just copying a <link> tag,
I propose a cleaner way of referencing the CSS file by duplicating the
CSSRegistration component.
So locate the following line:



style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"
lang=EN-CA>  <
style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt"
lang=EN-CA>SharePoint
style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"
lang=EN-CA>:
style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt"
lang=EN-CA>CssRegistration
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>style="COLOR: red"> runat="server"color=#000000> Namestyle="COLOR: blue">="wiki.css" style="COLOR: blue">/>


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">duplicate
it and make the following changes,



style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 18px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">color=#0000ff><size=2>SharePointsize=2>:size=2>CssRegistration color=#ff0000 size=2>runatcolor=#0000ff size=2>="server" color=#ff0000 size=2>Namecolor=#0000ff size=2>size=2>="/_layouts/1033/styles/themable/contoso-marketing/corev4.css"size=2> size=2>/>


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">You
can eventually also use $SPUrl and ~SiteCollection and ~Language syntax to
extend the use of this page but only for the licensed version SharePoint Server
2010 (not for Foundation).


style="TEXT-ALIGN: justify; PADDING-BOTTOM: 18px; MARGIN: 1px 0px; PADDING-LEFT: 31px; PADDING-RIGHT: 5px; FONT-FAMILY: arial; COLOR: gray; FONT-SIZE: 10pt; FONT-WEIGHT: normal; PADDING-TOP: 5px">Now,
this is the code of the feature and the elements files in order to provision the
site pages library with 3 pages.



style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"
lang=EN-CA><?
style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt"
lang=EN-CA>xml
lang=EN-CA>versionstyle="COLOR: blue">="1.0" encodingstyle="COLOR: blue">="utf-8"?>


style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"
lang=EN-CA><
style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt"
lang=EN-CA>Feature
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>style="COLOR: red">Idstyle="COLOR: blue">="00BFEA71-2062-426C-90BF-714C59600AAA"


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>    style="COLOR: red">Title="test site
page"


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>    style="COLOR: red">Description="test site
page"


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>    style="COLOR: red">Versionstyle="COLOR: blue">="1.0.0.0"


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>    style="COLOR: red">Scopestyle="COLOR: blue">="Web"


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>    style="COLOR: red">Hiddenstyle="COLOR: blue">="false"


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>    style="COLOR: red">DefaultResourceFilestyle="COLOR: blue">="core"


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>    style="COLOR: red">xmlnsstyle="COLOR: blue">="http://schemas.microsoft.com/sharepoint/">


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt" lang=EN-CA>color=#000000>  style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"><style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt">ElementManifestsstyle="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt">>


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">color=#000000>    style="COLOR: blue"><style="COLOR: #a31515">ElementManifest style="COLOR: red">Locationstyle="COLOR: blue">="elements.xml" style="COLOR: blue">/>


style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">color=#000000>  </style="COLOR: #a31515">ElementManifestsstyle="COLOR: blue">>


style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"></style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt">Featurestyle="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt">>


style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"> 


style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"
lang=EN-CA><
style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt"
lang=EN-CA>Elements
style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"

Aucun commentaire:

Enregistrer un commentaire