Hi @all,

I was just wondering if it is possible to define a display plugin that is only available if a specific base table or view type (e.g. the 'File' view type) is used.

I already searched the code base but did not find anything that "explains" this behavior.

I'd appreciate your help & thanx in advance

cheers

hctom

CommentFileSizeAuthor
#1 1062074-display-base.patch664 bytesdawehner

Comments

dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Active » Needs review
StatusFileSize
new664 bytes

Once you have applied this patch it works :)

Therefore specify 'base' => array('node') for example in your hook_views_plugins.

hctom’s picture

Category: support » feature

Hey thanx for the fast reply :)

That's a nice approach... hope this will make it into the official release... and so this is more a feature request than a support request :)

dawehner’s picture

As long someone reviews/tests the patch this will probably be in the official release.

In general this issues feels a bit, but just a tiny little bit, like a bug.

dawehner’s picture

Assigned: Unassigned » merlinofchaos

Assign to earl. Perhaps it was intended that displays aren't per base table.

merlinofchaos’s picture

Status: Needs review » Needs work

Displays do not have their own base tables because it makes field/filter/etc inheritance impossible, since fields for a different base table are going to be different.

That's actually the only reason; so all you really have to do is to make it so that if the display has a different base table than the default display, automatically set anything that relies on the base table to not be defaultable, it's probably okay.

That means we need a little more than this patch will allow.

merlinofchaos’s picture

Status: Needs work » Needs review

Oh wait, I misunderstood the purpose of this patch.

I guess having a display specific to one or more base tables is more reasonable.

hctom’s picture

@merlinofchaos:

Just to make things more clear: I'm building a module that allows views with a certain display plugin to be embedded on a page provided by the module. As the module only deals with files, it would be needless to allow the display on other views than those being a File view.

Cheers

TOM

dawehner’s picture

Status: Needs review » Fixed

Patch is already in 7.x-3.x, so committed only to 6.x-3.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.