Hello Drupal Support,
Thanks for the cool code and community.
Summary: I am looking for help with creating an "Edit and Save" action in Drupal 6.
Details: I am creating viewfields (http://drupal.org/project/viewfield) and adding them to my nodes, but in order for the view to show up on a node I need to click "edit" then click "save" ON EACH NODE (there are hundreds of nodes). The closest thing I have found as a solution is ViewsBulkOperations ("VBO" http://drupal.org/project/views_bulk_operations). VBO will run actions on whatever nodes you choose and an included action is "save", but that does not seem to work. The default, "save" action does not seem to, if you will, click edit first. Hence, I am looking for an "Edit and Save" action.
Any suggestions are appreciated. I do not know how to code, but can probably figure it out if it is only messing with a few lines.
On Sat, Jan 17, 2009 at 2:13 PM, John Thomas drupal.org-2008@jt-socal.com wrote:
Summary: I am looking for help with creating an "Edit and Save" action in Drupal 6.
I think what you need might be provided by http://drupal.org/project/retease
You don't really need to "edit/save" you really need to run the node through the input filter again. Which is what retease does (I'm pretty sure...I've never used it).
Regards, Greg
Greg Knaddison wrote:
Summary: I am looking for help with creating an "Edit and Save" action in Drupal 6.
I think what you need might be provided by http://drupal.org/project/retease
Short Answer: Nope Details: Hey, thank you for the effort and quick response. I appreciate your thoughts. I did try this and reteased all my nodes. This process, however, did not add the new field. Thanks again.
You don't really need to "edit/save" you really need to run the node through the input filter again. Which is what retease does (I'm pretty sure...I've never used it).
I am certainly open to alternate solutions. I might post a ticket on Retease to see if they any suggestions if nobody here can solve this.
Regards, Greg
Greg, thanks again!
Quoting John Thomas drupal.org-2008@jt-socal.com:
Any suggestions are appreciated. I do not know how to code, but can probably figure it out if it is only messing with a few lines.
I would probably create an external script to do the job. Select node nids of the node_type you want from the DB and do a node_load [1] then a node_save [2]. For an example of how to bootstrap Drupal from an external script look at top of cron.php.
[1] http://api.drupal.org/api/function/node_load [2] http://api.drupal.org/api/function/node_save
-- Earnie http://r-feed.com Make a Drupal difference and review core patches.
Earnie Boyd wrote:
Any suggestions are appreciated. I do not know how to code, but can probably figure it out if it is only messing with a few lines.
I would probably create an external script to do the job. Select node nids of the node_type you want from the DB and do a node_load [1] then a node_save [2]. For an example of how to bootstrap Drupal from an external script look at top of cron.php.
Earnie,
Thank you for the lead. I will likely try to figure this out and post it in a forum or two that I think could use it, here too.
Given I am not a coder, this will be some effort for me. May I dig a bit more out of that brain of yours?
Are you sure an "action" is not the way to go? Is there a node_load action? This would allow me to use view_bulk_operations and my, comfortable for me, gui. There seems to be a node_save action. Do you think it might be easier for me to look at that node_save action and modify that script to include a node_load. Or, am I being ridiculous and you already gave me the good answer?
Depending on what you are doing with the viewfield, you may be better served with the View Attach module. You can check it out here:
http://drupal.org/project/views_attach
The place where this would be most useful, is when you are using a viewfield to attach a view that is the same for every node of a certain type. This is very common in image galleries for instance, where you may want to reference all nodes that have a node reference to the current node. This allows you to setup the view, and attach it to all nodes of a specific type.
-Mike
On Jan 17, 2009, at 1:13 PM, John Thomas wrote:
Hello Drupal Support,
Thanks for the cool code and community.
Summary: I am looking for help with creating an "Edit and Save" action in Drupal 6.
Details: I am creating viewfields (http://drupal.org/project/viewfield ) and adding them to my nodes, but in order for the view to show up on a node I need to click "edit" then click "save" ON EACH NODE (there are hundreds of nodes). The closest thing I have found as a solution is ViewsBulkOperations ("VBO" http://drupal.org/project/views_bulk_operations). VBO will run actions on whatever nodes you choose and an included action is "save", but that does not seem to work. The default, "save" action does not seem to, if you will, click edit first. Hence, I am looking for an "Edit and Save" action.
Any suggestions are appreciated. I do not know how to code, but can probably figure it out if it is only messing with a few lines.
-- Sincerely, John Thomas -- [ Drupal support list | http://lists.drupal.org/ ]
__________________ Michael Prasuhn mike@mikeyp.net http://mikeyp.net
Michael Prasuhn wrote:
Depending on what you are doing with the viewfield, you may be better served with the View Attach module. You can check it out here:
http://drupal.org/project/views_attach
The place where this would be most useful, is when you are using a viewfield to attach a view that is the same for every node of a certain type. This is very common in image galleries for instance, where you may want to reference all nodes that have a node reference to the current node. This allows you to setup the view, and attach it to all nodes of a specific type.
Mike,
That sounds like a great solution (i.e. eliminate the need to edit and save). Do you know if I can attach multiple views_attach fields to a node?
On Monday 19 January 2009 8:10:33 pm John Thomas wrote:
Michael Prasuhn wrote:
Depending on what you are doing with the viewfield, you may be better served with the View Attach module. You can check it out here:
http://drupal.org/project/views_attach
The place where this would be most useful, is when you are using a viewfield to attach a view that is the same for every node of a certain type. This is very common in image galleries for instance, where you may want to reference all nodes that have a node reference to the current node. This allows you to setup the view, and attach it to all nodes of a specific type.
Mike,
That sounds like a great solution (i.e. eliminate the need to edit and save). Do you know if I can attach multiple views_attach fields to a node?
Yes you can. Views_attach creates a new display type for Views (along with Block, Page, etc.) that attaches itself to nodes of a given type that you specify. You can also use an argument that takes a nid from the URL (either nid or a nodereference) to make the view contextual to the node it's on, which is where the fun stuff happens. You can then order where that view will appear using the CCK Manage fields page. It works for users, too.
At least that's the intent. the drag and drop ordering is a little broken at the moment. :-) I plan to release a stable version as soon as I figure out why it's broken and how to fix it. Hopefully later this week.
Larry Garfield wrote:
That sounds like a great solution (i.e. eliminate the need to edit and save). Do you know if I can attach multiple views_attach fields to a node?
Yes you can. Views_attach creates a new display type for Views (along with Block, Page, etc.) that attaches itself to nodes of a given type that you specify. You can also use an argument that takes a nid from the URL (either nid or a nodereference) to make the view contextual to the node it's on, which is where the fun stuff happens. You can then order where that view will appear using the CCK Manage fields page. It works for users, too.
At least that's the intent. the drag and drop ordering is a little broken at the moment. :-) I plan to release a stable version as soon as I figure out why it's broken and how to fix it. Hopefully later this week.
Wow! Very slick and more flexible because now, I will not have to edit and save every node every time I decide to add, er, ah, attach another view.
On Jan 19, 2009, at 6:21 PM, Larry Garfield wrote:
Yes you can. Views_attach creates a new display type for Views (along with Block, Page, etc.) that attaches itself to nodes of a given type that you specify. You can also use an argument that takes a nid from the URL (either nid or a nodereference) to make the view contextual to the node it's on, which is where the fun stuff happens. You can then order where that view will appear using the CCK Manage fields page. It works for users, too.
Okay, I thought I had this figured out, but upon further testing, I don't see how to specify the argument. I have defaults and a 'Node Content' display on my view, so I have no path to put %1 into, to tell it where to pull the argument from. I thought maybe there would be an option under the Display settings, to use the node ID as an argument, (similar to panels integration where you can choose the source of arguments) but I don't see anything like that.
So I can't figure out how to pass the node ID to view without it being a page with an argument in the path for the page display.
-Mike
__________________ Michael Prasuhn mike@mikeyp.net http://mikeyp.net
On Monday 19 January 2009 9:17:07 pm Michael Prasuhn wrote:
On Jan 19, 2009, at 6:21 PM, Larry Garfield wrote:
Yes you can. Views_attach creates a new display type for Views (along with Block, Page, etc.) that attaches itself to nodes of a given type that you specify. You can also use an argument that takes a nid from the URL (either nid or a nodereference) to make the view contextual to the node it's on, which is where the fun stuff happens. You can then order where that view will appear using the CCK Manage fields page. It works for users, too.
Okay, I thought I had this figured out, but upon further testing, I don't see how to specify the argument. I have defaults and a 'Node Content' display on my view, so I have no path to put %1 into, to tell it where to pull the argument from. I thought maybe there would be an option under the Display settings, to use the node ID as an argument, (similar to panels integration where you can choose the source of arguments) but I don't see anything like that.
So I can't figure out how to pass the node ID to view without it being a page with an argument in the path for the page display.
-Mike
Arguments work on any display, not just pages. There's just no obvious way to get content to the argument without using the path. However, arguments can also have default values.
So setup a node content display, add an argument of "node id", and give it a default value of "get nid from URL" (or whatever it's called). Now the view will always get an argument of the node id of the node it's attached to. Poof. :-)