如何在 Plone 4 中创建粘性新闻项目
如何创建具有粘性的新闻项目?我们的主页有一个新闻集合(新闻项目存放在文件夹中),并选择了某些标准(发布、标签、发布日期;逆序)。主页新闻几乎每天更新;然而,有时有 1 或 2 条新闻需要在新闻列表(集合)的顶部停留较长一段时间。我该怎么做?
我搜索了Plone用户手册和Plone网站;尝试了几种收集配置;查看了像 ListingPages 和 Plumi 这样的插件,但似乎都没有我正在寻找的功能,并且在网络上搜索了“粘性内容”“粘性新闻项目”,但没有找到解决方案。如果有人知道如何做到这一点并且不介意分享,我真的很感激!谢谢你!
How can I create sticky news items? Our homepage features a news collection (news items housed in folder) with certain criteria selected (published, tags, published date; reverse order). The homepage news gets updated just about everyday; however on occasion there are 1 or 2 news items that need to stay at the top of the news list (collection) for an extended period of time. How can I do this?
I searched the Plone User Manual and Plone site; tried several collection configurations; looked at addons like ListingPages and Plumi but neither appear to have the feature I'm looking for, and have searched the web for "sticky content" "sticky news item" and have not found a solution. If anyone knows how to do this and wouldn't mind sharing, I really appreciate it! Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
您可以这样做:
然后,当您想要从列表中删除新闻项时,只需从中删除“精选”标签即可。
或者,您可以自定义新闻项目工作流程并添加新状态“精选”(其余过程非常相同)。
You could do it like this:
Then when you want a news item to be removed from the list, just remove the "featured" tag from it.
Alternatively you could customize your news item workflow and add a new state "featured" (the rest of the process is pretty the same).
Collective.flag 让您有机会将项目标记为特殊对象,我认为这在语义上比使用标签/关键字或工作流程状态进行区分更有意义。
显示和排序可以通过集合来完成(正如 Giaccomo 也写的那样),我建议 ContentWellPortlets 将 portlet 放置在您需要的地方。
collective.flag gives you the opportunity to mark an item as a special object, which makes semantically more sense than using a tag/keyword or workflow-state for distinction, I think.
Display and sorting can be done via collections (as Giaccomo also wrote), I recommend ContentWellPortlets to place portlets where you need them.
尚未发布,但我刚刚遇到了 davisagli 的“collective.sticky”: https://github.com/davisagli /collective.sticky/
No release yet but I just came across davisagli's "collective.sticky": https://github.com/davisagli/collective.sticky/
我建议您看一下这篇旧博客文章: 超越新闻项目:Plone 中新闻行业标准的需要。
我们一直致力于开发 collective.nitf,这是一种新的基于 Dexterity 的内容类型,旨在解决此类问题的问题。它已经准备好在使用 Plone 4.1 的站点上进行生产,但现在我们正在进行一些小的重构。
一旦我们完成将一些代码移动到另一个包并更改字段名称,我将在下周发布它。
I would suggest you to take a look at this old blog post: Beyond News Items: the need for news industry standards in Plone.
We've been working on collective.nitf, a new Dexterity-based content type to solve this kind of issues. It's pretty ready for production on sites using Plone 4.1 but right now we are in the middle of some minor refactoring.
I will release it next week as soon as we complete the move of some code to another package and change the name of a field.
据我所知,没有办法在股票克隆中创建所谓的粘性新闻。
您可以尝试按生效日期排序(最新的在顶部),并为您的置顶新闻手动设置生效日期。
设置时间<=现在并且>比不应具有粘性的最新新闻站点的创建日期。
不幸的是,这意味着每次添加新新闻项目时都要触摸便签纸。
或者设置新新闻站点的生效日期,使其在粘性新闻之前和最新的非粘性新闻之后。
afaik there is no way to create what you call sticky news in stock plone.
you could try soring by effective-date (newest on top) and set the effecitve date manually for your sticky news.
set a time <= now and > than the creation date of the newest newsitem that should not be sticky.
unfortunately this means touching your sticky notes each time you add a new news item.
or set the effective-date of your new newsitems so its before your sticky news and after the newest non-sticky news.
这是一个令人羞愧的过时方法,但是嘿它仍然有效™:您可以使用 Products.CMFPublicator实现你想要的。如果您有任何疑问,请查看并在此处回复。
另一个旧的解决方案是使用 Products.CMFContentPanels。您甚至可以尝试将两者结合起来!
It's an ashamingly outdated method but hey It Still Works™: you could use Products.CMFPublicator to achieve what you want. Have a look at it and reply here if you have any doubts.
Another old-aged solution would be using Products.CMFContentPanels. You can even try a combination of both!
另一种粘性新闻项目的方法: http://pypi.python.org/pypi/collective.stickyitem< /a>
Another approach to sticky news item: http://pypi.python.org/pypi/collective.stickyitem