Is there an existing sub-module or someplace i'm not looking for Display Suite to allow me to arbitrarily place the View, Edit, Revisions, Manage Display, Devel
tabs that appear when viewing a Node... say I want to move them to a different place in any DS template like Right or Left.
-
Tabs are rendered in page.tpl.php, and ds operates on the entity rendering level. So if it can be done it would be interesting to see how.– J. ReynoldsCommented Feb 9, 2015 at 4:53
1 Answer
After some looking around, I've found the following two approaches:
- Use DS's 'dynamic field'
- Use DS's 'preprocessor field'
Dynamic Field
- Create a Dynamic Field (in /admin/structure/ds/fields) for Node entities.
- Go to the 'manage display' of your content type and place the dynamic field somewhere.
- Click 'Select Content' on the field settings (through manage display)
- Select 'Page Elements'
- Select Tabs, and save
Preprocessor Field
Not 100% working for me right now, however just to give the basic idea:
- Create a preprocessor field in DS and add the field to your content type.
In your template.php file, instantiate the field:
function YOURTHEME_preprocess_node(&$vars) { $vars['nameoffield'] = print render(menu_local_tabs()); }
I'm currently getting some errors with the preproccessor approach, however the dynamic field approach is working fine.