在Wiki页面底部获取代码段或类似内容以显示当前版本号和版本日期 [英] Getting a snippet or similar on bottom of a wiki page to show the current version number and version date

查看:65
本文介绍了在Wiki页面底部获取代码段或类似内容以显示当前版本号和版本日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Wiki页面的底部获取一个片段或类似内容,以显示当前的版本号和版本日期。我需要这个来自动填充以反映维基页面编辑。


我找到了一个脚本并将其添加到维基页面上的一个片段但不幸的是它只显示了当时的版本和日期它已添加到页面中,并且未针对后续页面编辑进行更新。它还自动嵌入了我不想要的page\page历史记录
的链接。


希望有人可以提供帮助!


TIA



解决方案

您好,


我们可以将以下代码添加到脚本编辑器Web部件中,进入维基页面来实现它。

< script src =" https://code.jquery.com/jquery-1.12.4.min.js"类型= QUOT;文本/ JavaScript的">< /脚本> 
< script src =" https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"类型= QUOT;文本/ JavaScript的">< /脚本>
< script type =" text / javascript">


(function(){
var pageName = window.location.pathname.split(" /"。)。pop();


.ajax({
url:_spPageContextInfo.siteAbsoluteUrl +" / _ api / web / lists / getbytitle('Site%20Pages' )/项目?

I need to get a snippet or similar on the bottom of a wiki page to show the current version number and version date. I need this to auto populate to reflect the wiki page edits.

I found a script and added it to a snippet on the wiki page but unfortunately it only showed the version and date at the time it was added to the page and didn't update for subsequent page edits. It also automatically embedded a link to the page\page history which I do not want either.

Hope someone can help!

TIA

解决方案

Hi,

We can add the following code into a script editor web part into wiki page to achieve it.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js" type="text/javascript"></script>
<script type="text/javascript">


(function(){ var pageName = window.location.pathname.split("/").pop();


.ajax({ url: _spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/getbytitle('Site%20Pages')/items?


这篇关于在Wiki页面底部获取代码段或类似内容以显示当前版本号和版本日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆