掲示板

Theme setting checkbox doesn't work

11年前 に Rujuan Xing によって更新されました。

Theme setting checkbox doesn't work

New Member 投稿: 11 参加年月日: 12/10/05 最新の投稿
in my liferay-look-and-feel.xml, I add settings like this:
<?xml version="1.0"?>
<!DOCTYPE look-and-feel PUBLIC
"-//Liferay//DTD Look and Feel 6.1.0//EN"
"http://www.liferay.com/dtd/liferay-look-and-feel_6_1_0.dtd">
<look-and-feel>
<compatibility>
<version>6.1.0+</version>
</compatibility>
<theme id="Sample" name="Sample">
<settings>
<setting configurable="true" key="show-breadcrumb" type="checkbox" value="false" />
</settings>
...

Whatever I check the checkbox or not, it just show me the value of "false", it doesn't show "true" when I check the checkbox. I don't know the reason, could someone give me a solution?

Thank you very much in advance!
thumbnail
11年前 に Gaurav Jain によって更新されました。

RE: Theme setting checkbox doesn't work

Regular Member 投稿: 145 参加年月日: 11/01/31 最新の投稿
How you are getting the value of this setting?

However you can use fllowing in your theme velocity:
$theme_display.getThemeSetting('setting-key)
11年前 に Aarti Dholiya によって更新されました。

RE: Theme setting checkbox doesn't work

New Member 投稿: 22 参加年月日: 12/02/08 最新の投稿
It is working for me.

Use below code in your portal_normal.vm file.

#set ($show_breadcrumb = $theme_display.getThemeSetting('show-breadcrumb'))
#if ($show_breadcrumb == 'true')
<nav class="site-breadcrumbs" id="breadcrumbs">
<h1>
<span>#language("breadcrumbs")</span>
</h1>
#breadcrumbs()
</nav>
#end

Refere : http://www.liferay.com/web/raymond.auge/blog/-/blogs/theme-settings-and-new-advanced-controls