Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is it possible to specify the 'Root element name' and 'Top-level child element name' for XML exports ?
views_datasource allows specifying these, where views_data_export outputs
<nodes>
<node>
specified fields...
</node>
</nodes>
Or did I miss this option? (I'm using the 7.x version).
Comment | File | Size | Author |
---|---|---|---|
#11 | views_data_export-1218896-specify-xml-elements.patch | 5.55 KB | Steven Jones |
#8 | views_data_export-1218896-8.patch | 3.82 KB | roderik |
#5 | views_data_export-1218896-5.patch | 4.38 KB | Dmitriy.trt |
#2 | views_data_export-1218896-1-svn.patch | 2.98 KB | skilip |
Comments
Comment #1
Steven Jones CreditAttribution: Steven Jones commentedNo, we base it on the base table, but there's nothing stopping us from adding this option.
Comment #2
skilip CreditAttribution: skilip commented1+ and a patch. I'm sorry for the SVN patch. It's just a few lines of code ;)
Comment #3
duncan.moo CreditAttribution: duncan.moo commentedso I did the same as I do on other views to override the theme, but it made no difference:
The view detected the override template file, but the row items still come out as and , not and as I would like. Is there a way of doing this through templates?
Comment #4
duncan.moo CreditAttribution: duncan.moo commentedJust switched to using views_datasource for what I am trying to do and it is a far simpler solution which does allow you to change the root and row items in your feed.
Comment #5
Dmitriy.trt CreditAttribution: Dmitriy.trt commentedRe-rolled against latest git code and fixed it a bit: sites can upgrade from original module without having to re-configure each XML display.
Comment #6
zrpnrPatch in #5 worked for me, the defaults show up correctly when no values are set.
Comment #8
roderikMindless* reroll; don't credit me.
* I did verify structure of code/changes is still the same and remove trailing space somewhere; am not familiar with the code's logic though.
Comment #9
joshf CreditAttribution: joshf commented#8 worked great for me; thanks for the patch!
Comment #10
Steven Jones CreditAttribution: Steven Jones commentedComment #11
Steven Jones CreditAttribution: Steven Jones commentedHere's a patch, based on #8, but with tests, if the test bot likes it, I'll commit it.
Comment #12
Steven Jones CreditAttribution: Steven Jones commentedThanks everyone! Committed to 7.x-3.x.
Comment #13
Steven Jones CreditAttribution: Steven Jones commentedWe should probably backport this to 6.x-2.x.
Comment #14
Steven Jones CreditAttribution: Steven Jones commentedPushed to 6.x-2.x