<?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>Predefined variables in Velocity templates</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=82182" />
  <subtitle>Predefined variables in Velocity templates</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=82182</id>
  <updated>2026-05-12T15:54:52Z</updated>
  <dc:date>2026-05-12T15:54:52Z</dc:date>
  <entry>
    <title>RE: Predefined variables in Velocity templates</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=82188" />
    <author>
      <name>Walter Gamba</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=82188</id>
    <updated>2006-08-03T10:08:10Z</updated>
    <published>2006-08-03T10:08:10Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Alexander Chow:&lt;/div&gt;&lt;blockquote&gt;Interesting point.  The code that stuffs all the variables into the CMS velocity template is com.liferay.portlet.journal.util.JournalVmUtil.transform().  And I believe all thoese tokens are there as well.  Take a look at the variables in com.liferay.portlet.journal.model.JournalStructure.  They are grabbed just before the transform occurs.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Thank you, problem solved!!! &lt;br /&gt;&lt;br /&gt;I;ve seen the classes you have pointed out. Unfortunately JournalVmUtil just seems to put in the context of the VM page the dynamic elements, i.e. the fields I&amp;#39; ve added to the base article.&lt;br /&gt;&lt;br /&gt;But, despite the oddly looking names, the JournalStructure holds the names of the default attributes of the articles!!!&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve tried putting in my template the line:&lt;br /&gt;&lt;br /&gt;$reserved-article-title.Data&lt;br /&gt;&lt;br /&gt;and it spits out the .. article Title&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;I&amp;#39;d suggest a different naming (and a small help) should, well, help, but for the time being, it is just what I was looking for!&lt;br /&gt;&lt;br /&gt;Again, thank you so much!&lt;br /&gt;Walter</summary>
    <dc:creator>Walter Gamba</dc:creator>
    <dc:date>2006-08-03T10:08:10Z</dc:date>
  </entry>
  <entry>
    <title>RE: Predefined variables in Velocity templates</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=82186" />
    <author>
      <name>Alexander Chow</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=82186</id>
    <updated>2006-08-02T21:59:28Z</updated>
    <published>2006-08-02T21:59:28Z</published>
    <summary type="html">Interesting point.  The code that stuffs all the variables into the CMS velocity template is com.liferay.portlet.journal.util.JournalVmUtil.transform().  And I believe all thoese tokens are there as well.  Take a look at the variables in com.liferay.portlet.journal.model.JournalStructure.  They are grabbed just before the transform occurs.</summary>
    <dc:creator>Alexander Chow</dc:creator>
    <dc:date>2006-08-02T21:59:28Z</dc:date>
  </entry>
  <entry>
    <title>Predefined variables in Velocity templates</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=82181" />
    <author>
      <name>Walter Gamba</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=82181</id>
    <updated>2006-08-02T16:46:57Z</updated>
    <published>2006-08-02T16:46:57Z</published>
    <summary type="html">Hi,&lt;br /&gt;&lt;br /&gt;I&amp;#39;m using the Journal CMS with articles. Since I&amp;#39;ve used Velocity before, I&amp;#39;d like to use this as the template engine.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve created a custom structure, and correctly associated it with a corresponding VM template.&lt;br /&gt;&lt;br /&gt;But I&amp;#39;m unable to find in the documentation, or in the source code, the name of the predefined variables which can be accessed in the template.&lt;br /&gt;&lt;br /&gt;To be more specific:&lt;br /&gt;&lt;br /&gt;My custom structure has two fields: subtitle and draft(boolean) .&lt;br /&gt;I can access and display them in a VM template ina straightforward manner:&lt;br /&gt;&lt;br /&gt;$subtitle.Data&lt;br /&gt;$draft.Data&lt;br /&gt;&lt;br /&gt;but how can I access the other, standard, attributes of an article, such as the title, the date, the expiring date, and so on?&lt;br /&gt;&lt;br /&gt;$title.Data &lt;br /&gt;&lt;br /&gt;does not work..&lt;br /&gt;&lt;br /&gt;Can anybody point out to me where to look for such names? Documents, source code, examplese.. anything&lt;br /&gt;&lt;br /&gt;Thanks in advance,&lt;br /&gt;&lt;br /&gt;Walter</summary>
    <dc:creator>Walter Gamba</dc:creator>
    <dc:date>2006-08-02T16:46:57Z</dc:date>
  </entry>
</feed>
