Posted by mariay on December 31, 2008 at 12:48pm
I am using the 6.x-1.x-dev Zen Classic theme from 16 Dec. 2008. The text "in" followed by the taxonomy term appears under node titles. I would like to remove this or at least change the "in" to something understandable such as "Keyword: " or "In category: ". I tried identifying what to change with Firebug without success. Any help would be much appreciated!
Comments
In your theme's node.tpl.php
In your theme's node.tpl.php file, look for:
<?php if ($terms): ?><div class="terms terms-inline"><?php print t(' in ') . $terms; ?></div>
<?php endif; ?>
$terms are the terms, removing or changing t(' in '). will get rid of the "in". :-)
Linux Systems Administrator
Christchurch, New Zealand.
Implication of deleting
Thanks! I see now that it is easy to change the "in" before the terms to something else. However, could you tell me the implications of deleting the line all together? I wonder if then terms will not show up anywhere in the site. The only way I could remove the line from showing under the node title was by taking out all of lines 65 - 77 in the /sites/all/themes/zen/node.tpl.php file.
Also, as I am using the Zen Classic subtheme, it seems this adds more complexity in upgrading and I wonder if the instructions could be kept in the subtheme directory.
Thanks again.
Copy /sites/all/themes/zen/node.tpl.php to you theme then modify
Copy /sites/all/themes/zen/node.tpl.php to your subtheme then modify
You should not modify /sites/all/themes/zen/node.tpl.php directly
Good luck and happy new year
Profile/Concat Info: http://www.linkedin.com/in/nolimitsdude
Profile/Concat Info: http://www.linkedin.com/in/nolimitsdude
Tried that but it doesn't work
I tried copying
/sites/all/themes/zen/node.tpl.php
and pasting it into
/sites/all/themes/zen/zen_classic/node.tpl.php
then modifying
/sites/all/themes/zen/zen_classic/node.tpl.php
but it does not work. The changes are not recognized.
Thanks anyway.
You have to go to performance and clear cache to see changes
You have to go to performance and clear cache to see changes when you change tpl.php files.
Profile/Concat Info: http://www.linkedin.com/in/nolimitsdude
Profile/Concat Info: http://www.linkedin.com/in/nolimitsdude
It works now.
Thanks! It works now.
How to not show text is no terms?
Now that I can easily change the "in" text I have discovered that the text appears even if there are no taxonomy terms for the particular node. Can someone tell me how to show no text if there are no taxonomy terms?
Thanks!
if clause?
Did you leave in the surrounding PHP if clause? If you did, it shouldn't be printing the text if $terms is empty.
if clause not touched
All I did was change the " in " on line 74 to "Keyword(s): "
and thus the surrounding PHP if clause remains but the text "Keyword(s): " shows when there are no terms, though only for a module under development. The text is indeed not shown if there are no terms for other content types. Thanks!
testing
You should try adding in a var_dump($terms); to see what exactly PHP thinks is in $terms to print the label.
One other thought: Does the module provide its own node type? If so, do you have a separate node template file for it? And if so, how is it different?
How to stop the terms from showing?
I have content types that have taxonomy terms that I don't want to show under the node title, but can not figure out how to stop them from showing. What I mean is that I want to use terms when making nodes but have them show up at all under the node title. Better would be if I could control when they show and don't show. Any help would be much appreciated.
This might help...
I recently found this module, which looks like it might be just what the doctor ordered :)
http://drupal.org/project/taxonomy_hide - Hope that helps!
Web Development in Nottingham, UK by Kineta Systems / Follow me on Twitter! @NikLP
Web Development in Nottingham, UK by Kineta Systems / Follow me on Twitter! @NikLP