简体   繁体   English

默认的SharePoint 2010选项卡

[英]Default Sharepoint 2010 Tabs

I've been searching on stackoverflow and google for a solution for my 'problem' and still didn't find anything that worked. 我一直在stackoverflow和google上搜索我的“问题”的解决方案,但仍然找不到任何有效的方法。

I'm developing a solution using Sharepoint 2010 translated to Portuguese, but in some points of the systems, the translation isn't accurate, or, it's a different word that has many other meanings. 我正在使用翻译成葡萄牙语的Sharepoint 2010开发一种解决方案,但是在系统的某些点上,翻译不准确,或者,它是一个具有许多其他含义的不同单词。

I really need (if possible) to change the text of the default 'Browse' tab on this project. 我真的需要(如果可能)更改此项目上默认“浏览”标签的文本。 I'm messing around trying to find it but still don't have success. 我正在四处寻找它,但仍然没有成功。

Does anyone know if it's possible to change the default text of the Browse tab, and if yes, where i can do it? 有谁知道是否可以更改“浏览”选项卡的默认文本,如果可以,我可以在哪里进行更改?

Thank you. 谢谢。

Navigate to "C:\\Program Files\\Common Files\\Microsoft Shared\\Web Server Extensions\\14\\Resources\\" in your windows explorer, and open core.pt-br.resx with Notepad. 在Windows资源管理器中导航到“ C:\\ Program Files \\ Common Files \\ Microsoft Shared \\ Web服务器扩展\\ 14 \\ Resources \\”,然后使用记事本打开core.pt-br.resx。

Find words: "ReadTab". 查找单词:“ ReadTab”。

Change value of this resource to whatever you want. 将此资源的值更改为所需的任何值。 For example: 例如:

<data name="TabRead">
  <value>Browse test</value>
</data>

Make iisreset (press Start, type "iisreset", and press Enter). 进行iisreset(按“开始”,键入“ iisreset”,然后按Enter)。

Refresh your site. 刷新您的网站。 You will see: 你会看见:

替代文字

It is most fast way to achieve what you want. 这是实现所需目标的最快方法。 But, most likely, you should need to redo this operation every time you install fresh service pack, so it is not the best way. 但是,最有可能的是,每次安装新的Service Pack时,您都需要重做此操作,因此这不是最佳方法。 Microsoft do not recommend change internal SharePoint files. Microsoft不建议更改内部SharePoint文件。


Another way here, the right one, is to create simple SharePoint solution with one little feature. 正确的另一种方法是创建具有一个小功能的简单SharePoint解决方案。 It is the right way, but it takes a little more time. 这是正确的方法,但需要更多时间。

But if you have Visual Studio and base programming skills, you can do this easily. 但是,如果您具有Visual Studio和基本的编程技能,则可以轻松完成此操作。

What we will do: 我们要做什么:

  1. We will add our own resource file, so later we can add translations for other languages and add resources for other places, where you want to change the translation. 我们将添加自己的资源文件,以便稍后可以添加其他语言的翻译,并为您要更改翻译的其他地方添加资源。
  2. We will add feature, which will modify browse tab, changing it title, so it will point now to our own language resource value 我们将添加功能,该功能将修改浏览选项卡,更改其标题,因此现在它将指向我们自己的语言资源值

Let's start! 开始吧!

First of all, please, open Visual Studio 2010 and create empty SharePoint project: 首先,请打开Visual Studio 2010并创建一个空的SharePoint项目:

替代文字

Choose farm solution in creation wizard, and press Finish. 在创建向导中选择服务器场解决方案,然后按“完成”。 Ok, solution is ready now. 好的,解决方案现在可以使用了。

Next step is to add mapped folder for resource files. 下一步是为资源文件添加映射的文件夹。 Right-click on project, and select Add -> SharePoint mapped folder. 右键单击项目,然后选择添加-> SharePoint映射文件夹。

替代文字

Select Resources folder, and press OK. 选择资源文件夹,然后按确定。 Now, you should add your own resources file. 现在,您应该添加自己的资源文件。 Right-click on Resources folder, and select Add -> New item. 右键单击Resources文件夹,然后选择Add-> New item。

Select "General" group under C#, and scroll down to Resource file. 选择C#下的“常规”组,然后向下滚动到“资源文件”。 Click Add. 单击添加。

替代文字

Now you should add your resource. 现在,您应该添加资源。 For example, name it "MyBrowseTabTitle": 例如,将其命名为“ MyBrowseTabTitle”:

替代文字

Next, you should add a new feature. 接下来,您应该添加一个新功能。 Right-click on Features folder in your project tree, and select Add feature. 右键单击项目树中的“功能”文件夹,然后选择“添加功能”。

替代文字

You can name your feature as you wish. 您可以根据需要命名功能。 Next step is creating module with some elements. 下一步是创建包含一些元素的模块。 Right-click on project title and select Add -> New item. 右键单击项目标题,然后选择添加->新项目。 Select SharePoint -> 2010 element group, and find Module element. 选择SharePoint-> 2010元素组,然后找到Module元素。 Click Add to confirm. 单击添加确认。

替代文字

File with elements manifest should open up (it is inside your new Module). 带有元素清单的文件应打开(位于新模块内)。 Replace elements.xml file contents with following code: 用以下代码替换elements.xml文件的内容:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
  Id="ChangeBrowseTabTitle"
  Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.Read">
          <Tab
            Id="Ribbon.Read"
            Title="$Resources:Resource1,MyBrowseTabTitle;"
            Sequence="100"
            Command="ReadTab"
            Description=""
            CssClass="ms-browseTab"
            >
            <Scaling Id="Ribbon.Read.Scaling" />
            <Groups Id="Ribbon.Read.Groups" />
          </Tab>
        </CommandUIDefinition>
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>
</Elements>

For details on customising ribbon, you can follow this link: 有关自定义功能区的详细信息,可以单击以下链接:

http://msdn.microsoft.com/en-us/library/ff458373.aspx http://msdn.microsoft.com/en-us/library/ff458373.aspx

Ok, now you're ready to deploy. 好的,现在您可以部署了。 First, right-click on project name and select "Package". 首先,右键单击项目名称,然后选择“包”。 Now make sure, that your Package.package file inside project folder, contains following files: 现在确保项目文件夹中的Package.package文件包含以下文件:

替代文字

If all is right, now you should point your SharePoint Project to your own site. 如果一切正确,现在您应该将SharePoint Project指向自己的网站。 Modify your project properties (right-click on project title, select "Properties", and find "Site URL" setting). 修改项目属性(右键单击项目标题,选择“属性”,然后找到“站点URL”设置)。 Here I expect, what SharePoint is installed on the same machine, where the Visual Studio is running. 在这里,我希望在运行Visual Studio的同一台计算机上安装什么SharePoint。

Finally, you should right-click on project, and select Deploy. 最后,您应该右键单击项目,然后选择“部署”。

You should see some output in your Visual Studio output window, ending with this line: 您应该在Visual Studio输出窗口中看到一些输出,以以下行结尾:

========== Deploy: 1 succeeded, 0 failed, 0 skipped ========== ==========部署:1个成功,0个失败,0个跳过===========

Great! 大! All is ready now. 现在一切就绪。 Now open Internet Explorer and navigate to your sharepoint site. 现在打开Internet Explorer并导航到您的共享点站点。 You will see something like this: 您将看到如下内容:

替代文字

Later, if you need, you can change feature scope, to use this feature on site collections, or to deploy it globally on your farm. 以后,如果需要,可以更改功能范围,在网站集上使用此功能或在服务器场中全局部署它。

替代文字

Feel free to ask for any details. 随时询问任何详细信息。

Hope it helps! 希望能帮助到你!

I created something very usefull and I want to share my knowledge. 我创造了一些非常有用的东西,我想分享我的知识。 I needed to make one master element with multiple details, so I created several tabs one for each detail. 我需要制作一个具有多个详细信息的主元素,因此我为每个详细信息创建了多个选项卡。 This is how I created it: 这是我创建它的方式:

The HTML code: HTML代码:

  <div class="tabs" id="divTabs">
   <ul class="tab-links">
     <li class="tab-links"><a id="linkTab1" href="#tab1">Tab 1  </a>  </li>
     <li class="active"><a id="linkTab2" href="#tab2">Tab 2  </a>  </li>
     <li class="tab-links"><a id="linkTab3" href="#tab3">Tab 3  </a>  </li>
     <li class="tab-links"><a id="linkTab4" href="#tab4">Tab 4  </a>  </li>
   </ul>
 <div class="tab-content">  

 <div id="tab1" class="tab" >
   <WebPartPages:WebPartZone runat="server" FrameType="None" ID="customWP1" Title="TabWPZ-1">         
     <ZoneTemplate>
     </ZoneTemplate>
   </WebPartPages:WebPartZone>
 </div>

 <div id="tab4" class="tab">
   <WebPartPages:WebPartZone runat="server" FrameType="None" ID="customWP4" Title="TabWPZ-4"> 
     <ZoneTemplate>
     </ZoneTemplate>
   </WebPartPages:WebPartZone>
 </div>
 </div>
 </div>

Here is the style I used: 这是我使用的样式:

 <style type="text/css">
  .tabs {
DISPLAY: inline-block; WIDTH: 100%
   }
  .tab-links:after {
CONTENT: ''; CLEAR: both; DISPLAY: block
   }
   .tab-links LI {
LIST-STYLE-TYPE: none; FLOAT: left; LIST-STYLE-IMAGE: none; MARGIN: 0px 5px
   }
   .tab-links A {
FONT-SIZE: 16px; BACKGROUND: #7fb5da; FONT-WEIGHT: 600; COLOR: #4c4c4c; PADDING-BOTTOM: 9px; PADDING-TOP: 9px; PADDING-LEFT: 15px; DISPLAY: inline-block; PADDING-RIGHT: 15px; border-radius: 3px 3px 0px 0px; transition: all linear 0.15s
   }
   .tab-links A:hover {
BACKGROUND: #a7cce5; TEXT-DECORATION: none
   }
   LI.active A {
BACKGROUND: #fff; COLOR: #4c4c4c
   }
   LI.active A:hover {
BACKGROUND: #fff; COLOR: #4c4c4c
   }
   .tab-content {
BACKGROUND: #fff; PADDING-BOTTOM: 15px; PADDING-TOP: 15px; PADDING-LEFT: 15px; PADDING-RIGHT: 15px; box-shadow: -1px 1px 1px rgba(0, 0, 0, 0.15); border-radius: 3px
   }
   .tab {
DISPLAY: none
   }
   .tab.active {
DISPLAY: block
   }</style>

To make it work properly you also need a little jquery: 为了使其正常工作,您还需要一个小jQuery:

  $('.tabs .tab-links a').on('click', function (e) {
var currentAttrValue = $(this).attr('href');
switch (currentAttrValue) {
    case "#tab1":
        break;
    case "#tab2":
        break;
    case "#tab3":
        break;
    case "#tab4":
        break;
    }
    // Show/Hide Tabs
    $('.tabs ' + currentAttrValue).show().siblings().hide();
    // Change/remove current tab to active
    $(this).parent('li').addClass('active').siblings().removeClass('active');
    e.preventDefault();
});

After you insert this in SPD you open this page in browser and edit the page. 将其插入SPD之后,您可以在浏览器中打开此页面并编辑页面。 Now in each tab you can add any web part you want. 现在,您可以在每个选项卡中添加所需的任何Web部件。 That's it and it is very easy to customize the content of each tab. 就是这样,自定义每个选项卡的内容非常容易。

Hope it helps, Dragos.TE 希望能有所帮助,Dragos.TE

A bit dirty, but search through the resource files in your Web Application's 'App_GlobalResources' directory. 有点脏,但是在Web应用程序的“ App_GlobalResources”目录中搜索资源文件。

Alternatively you should be able to search through all '.resx' files in your '14 hive'. 另外,您应该能够搜索“ 14个配置单元”中的所有“ .resx”文件。 Once changed run stsadm -o copyappbincontent to apply these changes. 更改后,请运行stsadm -o copyappbincontent来应用这些更改。

Note that if you apply patches or service packs in the future then you'll most likely need to make these changes again. 请注意,如果将来应用补丁程序或Service Pack,则很可能需要再次进行这些更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM