W-Mark Kubacki schrieb:
> Or, overwrite some methods of FeedController. Just copy lines such as 55 in
> 'turbogears/feed/feed.py'. (fc = FeedController(); fc.atom1_0 = tg.expose...)
> 
> (I believe TG would benefit from having the FeedController and its templates
> being shipped already altered for supporting XSL as parameter.)

Unfortunately, I haven't found a way yet, to make the xml-stylesheet PI
in any way dynamic. Kid doesn't  honor any directives in processing
instructions, it doesn't even do ${}-expansion, so you can't do:

<?xml-stylesheet type="text/xsl" href="${stylesheet}"?>

as it will just show up unaltered in the output. This also doesn't work:

<?xml-stylesheet py:if="defined('stylesheet')" type="text/xsl"
href="${stylesheet}"?>

Nor this:

<div py:if="defined('stylesheet')" py:strip="">
<?xml-stylesheet type="text/xsl" href="${stylesheet}"?>
</div>

because you can't have a second top-level element before the the 'feed'
element.

Apart from that, I have customized the Kid template for Atom 1.0 for my
applications and simplified the template code. The Atom feed now
supports categories and using dicts for the content of an entry, so one
can set the type, e.g.

entry['content'] = dict(
  type='html',
  value="""\
<h1>my blog post</h1>

<p>blahblah</p>
"""
)

I don't use RSS, but I guess one could easily change the templates for
it as well.

See the code here: http://paste.turbogears.org/paste/1433

Chris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to