<?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 make web content variables global? (on web page)</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120547864" />
  <subtitle>How to make web content variables global? (on web page)</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120547864</id>
  <updated>2026-04-04T04:58:01Z</updated>
  <dc:date>2026-04-04T04:58:01Z</dc:date>
  <entry>
    <title>RE: How to make web content variables global? (on web page)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121383903" />
    <author>
      <name>Lee Jordan</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121383903</id>
    <updated>2022-03-22T19:12:15Z</updated>
    <published>2022-03-22T19:12:15Z</published>
    <summary type="html">&lt;p&gt;If it's not sensitive data for a quick and dirty hack you could use
  the HTML web storage feature to store a value from one portlet to
  retrieve in another. Probabbly with a DIV. You could use jQuery to
  quickly append the value into the receiving DIV. You can then say
  detect if the local storage is already filled and of the same value to
  avoid repeating the copy again.&lt;/p&gt;
&lt;p&gt;https://stackoverflow.com/questions/40791207/setting-and-getting-localstorage-with-jquery&lt;/p&gt;
&lt;p&gt;Or do the same using standard Javascript&lt;br /&gt; https://blog.logrocket.com/localstorage-javascript-complete-guide/&lt;/p&gt;
&lt;p&gt;Esentially you're copying one part of the DOM to the other so you
  could try this on a test html page on your desktop and open in the
  browser without doing it in Liferay. Once you got it going copy the
  storing bit in the first web content template and the retriving bit in
  the second web content.&lt;/p&gt;</summary>
    <dc:creator>Lee Jordan</dc:creator>
    <dc:date>2022-03-22T19:12:15Z</dc:date>
  </entry>
  <entry>
    <title>How to make web content variables global? (on web page)</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120547863" />
    <author>
      <name>Nikita Laitinen</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120547863</id>
    <updated>2021-01-13T12:57:50Z</updated>
    <published>2021-01-13T12:55:31Z</published>
    <summary type="html">&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I have two web content portlets on the page.&lt;br /&gt;First includes
  variable, for example, 'name'&lt;/p&gt;
&lt;p&gt;The question is how to get (read) that variable if I need it inside
  the second portlet that does not have access to the first portlet
  variables?&lt;br /&gt;Need somehow share variables between portlets, make
  them global on the web page...&lt;/p&gt;
&lt;p&gt;Could someone help me, please?&lt;br /&gt;
  &lt;br /&gt;I use LR 7.0&lt;/p&gt;</summary>
    <dc:creator>Nikita Laitinen</dc:creator>
    <dc:date>2021-01-13T12:55:31Z</dc:date>
  </entry>
</feed>
