Sharepoint 博客文章:根据发布日期排序
我有一个共享点内部网门户,其中有很多博客,并且它们有定制的设计。我们使用默认的数据表单 Web 部件来显示博客文章。默认情况下,帖子根据“创建日期”排序。
客户有一个新要求,要求我将排序标准更改为“发布日期”。在不使用 SharePoint Designer 的情况下实现此目标的最简单方法是什么?
笔记: 创建新视图不是解决方案,因为我无法应用自定义设计。
I have a sharepoint intranet portal which has many blogs and they have customized design. We use default Data form webpart for displaying blog posts. By default the posts are sorted based on "created date".
I have a new requirement from the client asking me to change the sorting criteria to "Published date". What is the easiest method to achieve this without using SharePoint Designer .
Note:
Creating a new view is not a solution as I will not be able to apply the customized design.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
为什么不能使用 SharePoint Designer?会快得多。您可能会做的是:
节点<OrderBy><FieldRef Name="Created"升序="TRUE"/></OrderBy>
Why can't you use SharePoint Designer? It would be much quicker. What you could probably do is:
<property name="DataSourcesString" type="string">
node<OrderBy><FieldRef Name="Created" Ascending="TRUE"/></OrderBy>
您不能编辑当前视图,以便它按发布日期排序吗? (我以为默认是发布日期..)
Cant you edit the current view, so it sorts by published date? (I thought the default was published date..)
您可以导出 webpart 并编辑下载的 .webpart XML 文件中的排序字段吗?
Can you export the webpart and edit the sorting field in the downloaded .webpart XML file?
谢谢Zincorp,
我可以按发布日期对帖子进行排序。但我在内网中有20多个博客,而我在生产服务器中没有访问权限。基于Zincorp的解决方案,我需要为每个博客创建新的Web部件或者需要编辑参数值,而这在我的情况下是不可能的。
所以我用另一种方式实现了这一目标。
首先,我创建一个从当前站点读取博客的 Web 部件。
使用 CAML 查询我可以读取 &按发布日期对帖子进行排序。
下一个任务是将所有发布数据表单 Web 部件替换为新的 Web 部件。为此,我创建了一个功能,可以获取网站集中的所有博客并使用以下代码替换 Web 部件
Thanks Zincorp,
I could sort post by published date. But I have more than 20 blogs in the intranet and I don’t have access in production server. And based on Zincorp’s solution I need to create new web parts for each blog or need to edit the parameter value, and it is not possible in my situation.
So I achieved this in another way.
First I crate a web part that reads the blog from current site.
And using the CAML query I could read & sort posts by published date.
The next task is to replace all the post data form web part with the new web part. For this I created a feature that fetch all the blogs in my site collection and replace the web part using below code