I guess typical use case is different than mine - but seemed obvious to me that i could just have the form to edit my fields (thinks thats how this was in D5 or maybe it was 4).

i have no need for adding things so would be really cool if this could be disabled.. but maybe i just missed the setting??

easy enough to patch i guess or even just css to hide them

Comments

benjah’s picture

See this comment. Worked for me.
http://drupal.org/node/477268#comment-1659816

benjah’s picture

Incidentally, I needed something different in my case.
I needed to only show the add form if the max number of child nodes had not yet been created.

I did this by hacking editview/includes/editview_plugin_style_node_add.inc.
I set the max number of nodes using 'items_per_page'. I check that against the number of returned results.
If it is equal or greater, I do not display the new node form.

Hope it helps someone. Kind of a hack so I don't recommend this as a patch.

Index: modules/editview/includes/editview_plugin_style_node_add.inc
===================================================================
--- modules/editview/includes/editview_plugin_style_node_add.inc (revision 24)
+++ modules/editview/includes/editview_plugin_style_node_add.inc (working copy)
@@ -108,7 +108,18 @@
array_unshift($this->view->result, $node);
}
else {
- array_push($this->view->result, $node);
+ $result = $this->view->args;
+ $pager = $this->view->pager;
+ if ($result[0] == 0) {
+ $result_count = 0;
+ } else {
+ $result_count = count(explode(",", $result[0]));
+ }
+ $add_limit = $pager['items_per_page'];
+ if ($result_count < $add_limit) {
+ array_push($this->view->result, $node);
+ }
}
}
return parent::render();

liquidcms’s picture

perfect.. thanks.

_paul_meta’s picture

+1 for this - it makes sense to have this as an option when setting up the editview - as to whether to include the add node interface or not.

thanks :)

liquidcms’s picture

sorry, not sure my post was clear, it was the post listed in http://drupal.org/node/635910#comment-2307610 that worked for me.

Anonymous’s picture

Status: Active » Closed (duplicate)

As benjah said, #477268: Add new node as Option (disabled) describes the solution for this.
Marking as a duplicate of that issue.