Skip to main content

Provides dexterity content types for news articles.

Project description

Introduction

ftw.news provides dexterity content types for news articles and an integration for ftw.simplelayout (news listing block). An optional feature can be installed allowing the news listing block on the Plone Site to render specially marked news items only.

Compatibility

Plone 4.3.x

Installation

  • Add the package to your buildout configuration:

[instance]
eggs +=
    ...
    ftw.news
  • Install the “default” GenericSetup profile.

  • Optionally (and additionally to the “default” GenericSetup profile) you may install the “show-on-homepage” GenericSetup profile.

Usage

Create a news folder then start adding news items into the folder.

News listing and archive portlet

By default, news folders support simplelayout and a news listing block is added to the news folder when the folder is created. There is also a news archive portlet, which works with the news_listing view, but it does only appear on the news folder when the news folder default layout is switched to news_listing or on views such as the archive view of the news listing block. The portlet does not appear on the simplalyout view (standard view) of news folders because they may have no or many news listing blocks, which would then be confusing.

Mopage Support

ftw.news provides integration for the mopage mobile app (http://web.anthrazit.org/).

Data Endpoint

The view mopage.news.xml returns an XML-feed with the latest news within the context it is called. It can becalled on any type of object.

  • The mopage-API expects a partnerid and a importid. They are incldued when submitted via GET-parameter, e.g.: http://foo.com/news/mopage.news.xml?partnerid=123&importid=456

  • The endpoint returns only 100 news by default. This can be changed with the parameter ?per_page=200.

  • The endpoint returns Link-headers in the response with pagination links.

Trigger behavior

The behavior ftw.news.behaviors.mopage.IPublisherMopageTrigger can be added on a news folder in order to configure automatic notification to the mopage API that new news are published.

In order for the behavior to work properly you need an ftw.publisher setup. Only the receiver-side (public website) will trigger the notification. A configured collective.taskqueue is required for this to work.

Buildout example:

[instance]
eggs +=
    ftw.news[mopage_publisher_receiver]

zope-conf-additional +=
    %import collective.taskqueue
    <taskqueue />
    <taskqueue-server />

Then enable the behavior for the news container type and configure the trigger with the newly availabe fields.

Development

Python:

  1. Fork this repo

  2. Clone your fork

  3. Shell: ln -s development.cfg buildout.cfg

  4. Shell: python boostrap.py

  5. Shell: bin/buildout

Run bin/test to test your changes.

Or start an instance by running bin/instance fg.

Changelog

1.6.1 (2017-01-17)

  • Mopage: exclude file listings and galleries. [jone]

1.6.0 (2017-01-16)

  • Add a new field on news items which can be used to define a custom external url (useful for mobile apps). [mbaechtold]

1.5.0 (2017-01-11)

  • Users having the permission to add news items will see inactive news items in the news listing block. [mbaechtold]

  • Fix small RST Syntax error in readme file. [raphael-s]

1.4.6 (2016-12-06)

  • Fix filter for subjects containing umlauts in newslistingblock. [mathias.leimgruber]

  • Mopage: fix textlead max length (from 100 to 1000). [jone]

  • Fix news item class identifier. [Kevin Bieri]

1.4.5 (2016-11-11)

  • Do not show news time. [jone]

1.4.4 (2016-11-10)

  • Fix encoding error in mopage endpoint. [jone]

1.4.3 (2016-10-20)

  • Fix chameleon support for mopage export. [jone]

1.4.2 (2016-10-18)

  • Mopage: fix CDATA escaping. [jone]

1.4.1 (2016-09-30)

  • Mopage endpoint: fix entity escaping. [jone]

  • Mopage: add custom modified date for tracking content changes. [jone]

1.4.0 (2016-09-26)

  • Mopage trigger: trigger on any update of the news. [jone]

  • Mopage endpoint: remove web_url-tag as it is ambiguous. [jone]

  • Improve mopage body by using simple HTML. [jone]

  • Use simplelayout by default for news folders. [jone]

1.3.1 (2016-09-19)

  • Fix encoding error in mopage. [jone]

1.3.0 (2016-09-13)

  • Implement mopage news trigger behavior. [jone]

1.2.0 (2016-09-07)

  • Fix plone first heading of news listing view on various portal types. [mbaechtold]

  • Implement “mopage.news.xml” API browser view. [jone]

  • Enable IExcludeFromNavigation behavior for news folders. [jone]

  • Enable IPublication behavior for news. [jone]

1.1.5 (2016-07-07)

  • Add a wrapper class to the news footer action on the news listing block. The news listing portlte allready has one. This makes styling the actions more easier. [mathias.leimgruber]

1.1.4 (2016-05-20)

  • Adjusts the formatting of the date and time displayed on the page of a news item. Time doesn’t show up if it is set to 00:00. [raphael-s]

  • Archive portlet now respects the config of NewsListingBlock or NewsListing Portlet. [mathias.leimgruber]

  • Use the query provided by the view for the archive portlet. [mathias.leimgruber]

  • Call news_listing view on NewsListingBlock and optain query from block for news listing. [mathias.leimgruber]

1.1.3 (2016-04-20)

  • Adjusts the date and time displayed for each news item in a news folder. Doesnt show time if there is no time set. [raphael-s]

  • Adds a profile which installs an additional feature allowing to mark news item to be shown on the homepage (if the news listing block is configured to do so). [mbaechtold]

1.1.2 (2016-04-11)

  • Fix the link in the RSS feed (link to parent instead of the feed itself). [mbaechtold]

  • The news listing block renders news items the same way as the news portlet and the news listing view. [mbaechtold]

1.1.1 (2016-03-04)

  • Define individual scale for news listing block. Define default image for news listing block. [Kevin Bieri]

1.1.0 (2016-03-03)

  • Implement accessibility support for archive portlet tree. [Kevin Bieri]

  • Rework styling based on ftw.theming [Kevin Bieri]

  • get_creator should no fail if the user no longer exists. [mathias.leimgruber]

  • Eliminate declaration warning for nonexistent methods. [jone]

  • Do not show ftw.news.News in navigation by default. [elioschmutz]

  • Apply styling based on new ftw.theming variables set.

    • Remove read more link becuase the link of the heading has the same target so the read more link is obsolete.

    [Kevin Bieri]

  • Implement newslistingblock listing styles + Convert to html list. This has now the same styles as the regular newslisting. [mathias.leimgruber]

  • Implement news portlet styles. [mathias.leimgruber]

  • Implement news listing styles. [mathias.leimgruber]

  • Convert newslisting into a html list for the sake of accessibility. [mathias.leimgruber]

1.0.0 (2015-12-04)

  • Nothing changed yet

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftw.news-1.6.1.tar.gz (57.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page