A text area handler that shows links to create nodes of the type in the filter.

Picture is easier!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Patch.

Note: #697208: handler validation only gets given default display means that validation can fail -- hence the current check in render().

Also also see #697182: textarea handlers shouldn't need to be defined in hook_views_data, whose fix will have implications for code here.

joachim’s picture

Status: Active » Needs review
FileSize
3.75 KB

Updated with fixes from comments in IRC.

dawehner’s picture

I would like to have a option to select node types.

joachim’s picture

todo: function label() can be dropped and inherited.

@dereine: I would say all the types need to be enabled by default in the option for that, so you get all the types from the filter with a minimum of UI steps.

dawehner’s picture

ok, but
1) we can't be sure, that we have a type filter
2) we cannot be sure, thats the key is "type". I think we have to iterate through all filters and check table and field of the table of the filter.

joachim’s picture

> 1) we can't be sure, that we have a type filter

Without one this handler doesn't make sense does it? If you want *all* types, just chuck in a block with the create content menu!

> 2)

So is the key in that array aliased?

merlinofchaos’s picture

Status: Needs review » Needs work

Rather than checking for an existing filter, why don't we just select the type from the list of types in the options? I realize it's mildly more annoying, but having to introspect the view is difficult. Also, I can see where relationships could make this tricky. Let's say you've got a node view with a noderef relationship to a node type (let's say artist -> album) and you want to add an album to the artist...but the album is part of the related node. That's pretty ooky.

joachim’s picture

*steps over the spam*

We could check for the filter, and if we don't find it, fall back to a list of types in the options. Best of both worlds :)

This is postponed anyway until text area handlers get turned back to plugins IIRC.

dawehner’s picture

As far as i understand it, you would need quite a lot of rewrite to be able to create multiple instances of a plugin.

Dagmar only developed a method to create instances for the same kind of plugin in different "areas".

And hey jochachim, you needed to have multiple instances, so live with handlers :)

joachim’s picture

Sorry; it's been a while since I looked at all this...

But I seem to remember on IRC we talked about this: #697182: textarea handlers shouldn't need to be defined in hook_views_data so at least some architectural changes are needed; developing text area doodads should probably wait until we get the API figured out.

esmerel’s picture

Status: Needs work » Postponed

I'm sending this off to postponed land until the other issues get taken care of.

merlinofchaos’s picture

Category: feature » task
Status: Postponed » Active

Moving to active task. Would be good to get this one working.

MustangGB’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)