【问题标题】:how to customize template in liferay theme如何在 liferay 主题中自定义模板
【发布时间】:2014-05-15 15:56:55
【问题描述】:

我正在为我自己的门户定制我的 liferay 主题,我将 portal_normal.ftl 从经典主题复制到 _diffs/templates,我看到了这段代码:

<a class="${logo_css_class}" href="${site_default_url}" title="<@liferay.language key="go-to" /> ${site_name}">
    <img alt="${logo_description}" height="${site_logo_height}" src="${site_logo}" width="${site_logo_width}" />
</a>

我想把${site_logo}的src改成/images/blahblah.png这样的直接url,但是不行,怎么改这个img标签里的图片呢?

Liferay 在哪里定义 ${site_logo}

提前致谢。

【问题讨论】:

    标签: java html liferay freemarker portal


    【解决方案1】:

    您可以在文件“init.ftl”中找到 ${site_logo}。该文件位于: liferay-portal-src-6.2.0-ce-ga1\portal-web\docroot\html\themes_unstyled\templates\init.ftl

    要更改 src,请在 init_custom.ftl 中包含 #set ($company_logo_src = "$images_folder/yourlogo.png")。然后在你的 portal_normal 标签 img put src="$company_logo_src"

    $images_folder 将从文件夹图像(您的主题)中获取徽标。这个变量存在于 init.ftl 中并且有这个值 $theme_display.getPathThemeImages()

    【讨论】:

    • “${logo_css_class}”和“${site_default_url}”怎么样?我是否以与定义 $company_logo_src 相同的方式定义它?你能给我任何教程来帮助我定义这些变量吗?
    • 所有这些都在 init.ftl 中。如果你想覆盖,最好在你的 init_custom 中。本页可以帮助您:liferay.com/es/community/wiki/-/wiki/Main/…
    猜你喜欢
    • 1970-01-01
    • 2020-05-30
    • 1970-01-01
    • 2021-10-29
    • 1970-01-01
    • 1970-01-01
    • 2016-08-22
    • 1970-01-01
    • 2017-11-21
    相关资源
    最近更新 更多