Hi,

I've set-up a nodequeue displayed as a view in a block.
Is there a way to have a link to "admin/structure/nodequeue/my-id" in the block contextual links?

Thanks

Laurent

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

subscribing (and +1-ing)

Steven.Pescador’s picture

Subscribing

azinck’s picture

I've just contributed an initial version of Nodequeue Extras that does this. Give it a try and let me know about any issues you find.

amateescu’s picture

Great! But I'm wondering why didn't you contribute it as a patch instead, seems like a tiny piece of code that could be added to the main codebase :)

azinck’s picture

amateescu: That's a good point. The other item in Nodequeue Extras (the new relationship handler) does its work in a fairly non-traditional way by using a placeholder argument that is leveraged to pipe criteria into the join, rather than the where clause), so I felt that one needed to be in its own module rather than sticking that hack-ish code into Nodequeue itself. I happened to already have the contextual link functionality already written up in the module, too, so decided to just run with publishing them together. It may have been a bad call. I'm happy to have any of the Nodequeue Extras functionality integrated into Nodequeue as you see fit, and would be happy to help roll patches to that end.

DamienMcKenna’s picture

+1 for rolling it as a patch, but either way thanks to azinck for writing the functionality.

corbacho’s picture

Patch against the current stable version (7.x-2.0-beta1)

Steps I did to create the patch:
1. git clone https://drupal.org/project/nodequeue_extras and checkout 7.x-1.x
2. Patch https://drupal.org/node/1619400 (patch # 2)
curl https://drupal.org/files/nodequeue_extras-n1619400-2.patch | git apply -
3. Patch https://drupal.org/node/1920700 Patch # 1
curl https://drupal.org/files/nodequeue_extras-refactor_nesting-1920700.patch | git apply -
4. I copied the hook alter to a suitable place in nodequeue module. I didn't copy those extra special relationships files and I removed 2 lines of code.
Maybe you might need them for special case about subqueues.
5. Added an extra checkbox to nodequeue admin settings form. (The variable with the same name was already being used in nodequeue_extras module):
[x] Show contextual links.

corbacho’s picture

#7 Oops!, The attached patch has strange characters because of coloured diff settings.
This is a well-formed patch:

ParisLiakos’s picture

Version: 7.x-2.0-alpha2 » 7.x-2.x-dev
Category: support » feature
Status: Active » Needs review
ParisLiakos’s picture

Status: Needs review » Needs work

Patch looks good but one thing

+++ b/includes/views/nodequeue.views.inc
@@ -269,3 +269,85 @@ function nodequeue_views_data_alter(&$data) {
+        'title' => t('Edit queue: !queue_name', array('!queue_name' => $queue->title)),
...
+            'title' => t('Edit subqueue: !queue_name > !subqueue_title', array('!queue_name' => $queue->title, '!subqueue_title' => $subqueue->title)),

those names are pretty big for contextual links. i would remove the name and just leave edit queue/subqueue.
its the same behavior with block or views. it does not display the view name or block name.

besides that its ready to go imo

elvis2’s picture

Thanks for the patch. I agree with #10.

elvis2’s picture

I rerolled #8 with suggested changes from #10. I also added a permission check to make sure the user has access to edit queues.

elvis2’s picture

elvis2’s picture

Status: Needs work » Needs review
ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

thanks, works nicely for me

kepford’s picture

Looks @elvis2. Tested and it works as expected.

awolfey’s picture

Works well.

  • fizk committed 360568f on 7.x-2.x authored by elvis2
    Issue #1177464 by corbacho, elvis2: Contextual links for nodequeue
    
fizk’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks!

FYI: I had to clear the cache to see the new contextual link.

DamienMcKenna’s picture

FYI if you add an update script with this code it'll trigger the menus to rebuild:

function nodequeue_update_7200() {
  variable_set('menu_rebuild_needed', TRUE);
  drupal_set_message(t('The menus will now be rebuild.'));
}

  • fizk committed d549ef1 on 7.x-2.x
    Issue #1177464 by DamienMcKenna: Add an update script to trigger a menu...
fizk’s picture

@DamienMcKenna Thanks, I've committed this update script.

Status: Fixed » Closed (fixed)

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

rooby’s picture

rooby’s picture

For anyone else having issues with this there is now a follow up patch in #2468705: Contextual link to edit queue disappears.