Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Let me first take a moment to thank the creators and maintainers of this module. This is A-class material... Thank you guys for your diligence and art.
-----
My feature request is potentially a quick one. I need to mask the My Tags component. So basically I want "All Tags" and then the inline tag adder to work, without displaying the user's past tags for the node. In place of "My Tags" perhaps I could show simple instructions for adding tags below...
I think this is a matter of commenting out code in community_tags.pages.inc? Any advice is much appreciated.
Comments
Comment #1
chaps2 CreditAttribution: chaps2 commentedThis seems like an odd requirement to me and I'm intrigued as to why you want to do this?
The easiest way to do this is to use CSS to hide the My Tags list e.g. add this to your theme's CSS:
You may want to play around a bit with other CSS settings to get the right spacing etc.
Doing it this way, the user will not see their previous tags in the textfield.
The other approach would be to disable the Javascript that creates the My Tags list from the tags listed in the textfield. This way the user will see their previous tags in the textfield and the Add button operates more obviously as an Update button. Do you want AJAX update of user's tags?
Comment #2
andrew7 CreditAttribution: andrew7 commentedYou are right. This is a bit of a strange workaround for my end goal (below). Perhaps there's an easier way to accomplish the following:
I am trying to display of all the weighted community tags for the node, right under the node title.
The community tagging form is on a block to the side and it's functioning perfectly. On the main node content display area though I get a list of flat community tags though - not weighted ones.
I just need to show all the weighted community tags (of 2 vocabularies) on the main node display page.
Comment #3
chaps2 CreditAttribution: chaps2 commentedYou can do this with theming. Try putting the following in your theme's template.php file.
If you need to you can test the node type ($vars['type']) to only display the cloud on relevant pages.
Even better would be to add the rendered cloud to the $vars array:
And then edit your theme's node.tpl.php (or if your theme doesn't have one create one based on modules/node/node.tpl.php). It should be obvious what to do to display the cloud wherever you need it.
You say you want to display community tags from two vocabularies - have you got two tagging forms in the block - one for each vocabulary?
Comment #4
andrew7 CreditAttribution: andrew7 commentedBrilliant! This works beautifully, thank you.
Yes, I have 2 vocabularies... After adding your code, a mixed tagedelic list of both vocabularies shows up, which is exactly what I need.
1. Alternatively, if I were to add the rendered cloud to the $vars array, wouldn't that be a performance drain, given that only one content type on the site is using tags clouds? The way I've done it now is to add your function to template.php, and just check to make sure that the content type being displayed needs the tag cloud... Just for other readers' reference, this was done by changing line 7 from chaps2's code to the following:
... where 'person' is the content type of the node that needs the tag cloud.
2. Given that the tag cloud is displaying properly, can I remove the "All Tags" from the Community Tag block? And is it possible to tweak the "My Tags" label? Would this be done in community_tags.pages.inc?
Comment #5
chaps2 CreditAttribution: chaps2 commented1. No, it wouldn't be a performance drain. It's just a better way to do it and gives you much more theming flexibility. What I am suggesting is that the preprocess function looks like this:
And then add the following to node.tpl.php or a content type specific template of node-person.tpl.php wherever you need it:
2) The easiest way to tweak "My tags" is to use the string override feature in Drupal. To the bottom of your settings.php file add:
Alternatively you could implement a form alter hook which would give you a few more options...
But whatever you do, try to resist the temptation to tweak core and or contrib module files otherwise you'll end up wishing you hadn't!
Comment #6
chaps2 CreditAttribution: chaps2 commented