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.
By adshill on
I'm pretty sure this is easy as I've done multi-lingual before and never had this problem, anyway... here goes :)
I've got a multi-lingual site in two languages with translations. At the bottom of every multi-lingual node I have a link to the translation of that page. For example, next to "Add a new comment" I have "Francais" that links to the French version of the page.
How can I get rid of these links? I have a language switcher block so there is really no need for them.
Thanks,
Adam
Comments
Still not there...
Ok so I managed to do it through CSS...
but this is far from ideal as it just leaves a big gap at the bottom of nodes where it would be.
Any help would be greatly appreciated!
Remove node links using phptemplate_preprocess_node()
I was able to remove these links using the
phptemplate_preprocess_node()
function. Here's the code to add to your theme's template.php file:There should probably be a better way to do this; it would be great to be able to configure this within the i18n module itself, but this technique works for now.
not working
Your preprocess function should work, i think but it ist on my site.
I changed the function name, what am i doing wrong?
i have version 6.9 of drupal
What did you rename the
What did you rename the function to? If you're using a phptemplate theme, try inserting the code exactly as I've provided it. If you already have the line
function phptemplate_preprocess_node(&$vars) {
in your template.php file, simply insert the following code on a new line following it:Once you've inserted the code, try clearing your cache so that Drupal finds the new function.
thx
the cache was the problem
/admin/settings/language/i18n
/admin/settings/language/i18n
I've got an option there called "Hide content translation links", which is what you want, isn't it?
I believe this is coming from i18n itself, althought I also have Language Icons and Consistent Language Interface. Both recommended.
Hide content translation links
Thank you frames, I have that option on my site as well. This means that I can remove the code that I had previously provided from the
phptemplate_preprocess_node()
function.Cool
Glad to hear I helped.
Entity translation
This is also the way to go when using entity translation (see comment of Bohus Ulrych).
Removing language link beneath content in Drupal 7
In Drupal 7 I removed it by unchecking/disabling the language in admin/config/regional/language.
Check 'hide content translation links'
In D7
/admin/config/regional/i18n/node
Hide content translation links
Hide the links to translations in content body and teasers. If you choose this option, switching language will only be available from the language switcher block.
Check this box and it will be removed... Easy, but hard to find :).
And how do I remove "language: English"?
Thanks for that advice. I would also like to remove the line, one above the link.
I could not find any settings for that, and I'm not sure who is writing that into my site...
English
Just one more thing...
You need to have the i18n module option "Multilingual content" enabled for this checkbox to appear.
Found it
wildseven, To remove
Language
English
Go to "Manage Display" tab of your content type, and make the language field display "hidden" :)
confusion
confusion all over :-/
/admin/config/regional/i18n/node is part of the i18n module. if you dont have that module installed, you dont have that checkbox. you may still have translated content (and links to it) from the translation module, for example.
i dont have the language appear as a a field, so i cant manage it from "Manage Display" tab of my content type. I assume language might be a field if I use the Entity module, but i dont.
the links i'm looking at are generated by translation_node_view(), defined in modules/translation/translation.module. Its not a theme hook or an alter hook, so i cant hook into it in my theme.
I can only hack that module (yuck) or disable the links with css (yuck twice .. especially since they dont have clear classnames).
If i could remove the links from any *_preprocess_* theme function, i would be very happy, but I cant find where ...
..*stumped*..
*-pike
*-pike
At "manage display" language filed pops back up to show
Tried that but it would pop back up into the display list, every time you came back to the "Manage Display" it will pop back up ...
this is seriously annoying ...
got it:
it needs to be set for all the languages at the same time so edit it at the site/nl/admin/structure/types/manage/webform/display settings and edit it at the site/en/admin/structure/types/manage/webform/display settings
Http://www.reloadmedia.com
There is it hidden in d7, thank you
There is it hidden in d7, thank you
Thank you so much. I was
Thank you so much. I was looking for a while. You save my life.
workaround for entity-translation
I installed entity-translation now (and NOT i18n). there is no checkbox to disable the language menu display. language is also not part of the fields of a content type.
Sofar I've only been able to hide them from a node page like this:
hm,
*-pike
*-pike
"Hide content translation links" on each content type
(Source)
maybe somebody still need help with this ...
I found this option here: admin/config/regional/i18n/node
Hide content translation links
This option is available, if
This option is available, if you enable Multilingual content module and Multilingual select.
Remove all links from node
This snippet in a custom module removes the language links from the node:
(Beware: it might be a bit too effective as it removes all links from the node)
Just do this
in file
node--NODENAME.tpl.php
For example
node--article.tpl.php
right before the line of
print render($content);
Add this
hide($content['language']); // this is the added line
print render($content);
This will hide whatever language wants to show in the node.
Nothing is impossible, the impossible just takes a little more time
After looking for many hours,
After looking for many hours, I finally found a way to remove the translation links (Drupal 7) on node elements by adding the following code in my page.tpl.php of my subtheme (just before the line
print render($page['content']);
):Hope it can save time to someone!
Entity Translation / Drupal 7
For Entity translation (entity_translation 7.x-1.0-beta3) there is settings for each Structure / Content type. Just edit your Content type, under the Publishing options you will find checkbox "Hide content translation links"
Just what I needed, as simple
Just what I needed, as simple and clear solution.
Thnks @Bohus
In Drupal7, please go to
In Drupal7, please go to admin/config/regional/i18n/node and select "Hide content translation links"
This is the best way.
This is the best way.
Bruno Mateus
/**
/**
* Override or insert variables into the node template.
*/
function theme_preprocess_node(&$variables) {
unset($variables['content']['links']['translation']);
}