Re: Problem extending SilvaNews

Andy Altepeter <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Organization Bethel University
Message-ID <[email protected]>
Hi Pierre,

You can use the same scheme, adding your custom metadata, e.g.:

scheme = 'http://infrae.com/namespaces/metadata/silva-news'
meta_template = (
    '<meta scheme="http://infrae.com/namespaces/metadata/silva-news" '
    'name="%s" content="%s" />')
metas = []
if hasattr(version, 'teaser'):
    content = entitize_and_escape_pipes(version.teaser_editable())
    metas.append(meta_template % ('teaser', content))

The scheme is only used to identify during processing what set of metadata the 
value belongs to.  This allows you to extend the properties with your own 
metadata sets.

I have patched SilvaNews to provide support for a teaser, a display method 
(default, full content, lead_paragraph, lead paragraph + image, teaser, 
teaser + image), external link (news item just appears in viewers and links 
to content elsewhere), and a link method (none, external link, article).

The version of SilvaNews my modifications are based on is 2.1.1.  If you're 
interested, I can send it along.

It also has support for "news images".  News Images are assets that can be 
attached to a news item, and include keywords.  You can have multiple news 
images for a news item, perhaps keyed on 'intranet', 'external site', "25px 
by 50px", etc.  News Viewers can be configured to display "news images" with 
certain keys.  So, you can have a news viewer that displays only "25px by 
50px" images, or one that specifically displays images approved for your 
intranet.  Kupu has also been patched to include a "news images" tool to 
manage these.

Let me know if you're interested.

Andy


On Friday 24 November 2006 04:48, Pierre Gumy wrote:
> We use the SilvaNews product and want to create a new product
> extending SilvaNews with new content types.
>
> Our new content types have some new properties (short_teaser,
> authors_info, ...), extending the ones of SilvaNews content types
> (location, subjects, target_audiences,...).
>
> In order to edit our new content types (myobject/edit/tab_edit) using
> kupu, we have to extend the list of editable properties we can see
> into the right column of the kupu-editor view (where location,
> subjects and target_audiences in SilvaNews already appear).
>
> Problem: this part of code is using a link to infrae in order to build
> the 'metas' variable into the kupu_content.py script:
>
> scheme = 'http://infrae.com/namespaces/metadata/silva-news'
> meta_template = (
>    '<meta scheme="http://infrae.com/namespaces/metadata/silva-news" '
>    'name="%s" content="%s" />')
>
> metas = []
>
> -> how can I include the new properties (short_teaser, authors_info,
> ...) of my new content types here in order to edit them using the
> kupu-editor view?
>
> Cheers
> Pierre
>
> --
> [email protected]
> _______________________________________________
> silva-dev mailing list
> [email protected]
> https://infrae.com/mailman/listinfo/silva-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.