If you haven't yet played with Views RSS module's preprocess
functions (2.x versions only) this entry does not concern you.
If you have though, and more importantly - are using them, you probably noticed that each preprocess
function receives a number of variables, based on which XML elements are later built in the template file. Those variables are:
$element
- name of current XML element being preprocessed
$value
- value of the current XML element
$item
- full feed row, containing all <item>
element values
$view
- view object
$raw
- recently introduced, containing full element returned by Views RSS formatter (if the value was generated by such formatter).
I am reconsidering this format right now. Especially now that formatters are starting to return values ready to be passed directly to format_xml_elements()
(see previous entry Views RSS: D7-style formatters in D6), it just doesn't feel right that preprocess functions do not use the same format.
What I am thinking about is getting rid of $element
and $value
variables and replacing them with one $elements
variable instead, compatible with format_xml_elements()
. Need to play with the idea a bit, but as I imagine it this change should provide even more flexibility for Views RSS and all its extension modules.
Also, this way we could perhaps get rid of views-view-views-rss-field.tpl.php
and views-view-views-rss-fields.tpl.php
template files as well.
The drawback of this change is that it will force all of you who defined your own preprocess functions to rewrite them when switching to a new version of the module, and it feels a bit strange to introduce such major change after 2 already published release candidates, but well, better now than after final 2.0 release I guess?
Thoughts?