Giter Club home page Giter Club logo

ftw.contentpage's Introduction

Introduction

ftw.contentpage provides some content types optimized for organisations, communities, associations, and more.

It uses simplelayout to manage and display the content.

Installing

  • Add ftw.contentpage to your buildout configuration:
[instance]
eggs +=
    ftw.contentpage
  • Install the generic import profile.

Uninstall

This package provides an uninstall Generic Setup profile, however, it will not uninstall the package dependencies. Make sure to uninstall the dependencies if you no longer use them.

Important upgrade notes

If you upgrade ftw.contentpage to 1.6 or greater. The IOrgUnitMarker interface does not longer exists. The marker Interfaces is replaced with the IAuthority interface. Also the behaviour changed how the marker interface is applied to the ContentPage: OLD: By adding or removing an AddressBlock NEW: By manually ticking the "Mark content for listings" checkbox on the ContentPage. Run the ftw.contentpage upgrades steps and your site will be fine.

Usage

Types:

  • ContentPage: Folderish type for the site structure. Contains the blocks
  • AddressBlock: AddressBlock contains address informations and it uses ftw.geo to render a map
  • ListingBlock: A folderish block, which lists files and images by default. Two block views are provided: Tabular listing and a gallery view. The columns of the file listing are configurable per block. The default set of columns is configured through the the registry (plone.app.registry). The default sort order of the Listingblock file listing can be configured per block.
  • EventPage / EventFolder: A simple and minimal event implementation based on a ContentPage.
  • News / NewsFolder: A simple news implementation based on a ContentPage.

Special views:

There's a two-column and two-level overview named authorities_view, which displays a list of ContentPages with with the IAuthority interface. The IAuthority interface ist added and removed by ticking a checkbox called "Mark content for listings" on the ContentPage. This allows to decide if a ContentPage is displayed on the authorities_view manually. The checkbox is implemented with archetypes.schemaextender, which allows to extend other content types:

Code example:

<class class="dotted.name.to.my.class">
  <implements interface="ftw.contentpage.interfaces.IAuthoritySupport" />
</class>

The Checkbox is protected with the permission: ftw.contentpage: Toggle IAuthority marker interface.

The EventFolder has a simple events listing, which shows the next 10 upcoming events (batching included).

The NewsFolder has a simple news listing, which shows the 10 most recent news entries (batching included).

ContentListing viewlet:

The content listing viewlet is registered for all ContentPages. It shows categorized subcontent, within the ContentPage The categorization is done by a schemaextender field, so it's also possible to categorize your own or any other content. There's also a behavior (ftw.contentpage.behaviors.content_categories.IContentCategories), which extends your DX content by the same functionality.

Code example:

<class class="dotted.name.to.my.class">
  <implements interface="ftw.contentpage.interfaces.ICategorizable" />
</class>

** Teaser Image ** All content pages, event pages and news are able to display a teaser image, which is stored on the content itself. It behaves like a regular block and shows also the description. The teaser image related fields have their own write permission, one per content type. Take a look at the rolemap.xml for details.

** Portlet ** It's possible to enable an archive portlet for News and EventPages. It only works if the current view is the news or event listing view. The portlet is not created by default.

ftw.contentpage is using the additional slot provided by simplelayout (implements the IAdditionalListingEnabled interface of simplelayout)

So the layout has the following structure:

  1. Simplelayout main slot for blocks
  2. The content listing viewlet
  3. The additional slot for blocks

This way it's possible to display content below the content listing viewlet (by drag'n'drop)

** Captcha ** The feedback view is protected from unauthorized users by a captcha from ReCaptcha. To enable it you have to configure your ReCaptcha public and private keys through the @@recaptcha-settings view on the site root.

ftw.lawgiver support

ftw.contentpage supports ftw.lawgiver

Check: https://github.com/4teamwork/ftw.lawgiver

Compatibility

Runs with Plone 4.1, 4.2 or 4.3.

Links

Copyright

This package is copyright by 4teamwork.

ftw.contentpage is licensed under GNU General Public License, version 2.

ftw.contentpage's People

Contributors

jone avatar maethu avatar mbaechtold avatar elioschmutz avatar deiferni avatar buchi avatar shylux avatar bierik avatar ninfaj avatar lukasgraf avatar treinhard avatar phabegger avatar tschanzt avatar href avatar senny avatar phgross avatar

Stargazers

Cesare Ghirelli avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar 4teamwork Jenkins avatar James Cloos avatar Bernhard Bühlmann avatar Murat Tokmak avatar Linus Luginbühl avatar Furkan Kalınsaz avatar Ursula Bühlmann avatar Fabian Guyer avatar Nicola Lorenz avatar  avatar Marco Baumgartner avatar  avatar Daniel Jowett avatar

Forkers

treinhard seantis

ftw.contentpage's Issues

getLocation of EventPage is broken

getLocation completely ignores the value of the location string-field. Its behavior should be changed in such a way that it first tries to access the location value. If no location value is available it should fall back to its current behavior (get the first addressblock value, if available).

Migration issue: initial layout is not set

With #47, adding the teaser feature, subscribers are added, setting the inital layout for all ITeaser objects.
When migrating older objects the upgrade step does not set the initial layout.
This leads to inconsistent state.

Release auf plone.org

@maethu Released ftw.contentpage 1.5 but couldn't upload it to plone.org. Unauthorized.

Could you do this for me? Thx

TinyMCE reference browser configuration

ftw.contentpage should configure its types properly in the reference browser configuration of TinyMCE.

Something like this (tinymce.xml):

<?xml version="1.0"?>
<object>
    <resourcetypes>

        <linkable purge="False">
            <element value="ContentPage"/>
            <element value="EventFolder"/>
            <element value="EventPage"/>
            <element value="News"/>
            <element value="NewsFolder"/>
        </linkable>

        <containsobjects purge="False">
            <element value="ContentPage"/>
            <element value="EventFolder"/>
            <element value="EventPage"/>
            <element value="News"/>
        </containsobjects>

    </resourcetypes>
</object>
  • check that all types are configured
  • add tests

How add links?

How add links tinymce another contentpage?
plonebrowser: no items in this folder

RSS does not work on Plone 4.3

Original Issue 4teamwork/ftw.contentmenu/issues/3 by @href:

Opening the news_rss_listing in Plone 4.3 will lead to the following error:

Traceback (innermost last): 
Module ZPublisher.Publish, line 60, in publish 
Module ZPublisher.mapply, line 77, in mapply 
Module ZPublisher.Publish, line 46, in call_object 
Module ftw.contentpage.browser.newslisting, line 16, in __call__ 
Module ftw.contentpage.browser.baselisting, line 32, in __call__ 
TypeError: __call__() takes at least 2 arguments (1 given)

Add Message if no news are found

At the moment if the "Show more news" option is selected and there are no news within the specified dates only the "More news" link is displayed which is kind of odd, since we don't have any news. Maybe we should display a text that indicates that there were no News found within the selected dates.

Alphabetical subject listing based on subject field

See e.g. http://www.bern.ch/bern_index

  • There are separate listings for subjects starting with letter A, B, ..., Z. German umlauts like ä, ö, ü have to be listed in the categories A, O, and U respectively.
  • On each listing page corresponding to a specific letter, all subjects starting with that letter are listed in alphabetical order.
  • All links to pages listed for a specific subject are listed in alphabetical order (title).

Upgrade step fails

bildschirmfoto 2013-05-20 um 10 04 40

Results in:

Benutzername
admin (admin)
Anfrage URL
http://localhost:8080/ebikon/@@manage-upgrades
Fehlertyp
ValueError
Fehlerwert
too many values to unpack
Traceback (innermost last):

Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module ftw.upgrade.browser.manage, line 65, in __call__
Module ftw.upgrade.browser.manage, line 98, in install_with_ajax_stream
Module ftw.upgrade.browser.manage, line 79, in install
Module ftw.upgrade.executioner, line 30, in install
Module ftw.upgrade.executioner, line 40, in _upgrade_profile
Module ftw.upgrade.executioner, line 49, in _do_upgrade
Module Products.GenericSetup.upgrade, line 140, in doStep
Module ftw.upgrade.step, line 27, in __new__
Module ftw.contentpage.upgrades.to1008, line 12, in __call__
Module ftw.contentpage.upgrades.to1008, line 17, in remove_security_settings_from_blocks
ValueError: too many values to unpack

Missing update.js from the branch mle-multiupload

@maethu The merge commit: "2e099c4 Merge pull request #106 from 4teamwork/mle-fix-collaps-js" adds the update.js to the js registry. But the update.js is missing on master.

The update.js file will be added on the following branch: "origin/mle-multiupload" but it's not merged yet...

Show Form Folders in Content Page Listing View

Forms folder are not visible in content page listing (authorities?) view. I see two possible ways to show the Form Folders

  • Add to the list "Thema"
  • Add a new separate Block/List for Form Folder

I would prefere the second option.

formulare

Improve News Archive Portlet

If there are a big amount of news, the portlet is confusing.

bildschirmfoto 2013-07-04 um 15 09 46

Solution:

If all the news are in the same year, it's fine. But if it's more than one year, we could implement a collapsable navigation with javascript. It shows all the years with the amount of news. If you click on it, it collapse the months. Another click on a month has the same behavior like now. It opens a view with all news of this month.

  • 2011 (234)
  • 2012 (534)
    • Jan (10)
    • Feb (234)
      ...
  • 2013 (120)

@jone @lukasgraf @phgross @tschanzt What do you think about it? Other solutions?

Performance of authorities view is insufficient.

view.contents() is called twice

The approach of making multiple catalog queries (one per children) may not be a good idea.
Using the sitemap approach may improve performance.
If this doesn't help, some kind of caching has to be implemented.

Example of a slow page with authorities view:
http://www.zg.ch/behoerden

btw. the columns are not equally spread.

see GlobalSectionsViewlet in bern.intranettheme.viewlets.viewlets.py for an idea how to implement this.

Replacing content categories behavior widget

@maethu I've just discovered that I've implemented a content categories behavior (in custom code) using collective.z3cform.keywordwidget:

from collective.z3cform.keywordwidget.field import Keywords
from ftw.contentpage import _ as _contentpage
from ftw.contentpage.interfaces import ICategorizable
from plone.directives import form
from zope.interface import alsoProvides


class IContentCategories(form.Schema, ICategorizable):

    content_categories = Keywords(
        title=_contentpage(u'label_categories', default=u'Categories'),
        description=_contentpage(u'help_categories',
                                 default=u'Category for contentlisting'),
        index_name='getContentCategories',
        required=False)


alsoProvides(IContentCategories, form.IFormFieldProvider)

It looks like this:
bildschirmfoto 2015-03-01 um 12 40 22

This does not require defining a vocabulary and has only one field. Might be a better approach than #211.
What do you think?

Adjust byline information

Per default, the byline shows us the workflowstate, and some user informations.

With the workflowstate, the user knows, if the content is visible for other users or not. But if the user sets the effectiveDate, the content can be published, but is not visible for visitors. This information is missing in the byline and should be listed...

The byline is overridden in:

  • egov.core.viewlets.viewlets.EgovBylineViewlet
    • registered for: egov.core.browser.interfaces.IeGovSpecific
    • inherits from: plone.app.layout.viewlets.content.DocumentBylineViewlet
  • ftw.contentpage.viewlets.byline.NewsByline
    • registered for: ftw.contentpage.interfaces.INews
    • inherits from: plone.app.layout.viewlets.content.DocumentBylineViewlet

The implementation in ftw.contenpage is just for News. Both are inheriting from the plone default byline and the news implementation is almost the same as the egov implementation (double code). It just adds the creator to the byline.

  1. Whats the reason for the two implementations? Could we merge them? --> The newsbyline could be assume for the egov byline that we can delete the implementation for news.
  2. The egov byline will be extended with the new expiration, effective date informations
  3. Hint: The default plone byline already includes the expiration date (shows a hint, if the content is expired) but we remove this in our implementation.

Here are the infos to list in the byline:

  • the effective date is in the future
    • "not visible"
  • no effective date is set or is in the past
    • display nothing
  • the expirationDate is in the past
    • plone default ('is expired')
  • the effective date is in the past and the expiration date in the future
    • "visible from xxx to xxx"

@maethu @jone @phabegger What you think about?

#-Tag in subjectlisting does not work

If you click on the # - tag, the publishTraverse method is not called... i think because this is not a valid request?? /#

So, the self.letter var will not be updated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.