Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be desirable to fire the publish/unpublish request over AJAX instead of requiring a page reload. I have attached a patch that allows the administrator to set the views links to do this and will fall back to the normal tokenized request if the user doesn't have JavaScript enabled.
Comment | File | Size | Author |
---|---|---|---|
publishcontent.patch | 6.1 KB | elliotttf | |
Comments
Comment #1
AaronBaumanThis sounds like a great feature and well-aligned with the primary focus of this module.
As soon as we get a review or two, I will get this into dev.
Thanks for the patch.
Comment #2
jacobroufa CreditAttribution: jacobroufa commentedThis seems to work as intended! The patch didn't though, so I had to add everything manually.
Comment #3
AaronBaumanJust tested myself, and came up with a couple issues:
Again -- simple solution -- do an ajax reload on the entire view result.
Comment #4
patcon CreditAttribution: patcon commentedPerhaps efforts could be merged with these modules:
http://drupal.org/project/views_flag_refresh
http://drupal.org/project/ajax_views_refresh
I've only personally used View flag refresh, but it essentially does what you're looking for, albeit for flag AJAX links :)
Comment #5
patcon CreditAttribution: patcon commentedReposting from other queues:
This concerns several modules which seem to be seeking similar functionality, so I'm posting an issue in each. Feel free to choose a canonical thread if there's interest is working together :)
http://drupal.org/project/views_flag_refresh
http://drupal.org/node/1083574
http://drupal.org/project/ajax_views_refresh
http://drupal.org/node/1083570
http://drupal.org/project/publishcontent
http://drupal.org/node/936090
Comment #6
patcon CreditAttribution: patcon commentedOh hey, and in the meantime, if you just want a AJAX publish/unpublish functionality for the view only, then you can set a flag that essentially acts as a publish/unpublish flag, and use views_flag_refresh to "X" items out of a view (assuming you have a filter set so that only publish-flagged items are shown :)
UPDATE: Also, didn't realize this before, but it seems Flag has Rules integration, so it seems you could create a pseudo-publish flag, and have rules publish and unpublish a node depending on how the flag is set. I'll have to true it out!
Comment #8
kirkcaraway CreditAttribution: kirkcaraway commentedI started working on this method listed in this thread, and then stumbled across Fasttoggle, which does the same thing: http://drupal.org/project/fasttoggle
Very easy, very quick to set up, but limited compared to Publish Content. It just does the node links via ajax, that's it.
Comment #9
Simon Georges CreditAttribution: Simon Georges commentedAll feature requests should go to current branch, as the 6.x-1.x version is not maintained any more.
Comment #10
jas1988 CreditAttribution: jas1988 as a volunteer commentedAny updates on issue ! Have someone managed to make it work like this.