如何将 HTML 元素添加到 SharePoint 2010 功能区区域

发布于 2024-11-30 21:08:34 字数 255 浏览 1 评论 0原文

我正在尝试编辑 SharePoint 2010 功能区以在选项卡旁边添加链接。所以我只想将元素恰好放在“浏览”和“页面”选项卡的右侧。它们看起来应该像其他选项卡,但它们的功能类似于链接。

我在网络上进行了广泛的搜索,试图适应这一点,但我不确定答案是编辑自定义母版页还是通过 Visual Studio 部署某些内容。无论哪种方式,我都无法让某些东西出现在该区域。

下面是它可能的样子的屏幕截图。

此外,任何将用户及其菜单移至左侧的帮助也将不胜感激。

I am trying to edit the SharePoint 2010 ribbon to add links along side the tabs. So I would want to just have elements exactly to the right of the 'Browse' and 'Page' tabs. It should look like they are other tabs, but they will function like links.

I have searched the web extensively to try and accommodate this, and I'm not sure if the answer is editing a custom master page or deploying something through Visual Studio. Either way, I am unable to get something to appear up in that area.

Below is a screen shot of what this might look like.

Also, any help with moving the user and their menu to the left would also be much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抱猫软卧 2024-12-07 21:08:34

SharePoint 不允许您以这种方式修改功能区。您必须使用 jQuery 或类似工具将新列表项 (li) 添加到选项卡无序列表 (ul)。您可以使用 firebug 找到该列表:

<ul class="ms-cui-tts" unselectable="on" role="tablist">
    <li class="ms-cui-tt" id="Ribbon.Read-title" unselectable="on" role="tab">
    <li class="ms-cui-tt" id="Ribbon.WebPartPage-title" unselectable="on" role="tab">
</ul>

请注意,不推荐此类解决方案(难以维护、不受支持,并且这可能在下一版本的 SharePoint 中不起作用)。

要将用户和菜单移至左侧,只需通过 SharePoint 设计器重新排列 v4 母版页副本中的控件即可。

SharePoint won't allow you to modify the ribbon in this way. You will have to use jQuery or similar to add a new list item (li) to the tabs unordered list (ul). You can find the list with firebug:

<ul class="ms-cui-tts" unselectable="on" role="tablist">
    <li class="ms-cui-tt" id="Ribbon.Read-title" unselectable="on" role="tab">
    <li class="ms-cui-tt" id="Ribbon.WebPartPage-title" unselectable="on" role="tab">
</ul>

Please note that this kind of solutions are not recommendable (Hard to maintain, unsupported, and this probably won't work in the next version of SharePoint).

To move the user and the menu to the left, just rearrange the controls in a copy of the v4 master page through SharePoint designer.

鸩远一方 2024-12-07 21:08:34

@阿方索是对的。只是为了为其他可能想要使用 jQuery 添加选项卡的人添加更多

$('<li class="ms-cui-tt ms-browseTab" style="line-height" unselectable="on" role="tab"><a class="ms-cui-tt-a"><span class="ms-cui-tt-span">You custom link here</span></a></li>').appendTo('ul[role="tablist"]');

内容,这将在“页面”选项卡的右侧添加一个项目

@alfonso is right. Just to add more for others who might want to add the tabs using jQuery

$('<li class="ms-cui-tt ms-browseTab" style="line-height" unselectable="on" role="tab"><a class="ms-cui-tt-a"><span class="ms-cui-tt-span">You custom link here</span></a></li>').appendTo('ul[role="tablist"]');

That will add an item to the right of the "page" tab

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文