フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Siju Thomas
how to show custom theme variables stored in the init_custom.vm in jsp
2013/01/16 2:58
答え

Siju Thomas

ランク: New Member

投稿: 4

参加年月日: 2011/07/27

最近の投稿

#set ($companyName = "shark")
#set ($companyUrl = "http://www.shark.com")
#set ($companyEmail = "info@shark.com")
this is my custom variables saved in init_custom.vm . How to show this vm variable values in my login.jsp in Hook.
I am using below code and its not working
Welcome to the <%=themeDisplay.companyName%>
Olaf Kock
RE: how to show custom theme variables stored in the init_custom.vm in jsp
2013/01/20 14:30
答え

Olaf Kock

LIFERAY STAFF

ランク: Liferay Legend

投稿: 1855

参加年月日: 2008/09/23

最近の投稿

You'll have to understand that init.vm (or init_custom.vm) just initializes what is available to velocity when interpreting the theme - it does not modify what is happening in the backend, e.g. it's not going back to what is available from the API (as is themeDisplay)

My advice would be to just set the companyName, URL and Mail through ControlPanel, Portal Section, "Portal Settings". In case you have definitive needs to customize them when your theme is active, you should go either through theme properties like this:
1<%=themeDisplay.getThemeSettings().getProperty("my-custom-information") %>
or alternatively use the API to change the globally available company data (in case you want that).

You can even make them configurable if you add them to your theme:

 1    <theme id="classic" name="Classic">
 2        <root-path>/html/themes/classic</root-path>
 3        <templates-path>${root-path}/templates</templates-path>
 4        <images-path>${root-path}/images</images-path>
 5        <template-extension>vm</template-extension>
 6        <settings>
 7            <setting configurable="true" key="my-custom-information" value="Whatever default you'd like" />
 8        </settings>
 9    </theme>
Siju Thomas
RE: how to show custom theme variables stored in the init_custom.vm in jsp
2013/01/21 1:24
答え

Siju Thomas

ランク: New Member

投稿: 4

参加年月日: 2011/07/27

最近の投稿

Thank you Olaf