Re: A simple question about ordering of posts

chombee <[email protected]> Sun, 31 Jan 2010 18:23:14 +0000
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <20100131182314.GA8530@kisimul>
On Sun, Jan 31, 2010 at 06:12:53PM +0000, chombee wrote:
> No, I'm talking about the entrydata dict that the parse method
> implemented by a cb_entryparser plugin should return to pyblosxom. This
> dict is not passed to your plugin from pyblosxom, your plugin creates
> the dict from scratch and returns it to pyblosxom. Look at the parse
> method in this example:
> 
> http://pyblosxom.sourceforge.net/1.5/dev_writing_plugins.html#writing-an-entryparser
> 
> It constructs and returns a dict `entrydata` with the keys 'title' and
> 'body'. You could also add any other keys you wanted to this dict, and
> their values could be used by your flavours or your other plugins. And
> you can add the 'template_name' key, which is used by pyblosxom:
> 
> "You can also specify the template to use by setting the "template_name"
> variable in the returned dict. If the template specified doesn’t exist,
> PyBlosxom will use the story template for the specified flavour."
> 
> So if you put 'template_name' = 'story-title-only' in the dict, then
> pyblosxom will look for a template file called 'story-title-only' in
> your flavour instead of using the default template file 'story'.

Having said all this, cb_entryparser doesn't really seem like the right
callback for what you want to do. You don't really want to change how
the entry is parsed from file, just how the entry is rendered. Maybe a
cb_postformat plugin that adds a 'template_name' key to the entry_data
dict. cb_postformat gets an entry_data dict already parsed from file and
the request object as its arguments, so it seems well placed to add or
not add a 'template_name' key to entry_data based on the contents of the
request.

Also, if you write a cb_postformat plugin then you might be able to
contribute something to the currently empty 'Writing a postformatter
plugin' section in the docs!

http://pyblosxom.sourceforge.net/1.5/dev_writing_plugins.html#writing-a-postformatter

Maybe there are some examples of postformatter plugins in the plugin
registry, I'm not sure.


------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
pyblosxom-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyblosxom-users