Customizing PlaceHolder values in MOSS 2007
Here something
intresting while changing some text based in the _layouts/ folder.These folders
pages cannot be customised in Share point designer.
Case 1:
In a wiki site we need to chagne the CreatewebPage.aspx
label "New Wiki Page " to "My Library page."
A quick solution would be
to, remove the line the bwlow Sharepoint Tag :
<SharePoint:EncodedLiteral runat="server"
text="<%$Resources:wss,webpagecreation_newwk_pagetitle%>"<%$Resources:wss,webpagecreation_newwk_pagetitle%>
EncodeMethod='HtmlEncode'/ >And replace it with:
<SharePoint:EncodedLiteral runat=”server”text=” Text I want” EncodeMethod=’HtmlEncode’/>Though this would work, this is not recommended.My friend (Pawan) gave me an idea to do these change in resource file.
________________________________________________________________
Case 2:
A customer of mine wanted to get rid of the “Error: Access Denied” message that’s displayed to unauthorized (but authenticated) users in MOSS 2007/WSS V2. Instead, user wanted something like “Feel free to join this site”, which according to her organization would convey a more positive message to users.
I had a look at the AccessDenied.aspx page and as expected couldn’t find the text in question. Instead, there were content placeholders. This page uses the “simple.master” as its master page. Certain content placeholder IDs are overridden here. A few are “PlaceHolderPageTitle”, “PlaceHolderPageTitleInTitleArea”, “PlaceHolderMain” and the likes.
A quick solution would be to, remove the line:<SharePoint:EncodedLiteral runat=”server” text=”<%$Resources:wss,accessDenied_pagetitle% >” EncodeMethod=’HtmlEncode’ >
And replace it with:
< SharePoint:EncodedLiteral runat=”server” text=”whatever text I want” EncodeMethod=’HtmlEncode’ >
Though this would work, this is not recommended.________________________________________________________________
Recommended Solution
Another way is to understand how resources work and try tampering with it (well, a copy of it actually).The overridden attribute is referencing a resource file.You would see something like:
<%$Resources:wss,accessDenied_pagetitle%>
or
< %$Resources:wss,webpagecreation_newwk_pagetitle%>
The above syntax indicates that we need to look into wss resource file located *somewhere* and need to find the variable “accessDenied_pagetitle” or "webpagecreation_newwk_pagetitle".
Under \12\config\resources and the others under \app_globalresources folder of the individual virtual directories created by MOSS 2007/WSS v2.
Modifying the wss.en-US.resx file under \12\config\resources wouldn’t reflect the change in the UI.
This would also mean we are modifying the default OOB files and is not recommended.
We can modify the wss.en-US.resx file under \app_globalresources and that would reflect the changes.
Note:Every time a new web application is create the resource files are copied over to \app_globalresources and they govern the resource part of that application.Pop open the wss.en-US.resx under \app_globalresources file and look for the variable “accessDenied_pagetitle” or "webpagecreation_newwk_pagetitle" in it. There would be a data name/value pair. You’ll also see wss.resx file. If you have a wss.en-US.resx (the en-US part can vary depending on the language), you'll need to use that. If you don't, you can use wss.resx.But, if both wss.resx and wss.en-US.resx (or any other language file) are present, wss.en-US.resx would take precedence.
No comments:
Post a Comment