This patch allows to use some arguments in the name of the exported file. If the argument is a node nid, its value is replaced by the node title.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

neclimdul’s picture

patch missing

B-Prod’s picture

Sorry, stupid omission!

djroshi’s picture

I'm getting an error at

/admin/build/views/ajax/display/[view name]/feed_1/style_options

caused by the following line in views_bonus_plugin_style_export.inc

'#description' => t('The filename that will be suggested to the browser for downloading purposes. %view will be replaced with the view name , !arg.',array('!arg' => implode( ',', array_map( create_function('$item','return "%$item";'), array_keys($view->display[$view->current_display]->handler->get_option('arguments')))))),

B-Prod’s picture

@djroshi: Is it possible to have more details about this error, like the PHP message if any.
array_map error ?
isset error ?

Thanks

dboulet’s picture

Here's an alternate patch, for review.

Cyberwolf’s picture

Subscribing.

dambrisco’s picture

Subscribing.

Boobaa’s picture

Title: Use view arguments in file name » Use more tokens in file name
Version: 6.x-1.x-dev » 6.x-1.1
Component: Code » Views Export
FileSize
4.9 KB

Taking dboulet's patch in #5 as a foundation, I have added two more tokens: %timestamp (provides something like 2010-10-06_12-45-50) and %exposed (provides something like filter1_foo-filter2_bar).

ionmedia’s picture

#8 looks very interesting, can you, Boobaa, attach patched file ? (i have no access to shell on my hosting, only ftp)

maartenzam’s picture

Applied patch from #5 and works as expected.
Thanks!

sgtsaughter’s picture

This is an old patch, but just confirming that patch #5 works great.

John Franklin’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #5 is still a great patch. So is #9. One of them should be committed.

John Franklin’s picture

Issue summary: View changes

In the patch from #8, $view->exposed_input[$handler->options['expose']['identifier']] may be an array, not a value. The value will need to be flattened somehow to prevent check_plain() warnings.

neclimdul’s picture

Status: Reviewed & tested by the community » Closed (outdated)