如何在我的 DokuWiki 标题上显示我的徽标?

发布于 2024-07-15 00:26:13 字数 185 浏览 4 评论 0原文

我有一个 DokuWiki,我想在页面顶部的标题栏上放置一个徽标? 我怎样才能做到这一点? 请注意,我指的不是浏览器顶部的标题栏,而是网站本身的标题栏。

我尝试插入 DokuWiki 语法:{{public:logo.jpg?100x100}},但这只是呈现为纯文本而不是图像。

可以在页面标题中放置图片吗?

I have a DokuWiki and I'd like to place a logo on the title bar at the top of the page? How can I do this? Note that I am not referring to the title bar at the top of the browser, but rather the title bar on the website itself.

I tried inserting the DokuWiki syntax: {{public:logo.jpg?100x100}}, but this simply rendered as plain text and not an image.

Is it possible to put an image in the page title?

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

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

发布评论

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

评论(4

随心而道 2024-07-22 00:26:13

简单:将您的徽标重命名为 logo.png 并将其放入 :wiki 命名空间中。 它会自动显示。

此解决方案适用于模板“dokuwiki”(dokuwiki 旧稳定版本上的默认模板“Adora Belle" 和当前的“Weatherwax"):

更深入:

我们可以查看tpl_header.php 文件,第 21 行和第 23 行:

    // get logo either out of the template images folder or data/media folder
...
    $logo = tpl_getMediaFile(array(':wiki:logo.png', 'images/logo.png'), false, $logoSize);

好的:tpl_getMediaFile() 将在名为 wiki 的媒体命名空间中查找文件 logo.png

因此,我转到 dokuwiki 文件管理器,并在 wiki 命名空间中上传我的 logo.png 文件。 我刷新页面并微笑。

dokuwiki 文件管理器的解决方案

希望有帮助

Easy: Rename your logo as logo.png and place it into :wiki namespace. It will show automatically.

This solution works on template "dokuwiki" (default one on dokuwiki old stable version "Adora Belle" and in current one "Weatherwax"):

Deeper:

We can look at the tpl_header.php file, lines 21&23:

    // get logo either out of the template images folder or data/media folder
...
    $logo = tpl_getMediaFile(array(':wiki:logo.png', 'images/logo.png'), false, $logoSize);

Ok: tpl_getMediaFile() will look for a file logo.png in the media namespace called wiki.

So I go to dokuwiki File Manager and I upload my logo.png file in the wiki namespace. I refresh the page and smile.

solution with dokuwiki File Manager

Hope That Helps

梦中楼上月下 2024-07-22 00:26:13

没有这方面的配置选项,恐怕你必须在 \dokuwiki-2009-02-14\lib\tpl\index.php 中破解它。

There's no config option for this, you'd have to hack it in \dokuwiki-2009-02-14\lib\tpl\index.php I'm afraid.

兮子 2024-07-22 00:26:13

(对于最新版本的 Dokuwiki)

您应该创建自己的模板,并执行您需要执行的任何操作。

它位于 lib/tpl/

只需复制带有您自己的名称的默认目录(稍后将在管理区域中提供),例如“company”,然后编辑:

  <div class="pagename">
    <img src="<?php echo DOKU_TPL; ?>images/logo.png" align="absmiddle"/>
    [[<?php tpl_link(wl($ID,'do=backlink'),tpl_pagetitle($ID,true),'title="'.$lang['btn_backlink'].'"')?>]]
  </div>

您可以根据需要构建 HTML...但是上面的示例工作得很好(图像位于 lib/tpl/company/images/ 中)

然后您可以通过更新配置来更改 Wiki 的模板:
管理员> 配置管理器>> 模板

(for latest versions of Dokuwiki)

You should create your own template, and do whatever hack you need to do.

It is located in lib/tpl/

Just copy the default directory with your own name (this will be available in the admin area later), something like "company", and edit:

  <div class="pagename">
    <img src="<?php echo DOKU_TPL; ?>images/logo.png" align="absmiddle"/>
    [[<?php tpl_link(wl($ID,'do=backlink'),tpl_pagetitle($ID,true),'title="'.$lang['btn_backlink'].'"')?>]]
  </div>

You can build the HTML as you like... but the example above works just fine (the image is located in the lib/tpl/company/images/)

You can then change the template of your Wiki by updating the configuration at:
Admin > configuration manager > template

滥情空心 2024-07-22 00:26:13

在现代版本的 DokuWiki 中,您不必创建自己的模板。 只需将名为 logo.png 的文件上传到 wikiDokuWiki Media Manager 中的根命名空间即可。

这是获取徽标的模板代码行:
https://github.com/splitbrain/dokuwiki /blob/master/lib/tpl/dokuwiki/tpl_header.php#L23

您可以看出它首先检查 wiki 命名空间中的 logo.png :wiki:logo.pnglogo.png 在根命名空间中与 :logo.png 一起使用。

如果两者都没有找到,则会使用 images/logo.png,这是默认徽标。

In modern versions of DokuWiki you don't have to make your own template. Simply upload a file called logo.png to the wiki or root namespace in the DokuWiki Media Manager.

This is the line of template code that gets the logo:
https://github.com/splitbrain/dokuwiki/blob/master/lib/tpl/dokuwiki/tpl_header.php#L23

You can tell that it is first checking logo.png in the wiki namespace with :wiki:logo.png and then logo.png in the root namespace with :logo.png.

If it doesn't find either, it falls back on images/logo.png, which is the default logo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文