I am trying to output node fields in different theme regions, particularly a node reference field into my theme's right sidebar region. I have read this is possible with display suite and display suite extra modules, but I only see display suite regions (left, right...) and doesn't seem to be aware of my theme regions. How can I accomplish this?
3 Answers
Try the cck_blocks module. Once installed, you can enable field blocks per field via the field settings page.
Then in the display settings, hide the field in the default/full view and show it in the cck blocks view mode.
-
I already tried this solution and while it works it´s not exactly what I am looking for. What I want is to know how to use display suite to add fields to theme regions. According to drupal.org/node/1518286#comment-5854518 it should be possible in D7?– itsututaFeb 3, 2013 at 12:16
There's a few ways, but one reasonably simple way, still using theme regions, is with Views.
- Add a "Block" display to a View
- Add a "Contextual filter" for "Node ID"
- Set contextual filter "Default value" to "Content ID from URL".
- Add your entity reference fields etc.. to the View display and save.
- Set the block visibility on your node page.
The View will then pickup the node id and show the relevant fields from that node.
-
I had thought of that and got it working that way; I got it to work also with hook_page_alter, but still wanted this functionality to be done with display suite, only because I have read it is possible and would simplify the entire process?– itsututaFeb 3, 2013 at 12:09
Information on how to do this can be found in the Add fields to a block page of the Display Suite documentation