Problem/Motivation

Similar to how the Feed views display plugin allows those displays to be attached to other views, it would be nice for contrib (and potentially core) to be able to attach REST displays to other views displays. For example, attaching a CSV export to a page display in the Views Data Export module.

Proposed resolution

Remaining tasks

  • Feeds itself bundles the RSS icon as the attachment link. If this were a generic functionality in the REST Export display, there would need to be a discovery method for finding serializers that supported attachments perhaps?

User interface changes

API changes

Data model changes

Comments

jhedstrom created an issue. See original summary.

wim leers’s picture

Issue tags: +VDC

Interesting! :) Thanks for filing this!

dawehner’s picture

Yeah, that sounds like a super nice idea.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wim leers’s picture

Title: Consider implementing `attachTo` method in `RestExport` display plugin » REST views: Consider implementing `attachTo` method in `RestExport` display plugin
wim leers’s picture

Priority: Normal » Minor

Having a CSV/XLS/… icon is definitely a minor feature.

dawehner’s picture

These links are mostly used for downloading usecases, I assume. Yeah to be honest for those usecases you probably want to use views data export which actually will also implement batch support and what not. That module implements the attachTo method.

wim leers’s picture

dawehner’s picture

But nevertheless, we do have https://www.drupal.org/project/csv_serialization and https://www.drupal.org/project/xls_serialization, which would benefit from this.

Well, its right, but in reality you actually use views_data_export together with those modules, like for example you want to set the Content-Type header automatically, which is only done when you actually use \Symfony\Component\HttpFoundation\BinaryFileResponse for example.

wim leers’s picture

Aha!

So does that mean this is a "won't fix"?

dawehner’s picture

Given @jhedstrom is the other of those serialization modules there was most likely a good usecase.

jhedstrom’s picture

It's been a while, but IIRC, the use case was to allow those serializer modules to work only with core (eg, not to require views_data_export). The views_data_export module already provides the attachTo itself, but that could be removed if RestExport implemented that itself.

However, I'm not sure if that use case is valid enough to pursue this in core.

dawehner’s picture

However, I'm not sure if that use case is valid enough to pursue this in core.

Given it seems to be really a minor issue, I think we should close this issue. If someone has the need in the future, they could still provide a patch.

Personally the entire link that feature in views is weird ... this should be done with some footer text and be done with it :)

wim leers’s picture

Status: Active » Closed (works as designed)

Alright, thanks for giving that background information, @jhedstrom!