如何在 Drupal 中设置语言翻译链接的主题?

发布于 2024-08-21 23:15:06 字数 134 浏览 13 评论 0原文

在我的 Drupal 6 安装中,使用标准内容翻译模块,在内容下方添加指向节点翻译版本的链接。

如何将这些链接输出到主题中的其他位置?

更准确地说,我想在右侧工具栏中输出链接(如果有的话)。

谢谢,埃吉尔。

In my Drupal 6 installation, using the standard Content Translation module, links to translated versions of a node is added below the content.

How do I output those links another place in my theme?

To be more precise, I would like to output the links (if there are any) in my right toolbar.

Thanks, Egil.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萌能量女王 2024-08-28 23:15:06

在大多数主题中,这些链接在 page.tpl.php 中被称为 $links,因此您只需将 $links 移动到右侧边栏,而不是它们现在在 page.tpl.php 中的位置。

然而,这还有一个额外的陷阱,即同时移动所有其他链接(例如“添加新评论”、“阅读更多”等),因此要解决这个问题,您必须在 template.php 中做一些时髦的事情(特别是 THEMENAME_preprocess_page() )基本上从 $links 中删除翻译链接并将它们作为单独的对象输出(类似于 $translationlinks),然后将其放在您想要的位置。

In most themes, those links are just called $links in your page.tpl.php, so you can just move $links to your right sidebar instead of where they are now in your page.tpl.php.

However, that has the added pitfall of also moving all other links with them (such as "add new comment", "read more", etc.), so to fix that you'll have to do some funky stuff in template.php (THEMENAME_preprocess_page() specifically) that basically removes the translation links from $links and outputs them as a separate object (something like $translationlinks), then put THAT where you want it.

黑色毁心梦 2024-08-28 23:15:06

使用 php 过滤器创建块:


$node = menu_get_object();
if ($node->links) {
  print theme('links', $node->links);
}

create block with php filter:


$node = menu_get_object();
if ($node->links) {
  print theme('links', $node->links);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文