<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How to pass data from Hook to theme's portlet_normal.vm file</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114187674" />
  <subtitle>How to pass data from Hook to theme's portlet_normal.vm file</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114187674</id>
  <updated>2026-04-05T11:48:40Z</updated>
  <dc:date>2026-04-05T11:48:40Z</dc:date>
  <entry>
    <title>RE: How to pass data from Hook to theme's portlet_normal.vm file</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114193314" />
    <author>
      <name>William Gosse</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114193314</id>
    <updated>2019-07-03T13:22:22Z</updated>
    <published>2019-07-03T13:22:22Z</published>
    <summary type="html">What part of the template are you trying to access your variable in? Is the header, footer, navigation, content area? I&amp;#39;m not sure how much the header and footer can be changed after the portal_normal.vm loaded. Are trying to display this variable. You may try moving your variable to the portlet vm which should gets loaded into the content area of the portal_normal.vm when you make a page change.  It&amp;#39;s been a while since I&amp;#39;ve used 6.2 or velocity templates. With  version 7 the default template engine is now freemarker.</summary>
    <dc:creator>William Gosse</dc:creator>
    <dc:date>2019-07-03T13:22:22Z</dc:date>
  </entry>
  <entry>
    <title>How to pass data from Hook to theme's portlet_normal.vm file</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114187673" />
    <author>
      <name>Saurabh Khandelwal</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114187673</id>
    <updated>2019-07-03T09:54:36Z</updated>
    <published>2019-07-03T09:54:36Z</published>
    <summary type="html">I&amp;#39;m working with Liferay 6.2I want to send some value from Blog portlet(ie. form jsp page) to  my custom theme (ie. my-theme\docroot\_diffs\templates\portal_normal.vm)&lt;br /&gt;I have tried below code:  &lt;br /&gt;1) Using Custom Velocity Variable&lt;br /&gt;i. In File  view_entry.jspString Somevalue=&amp;#34;Hello World&amp;#34;;&lt;br /&gt;Map&amp;lt; String, Object &amp;gt; vmVariables = (Map&amp;lt; String, Object &amp;gt; ) request.getAttribute(WebKeys.VM_VARIABLES);if ( vmVariables == null ) {         &lt;br /&gt;    vmVariables = new HashMap&amp;lt; String, Object &amp;gt;();&lt;br /&gt;}&lt;br /&gt;vmVariables.put(&amp;#34;saomKey&amp;#34;, someValue);&lt;br /&gt;request.setAttribute(WebKeys.VM_VARIABLES, vmVariables );&lt;br /&gt;-------------------------------------------------------------------------------------------&lt;br /&gt;ii. In file portal_normal.vm (Access velocity variable)&lt;br /&gt;$someKey&lt;br /&gt;But not working. Please give any solution for my scenario.&lt;br /&gt;Thanks </summary>
    <dc:creator>Saurabh Khandelwal</dc:creator>
    <dc:date>2019-07-03T09:54:36Z</dc:date>
  </entry>
</feed>
