I am searching for a solution to display contextual links instead of tabs for a node (like View and Edit tab). While it would be easy to just hide the tabs in CSS, so it's not a problem, I can't find out how to display contextual links for the node.
I installed ccl but it works only for nodes contained in blocks or in views and not for regular nodes accessible by standard url mysite.com/node/5, which have tabs displayed. I configured in ccl "Link type: Node" and "Show link for: All nodes" but it doesn't display contextual links for regular nodes.
This is checked for theme Seven.
Comments
Comment #1
bkoether commentedHi raincloud,
The short answer to your question is "no". CCL is build on top of the core contextual links module and you will only be able to add your own links in places where the core module is providing contextual links.
But I like the idea that you have and will revisit it after I finished the tasks that are on the current roadmap. This could be a very nice feature.
Comment #2
rvolkHi raincloud,
i had the same problem and spend some time with searching for a nice and clean solution for my current project. I guess there will be other people with similar requests, so i share my solution here.
Problem:
Solution:
Sources:
YOURTHEME/template.php
YOURTHEME/templates/node.tpl.php
Your have to replace "YOURTHEME" with your theme name.
The $tabs in page.tpl.php should be hidden in hook_preprocess_page() or your template configuration. (e.g. as option in Omega Template).
Kind regards,
rvolk
Comment #3
bkoether commentedThanks rvolk for sharing your solution.
I decided not to implement a solution for this particular request at this time. CCL is a support module for the core functionality of contextual links and the idea was just to add links where the widget shows up regardless. So I will mark this as works as designed.
raincloud, I hope the above shown solution can help you with your current project.
Comment #4
tevans commentedNice recipe. Just wanted to say it works perfectly in case anyone else comes across this thread looking for a similar solution. Thanks rvolk!
Comment #5
krash commentedThanks rvolk!
Comment #6
itaine commentedThank you rvolk for the solution!
I'm getting the following bark after clearing the theme registry:
Notice: Undefined index: path in YOURTHEME_menu_contextual_links_alter()
the issue appears to be with this part of the code:
Anyone else experienced this?
NB: It works a treat without it :-D, I don't notice any lost in functionality without it. Which raises the question what is it doing?
Comment #7
Chipie commentedThank you for this great solution.
Is this a different approach to this one:
http://drupal.org/sandbox/onkeltem/1730244
Comment #8
brightboldAwesome thanks. The solution in #2 works for me, and I did not have the problem mentioned in #6.