Hi I am trying to create a google readeresque interface for my users for reading RSS feeds from various journal publication sites. The problem with medical literature is that the terms are so obscure that autotagging doesnot work well and we have depend on manual tagging.
Using panels and your module I could implement the tagging feature very nicely for a single feed item display so that the community tag block comes up in a region on the right and the tagging works perfectly.
Now the issue I am facing is that I have created a view which displays the feed items in the full content view using display suite. The reason is to arrange the fields in the way I want to bring the rating widget on the right etc. However I cant display community tags in display suite using the inline display style. I am trying to see if I can integrate a block with it to overcome the problem but is it possible to integrate the inline display of community tags in display suite?
Comments
Comment #1
santam commentedI noticed this php code to use when displaying community tags in teaser from a post.
Is it possible to use this code in the display suite template files?
Comment #2
galundin commentedUPDATE: There is a better way to do this. See EDIT below.
Go to example.com/admin/structure/ds/fields
Add a code field
Give it a label and assign entity type 'node' (no other types supported)
Field Code:
(Text format: Display Suite code)
Brief explanation of this code:
You need the underscore prefix to get the rendered content, otherwise it would put it into the render array:
$node->content['community_tags']['#markup']You COULD display this in your theme, but then what's the point of using DS?
You also have to unset the boolean flag 'community_tags_form' to suppress hook_node_view, which would otherwise attach a duplicate JS var for each tag. I had to do lots of troubleshooting to figure that out...
Now the inline Community Tags widget will become available as a new DS field for all nodes. Awesome.
EDIT:
There is another (probably better) way to do this that doesn't require adding a code field. As mentioned above, community_tags_node_view is already being called and the content is added to the render array, so we just have to tell DS where to find it.
Go to example.com/admin/structure/ds/extras
On the "Extra fields" tab, check "Enable extra fields"
Add this line to the text box:
node|article|community_tags(Replace "article" with the desired node type.)
That would be the "correct" way to do it. But I'll leave the code field example because it would be useful if you need more control.