<?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>Liferay 7 - Add Web Content in Theme</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=76023812" />
  <subtitle>Liferay 7 - Add Web Content in Theme</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=76023812</id>
  <updated>2026-04-05T18:37:23Z</updated>
  <dc:date>2026-04-05T18:37:23Z</dc:date>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118619160" />
    <author>
      <name>Lee Jordan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118619160</id>
    <updated>2020-02-28T20:09:16Z</updated>
    <published>2020-02-28T20:09:16Z</published>
    <summary type="html">That would work for sure, but I have 500 sites. Nobody on my team is going to go through 500 sites setting a theme setting, multiply that by 3 because we have three environments. Nope.  The issue as stated with the article ID, it&amp;#39;s going to be different between three environments, so you can&amp;#39;t deploy the theme to different environments with an article ID hard-coded. &lt;br /&gt;&lt;br /&gt;Also ... defaultPreferences=&amp;#34;${freeMarkerPortletPreferences}&amp;#34; doesn&amp;#39;t seem to work and there&amp;#39;s zero helpful documentation, beyond setting the decorator to borderless. Which ok is helpful but that one example doesn&amp;#39;t then tell anyone how to access actual portlet configurations, there&amp;#39;s no codex or index of these possibilities, in fact there is zero documentation on the inbuilt portlets for developers period. Liferay documentation is written with a lot of assumptions by people who are close to Liferay. Nobody else has a chance with the documentation. Litterally the documentation is ok you can set barebones, you&amp;#39;re a pro!!!&lt;br /&gt;&lt;br /&gt;The only suggestion seems to be to get the portlet preferences by looking at the database? A front end developer is not going to be looking at a database table, sorry they just won&amp;#39;t.&lt;br /&gt;&lt;br /&gt;I am using theme settings though to allow users to hide show UI elements though.</summary>
    <dc:creator>Lee Jordan</dc:creator>
    <dc:date>2020-02-28T20:09:16Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118355986" />
    <author>
      <name>Fernando Fernandez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118355986</id>
    <updated>2020-01-28T10:46:08Z</updated>
    <published>2020-01-28T10:46:08Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Since this is the first result in a google search for this subject I think it's useful too add that since some time ago you can use the &lt;a href="https://portal.liferay.dev/docs/7-2/reference/-/knowledge_base/r/freemarker-taglib-macros"&gt;JSP taglibs in freemarker&lt;/a&gt;.&amp;nbsp;&lt;br&gt;This means that, to display an article&amp;nbsp; in the footer&amp;nbsp; you can include something like this in your theme's portal_normal.ftl:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;@liferay_journal["journal-article"]
&amp;amp;nbsp;   articleId=footer_article_id
&amp;amp;nbsp;   groupId=page_group.groupId
/&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Additionally, if you want to use a theme setting config you must:&lt;br&gt;&amp;nbsp;&lt;br&gt;1. Add the setting to the &lt;strong&gt;liferay-look-and-feel.xml&lt;/strong&gt; file from your theme&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;settings&amp;gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;lt;setting&amp;nbsp;configurable="true"&amp;nbsp;key="footer-article-id"&amp;nbsp;type="text"&amp;nbsp; /&amp;gt;
&amp;lt;/settings&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;2. Convert the setting into a variable in &lt;strong&gt;init_custom.ftl&lt;/strong&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;#assign&amp;amp;nbsp;footer_article_id&amp;amp;nbsp;=&amp;amp;nbsp;getterUtil.getString(themeDisplay.getThemeSetting("footer-article-id"))/&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;HTH&lt;br&gt;&lt;br&gt;Fernando&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fernando Fernandez</dc:creator>
    <dc:date>2020-01-28T10:46:08Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114765505" />
    <author>
      <name>Lee Jordan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114765505</id>
    <updated>2019-08-14T19:45:26Z</updated>
    <published>2019-08-14T19:45:26Z</published>
    <summary type="html">This was a frustrating read ... the OP isn&amp;#39;t wanting to embed a portlet but a web content article. I would like to do this to add a global footer links section in 7.0 but the trouble would be that the article ID&amp;#39;s would be different on DEV QA and Production servers. I looked at adding the article ID in the look-and-feel.xml as a theme custom field, that didn&amp;#39;t seem to work.</summary>
    <dc:creator>Lee Jordan</dc:creator>
    <dc:date>2019-08-14T19:45:26Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112078052" />
    <author>
      <name>Aritz Galdos</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112078052</id>
    <updated>2019-01-21T15:04:02Z</updated>
    <published>2019-01-21T15:04:02Z</published>
    <summary type="html">&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Here a link to some documentation.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;https://dev.liferay.com/es/develop/tutorials/-/knowledge_base/7-1/embedding-portlets-in-themes-and-layout-templates&lt;/p&gt;</summary>
    <dc:creator>Aritz Galdos</dc:creator>
    <dc:date>2019-01-21T15:04:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112068423" />
    <author>
      <name>Rashesh Ved</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112068423</id>
    <updated>2019-01-21T10:08:22Z</updated>
    <published>2019-01-21T10:08:22Z</published>
    <summary type="html">&lt;p&gt;Hii your reply help me alot.&lt;/p&gt;
&lt;p&gt;
  &lt;br /&gt; But can you please tell me in this article Id portion if i want
  to get article Id dynamically then how can I do it?&lt;br /&gt;
  &lt;br /&gt; In my freemarker theme template I tried to access
  J&lt;strong&gt;ournalArticleLocalServiceUtil &lt;/strong&gt; in following manner
  it is showing me error mentioning null or missing serviceLocator&lt;br /&gt;
  &lt;br /&gt; &amp;lt;#assign journalArticleLocalServiceUtil = serviceLocator.findService(&amp;quot;com.liferay.journal.service.JournalArticleLocalServiceUtil&amp;quot;)&amp;gt;&lt;br /&gt;
  &lt;br /&gt; I tried to remove all restricted variables as well from front
  side and restarted server still it's showing same error.&lt;/p&gt;</summary>
    <dc:creator>Rashesh Ved</dc:creator>
    <dc:date>2019-01-21T10:08:22Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=85758025" />
    <author>
      <name>Erik Cochran</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=85758025</id>
    <updated>2017-02-08T06:37:04Z</updated>
    <published>2017-02-08T06:37:04Z</published>
    <summary type="html">Hi Manushi,&lt;br /&gt;How did you figure this out? Also, shouldn&amp;#39;t the articleId and instanceId match? I found that another developer placed the instanceId in articleId but captilized the variable. Any reference documentation is much appreciated.&lt;br /&gt;E.</summary>
    <dc:creator>Erik Cochran</dc:creator>
    <dc:date>2017-02-08T06:37:04Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=81332461" />
    <author>
      <name>Manushi Jani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=81332461</id>
    <updated>2016-10-17T15:30:02Z</updated>
    <published>2016-10-17T15:30:02Z</published>
    <summary type="html">&amp;lt;#assign VOID = freeMarkerPortletPreferences.setValue(&amp;#34;portletSetupPortletDecoratorId&amp;#34;, &amp;#34;barebone&amp;#34;) /&amp;gt;&lt;br /&gt;&amp;lt;#assign theme_groupID = htmlUtil.escape(theme_display.getCompanyGroupId()?string) /&amp;gt;&lt;br /&gt;&amp;lt;#assign VOID = freeMarkerPortletPreferences.setValue(&amp;#34;groupId&amp;#34;, &amp;#34;yourscopegroupid&amp;#34;) /&amp;gt;&lt;br /&gt;&amp;lt;#assign VOID = freeMarkerPortletPreferences.setValue(&amp;#34;articleId&amp;#34;, &amp;#34;yourarticleid&amp;#34;) /&amp;gt;&lt;br /&gt;&lt;br /&gt;              &amp;lt;@liferay_portlet[&amp;#34;runtime&amp;#34;]&lt;br /&gt;		defaultPreferences=&amp;#34;${freeMarkerPortletPreferences}&amp;#34;&lt;br /&gt;		portletProviderAction=portletProviderAction.VIEW&lt;br /&gt;		instanceId=&amp;#34;anynameyoucangive&amp;#34;&lt;br /&gt;		portletName=&amp;#34;com_liferay_journal_content_web_portlet_JournalContentPortlet&amp;#34; /&amp;gt;&lt;br /&gt;		${freeMarkerPortletPreferences.reset()}&lt;br /&gt;	&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;Using this code exactly,you can embed the desired journal article(by passing the articleid) in web content display.Please don&amp;#39;t forget to include the line instanceId=&amp;#34;anynameyoucangive&amp;#34;,otherwise it won&amp;#39;t reflect.I wasted much time and found this.Hence it is very helpful.</summary>
    <dc:creator>Manushi Jani</dc:creator>
    <dc:date>2016-10-17T15:30:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76473231" />
    <author>
      <name>Matteo Gnocchi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76473231</id>
    <updated>2016-07-11T12:55:45Z</updated>
    <published>2016-07-11T12:55:45Z</published>
    <summary type="html">It works perfectly!&lt;br /&gt;Thank you very Much!!!!</summary>
    <dc:creator>Matteo Gnocchi</dc:creator>
    <dc:date>2016-07-11T12:55:45Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76461968" />
    <author>
      <name>teodor popescu</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76461968</id>
    <updated>2016-07-11T08:44:42Z</updated>
    <published>2016-07-11T08:44:42Z</published>
    <summary type="html">What about embedding into Velocity themes?&lt;br /&gt;Has anyone managed to find a solution?&lt;br /&gt;&lt;br /&gt;Thanks!</summary>
    <dc:creator>teodor popescu</dc:creator>
    <dc:date>2016-07-11T08:44:42Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76332056" />
    <author>
      <name>Michele Stoduto</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76332056</id>
    <updated>2016-07-06T21:19:11Z</updated>
    <published>2016-07-06T21:19:11Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;i've a possible solution, use runtime portlet into theme:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;#assign VOID = freeMarkerPortletPreferences.setValue("portletSetupPortletDecoratorId", "barebone")&amp;amp;gt;
&amp;amp;lt;@liferay_portlet["runtime"]
defaultPreferences="${freeMarkerPortletPreferences}"
portletProviderAction=portletProviderAction.VIEW
portletName="com_liferay_journal_content_web_portlet_JournalContentPortlet" /&amp;amp;gt;
${freeMarkerPortletPreferences.reset()}&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;the code is valid for a single portlet (Web Content) into theme.&lt;br&gt;If you want a multi portlet (Web Content) add instanceIdinto tag.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;#assign VOID = freeMarkerPortletPreferences.setValue("portletSetupPortletDecoratorId", "barebone")&amp;amp;gt;
&amp;amp;lt;@liferay_portlet["runtime"]
 defaultPreferences="${freeMarkerPortletPreferences}"
 portletProviderAction=portletProviderAction.VIEW
 instanceId="blablabla1"
 portletName="com_liferay_journal_content_web_portlet_JournalContentPortlet" /&amp;amp;gt;
 ${freeMarkerPortletPreferences.reset()}&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Michele Stoduto</dc:creator>
    <dc:date>2016-07-06T21:19:11Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76264419" />
    <author>
      <name>Michele Stoduto</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76264419</id>
    <updated>2016-07-05T09:06:41Z</updated>
    <published>2016-07-05T09:06:41Z</published>
    <summary type="html">Hi Matteo &lt;br /&gt;I&amp;#39;ve a similar problem for embedded web content in theme. &lt;br /&gt;Have you find any solution?&lt;br /&gt;Can you write the solution?&lt;br /&gt;&lt;br /&gt;Tnx</summary>
    <dc:creator>Michele Stoduto</dc:creator>
    <dc:date>2016-07-05T09:06:41Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76062363" />
    <author>
      <name>Matteo Gnocchi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76062363</id>
    <updated>2016-06-30T08:38:14Z</updated>
    <published>2016-06-30T08:38:14Z</published>
    <summary type="html">Thanks Travis&lt;br /&gt;Probably I&amp;#39;m doing something wrong but when I try to use &amp;#34;${journalContent}&amp;#34; I get this error: &amp;#34;The following has evaluated to null or missing&amp;#34;&lt;br /&gt;Have you been able to use it?&lt;br /&gt;Matteo</summary>
    <dc:creator>Matteo Gnocchi</dc:creator>
    <dc:date>2016-06-30T08:38:14Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76038778" />
    <author>
      <name>Travis Cory</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76038778</id>
    <updated>2016-06-29T16:25:51Z</updated>
    <published>2016-06-29T16:25:51Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hey Matteo,&lt;br&gt;&lt;br&gt;Sorry for the frustration. I'd try to see if you can use the Impl class and &lt;a href="https://github.com/liferay/liferay-portal/blob/master/modules/apps/web-experience/journal/journal-service/src/main/java/com/liferay/journal/util/impl/JournalContentImpl.java#L144-L147"&gt;this method&lt;/a&gt;. If calling &lt;pre&gt;&lt;code&gt;${journalContentImpl}&lt;/code&gt;&lt;/pre&gt; doesn't work try calling &lt;pre&gt;&lt;code&gt;${journalContent}&lt;/code&gt;&lt;/pre&gt; If you have article Id you can pass in the other variables really easily with variables from &lt;a href="https://github.com/liferay/liferay-portal/blob/master/modules/apps/foundation/frontend-theme/frontend-theme-unstyled/src/main/resources/META-INF/resources/_unstyled/templates/init.ftl"&gt;init.ftl&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Travis Cory</dc:creator>
    <dc:date>2016-06-29T16:25:51Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7 - Add Web Content in Theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76023811" />
    <author>
      <name>Matteo Gnocchi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=76023811</id>
    <updated>2016-06-29T10:59:38Z</updated>
    <published>2016-06-29T10:59:38Z</published>
    <summary type="html">Hi!&lt;br /&gt;I&amp;#39;d like to add a web content in my theme (FreeMarker) for Liferay 7.&lt;br /&gt;I tried to use the &amp;#34;journalContentUtil.getContent&amp;#34; method but it didn&amp;#39;t work.&lt;br /&gt;Probably the journalContentUtil does not exist in liferay 7 anymore  (&lt;a href="https://web.liferay.com/it/community/forums/-/message_boards/message/73417243"&gt;see more&lt;/a&gt;)&lt;br /&gt;How can I embed a webcontent in my freemarker theme for Liferay 7?&lt;br /&gt;Thanks!!</summary>
    <dc:creator>Matteo Gnocchi</dc:creator>
    <dc:date>2016-06-29T10:59:38Z</dc:date>
  </entry>
</feed>
