How are the formatters supposed to work and connect together?

0 views
Skip to first unread message

Lennart Regebro

unread,
Dec 29, 2009, 10:20:56 AM12/29/09
to singing...@googlegroups.com
I checked in a full formatter based on a template, but testing it on a
collection tells me this didn't work as I expected, so I removed it
again.

In general, it doesn't make any sense to me at all. Is there some sort
of coherent principal thinking behind how it works now, and if so
where is it documented? As a starting question:

All formatters implement IFormatItem, but then they are registered in
ZCML as IFullFormatters. Then all items are wrapped in
FullFormatterWrappers. It seems to me that we can remove the
FullFormatterWrapper and the registering of formatters as
IFullFormatters, and exactly the same thing would happen.

So what is the purpose of the FullFormatter thingy at all? I can't
find any explanation of what "full" formatting is as opposed to not
full formatting.

Also, there seem to be no way to actually format the whole newsletter
as such. Just items. And I need to format the full newsletter.

Should I rip it all out and make something else, because as it is now
there seems very little chance of actually styling newsletters in some
sort of sensible way. Because that's what I feel like, but I'm
slightly annoyed, so that may be the reason. :)

Rok Garbas

unread,
Dec 29, 2009, 10:35:14 AM12/29/09
to singing...@googlegroups.com
maybe this might help you ...
http://groups.google.com/group/singing-dancing/browse_thread/thread/408eca790423a488/86d2cdf977c6af3c

2009/12/29 Lennart Regebro <lreg...@jarn.com>:

> --
> To post to the "Singing & Dancing" group, send email to singing...@googlegroups.com
> To unsubscribe from this group, send email to
> singing-danci...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/singing-dancing

--
Rok Garbas, Python.Zope.Plone consulting
web: http://garbas.si
phone(si): +386 70 707 300
phone(es): +34 68 941 79 62
email: r...@garbas.si

Lennart Regebro

unread,
Dec 29, 2009, 10:54:29 AM12/29/09
to singing...@googlegroups.com
On Tue, Dec 29, 2009 at 16:35, Rok Garbas <rok.g...@gmail.com> wrote:
> maybe this might help you ...
> http://groups.google.com/group/singing-dancing/browse_thread/thread/408eca790423a488/86d2cdf977c6af3c

Yes, it did, I should in fact override the composer.
It's not a question of "Generic" vs "Easy", in fact to be able to
format things reasonably you must do both.

Funny that everything uses the ZCA except selecting composers. We'll
have to fix that so you can change composer. Users will want to create
new newsletters, and select the custom composer manually.

--
Lennart Regebro
www.jarn.com/lregebro

david bain

unread,
Dec 29, 2009, 12:38:14 PM12/29/09
to singing...@googlegroups.com
I'd love to see S&D reach the point where a user can browse a selection of templates visually and customize them with their banner etc...

But I'm careful what I wish for, since it generally means I might have code it myself :)


--

Lennart Regebro

unread,
Dec 29, 2009, 1:16:59 PM12/29/09
to singing...@googlegroups.com
On Tue, Dec 29, 2009 at 18:38, david bain <pigeon...@gmail.com> wrote:
> I'd love to see S&D reach the point where a user can browse a selection of
> templates visually and customize them with their banner etc...

It might be possible to extend the composer with a "Template" drop
down, to use instead of the default template file, but I'm not sure
how to best register the available templates.

--
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64

Daniel Nouri

unread,
Dec 29, 2009, 2:00:06 PM12/29/09
to singing...@googlegroups.com, Lennart Regebro
On Tue, Dec 29, 2009 at 7:16 PM, Lennart Regebro <reg...@gmail.com> wrote:
> On Tue, Dec 29, 2009 at 18:38, david bain <pigeon...@gmail.com> wrote:
>> I'd love to see S&D reach the point where a user can browse a selection of
>> templates visually and customize them with their banner etc...
>
> It might be possible to extend the composer with a "Template" drop
> down, to use instead of the default template file, but I'm not sure
> how to best register the available templates.

I had exactly this idea a while ago but never got around to implementing it.


Daniel

Lennart Regebro

unread,
Dec 30, 2009, 12:56:50 PM12/30/09
to Daniel Nouri, singing...@googlegroups.com

OK, done and checked in.

Next step: I need to improve the rendering of content. This is already
overrideable, and I can just add custom item formatters for the
content, but that would mean one formatter per content type, more or
less. Naybe we can do something more generic? Any ideas?

Daniel Nouri

unread,
Jan 2, 2010, 3:03:41 PM1/2/10
to Lennart Regebro, singing...@googlegroups.com
On Wed, Dec 30, 2009 at 6:56 PM, Lennart Regebro <reg...@gmail.com> wrote:
> On Tue, Dec 29, 2009 at 20:00, Daniel Nouri <daniel...@gmail.com> wrote:
>> On Tue, Dec 29, 2009 at 7:16 PM, Lennart Regebro <reg...@gmail.com> wrote:
>>> On Tue, Dec 29, 2009 at 18:38, david bain <pigeon...@gmail.com> wrote:
>>>> I'd love to see S&D reach the point where a user can browse a selection of
>>>> templates visually and customize them with their banner etc...
>>>
>>> It might be possible to extend the composer with a "Template" drop
>>> down, to use instead of the default template file, but I'm not sure
>>> how to best register the available templates.
>>
>> I had exactly this idea a while ago but never got around to implementing it.
>
> OK, done and checked in.

Awesome, thanks! I think this change warrants a bump of version
numbers to 0.9. Since, from what I understand, there's a chance that
people will get newsletters with different HTML. Is that so?

> Next step: I need to improve the rendering of content. This is already
> overrideable, and I can just add custom item formatters for the
> content, but that would mean one formatter per content type, more or
> less. Naybe we can do something more generic? Any ideas?

I can't think of a more generic way. Except for the "crazy render and
strip solution". ;-)


Daniel

Lennart Regebro

unread,
Jan 2, 2010, 3:13:20 PM1/2/10
to Daniel Nouri, singing...@googlegroups.com
On Sat, Jan 2, 2010 at 21:03, Daniel Nouri <daniel...@gmail.com> wrote:
> Awesome, thanks!  I think this change warrants a bump of version
> numbers to 0.9.  Since, from what I understand, there's a chance that
> people will get newsletters with different HTML.  Is that so?

Nah, it should use the old template by default.

> I can't think of a more generic way.  Except for the "crazy render and
> strip solution". ;-)

OK. Well keep that as a fallback. :)

Reply all
Reply to author
Forward
0 new messages