<?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 Theme: Login popup when clicking button</title>
  <link rel="self" href="https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=109146329" />
  <subtitle>Liferay Theme: Login popup when clicking button</subtitle>
  <id>https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=109146329</id>
  <updated>2026-08-02T11:20:46Z</updated>
  <dc:date>2026-08-02T11:20:46Z</dc:date>
  <entry>
    <title>RE: Liferay Theme: Login popup when clicking button</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113061239" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113061239</id>
    <updated>2019-04-08T13:42:17Z</updated>
    <published>2019-04-08T13:42:17Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Good question. Without digging too deep into the source, I was able to find this block of code&lt;br&gt;&lt;pre&gt;&lt;code&gt;AUI().ready(
   'liferay-hudcrumbs', 'liferay-navigation-interaction', 'liferay-sign-in-modal',
   function(A) {
      var navigation = A.one('#navigation');

      if (navigation) {
         navigation.plug(Liferay.NavigationInteraction);
      }

      var siteBreadcrumbs = A.one('#breadcrumbs');

      if (siteBreadcrumbs) {
         siteBreadcrumbs.plug(A.Hudcrumbs);
      }

      var signIn = A.one('li.sign-in a');

      if (signIn &amp;amp;amp;&amp;amp;amp; signIn.getData('redirect') !== 'true') {
         signIn.plug(Liferay.SignInModal);
      }
   }
);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;which you will find in the main.js in the classic theme. So I think if you have an li, with a class "sign-in" and the link of course in an &amp;lt;a&amp;gt; it should trigger the modal. Careful though, there is also a property that you can set to disable the modals --&lt;br&gt;​​​​​​​&lt;pre&gt;&lt;code&gt;#
# Set this to true to disable the login popup dialog. This should only be
# set to true if there is a custom login portlet that needs the "Sign In"
# link to redirect to another page.
#
login.dialog.disabled=false&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;let me know if that helps.&lt;span style="color: #333333"&gt;&lt;span style="font-family: Menlo, Monaco, Consolas, &amp;quot;Courier New&amp;quot;, monospace"&gt;&lt;span style="font-size: 14px;"&gt;​​​​​&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2019-04-08T13:42:17Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay Theme: Login popup when clicking button</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113043712" />
    <author>
      <name>Philip Teagle</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113043712</id>
    <updated>2019-04-06T17:54:15Z</updated>
    <published>2019-04-06T17:54:15Z</published>
    <summary type="html">&lt;blockquote&gt;Amar GrabusHi Andrew,&lt;br /&gt;&lt;br /&gt;thanks.&lt;br /&gt;&lt;br /&gt;I have one more question. How can i let the popup come instantly without first going to the login page and then by klicking on &amp;#39;Sign in&amp;#39; the login popup appears. Currently when I click on the button, he directs me to the login page of the login portlet.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Hi Armar,&lt;br /&gt;&lt;br /&gt;Did you ever get an answer on how to force the login popup without directing to the login page first?   I am facing the same issue.&lt;br /&gt;&lt;br /&gt;​​​​​​​Philip</summary>
    <dc:creator>Philip Teagle</dc:creator>
    <dc:date>2019-04-06T17:54:15Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay Theme: Login popup when clicking button</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109152046" />
    <author>
      <name>Amar Grabus</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109152046</id>
    <updated>2018-05-30T16:11:08Z</updated>
    <published>2018-05-30T16:11:08Z</published>
    <summary type="html">Hi Andrew,&lt;br /&gt;&lt;br /&gt;thanks.&lt;br /&gt;&lt;br /&gt;I have one more question. How can i let the popup come instantly without first going to the login page and then by klicking on &amp;#39;Sign in&amp;#39; the login popup appears. Currently when I click on the button, he directs me to the login page of the login portlet.</summary>
    <dc:creator>Amar Grabus</dc:creator>
    <dc:date>2018-05-30T16:11:08Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay Theme: Login popup when clicking button</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109143270" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109143270</id>
    <updated>2018-05-30T15:01:00Z</updated>
    <published>2018-05-30T15:01:00Z</published>
    <summary type="html">Hi Amar, &lt;br /&gt;&lt;br /&gt;In the markup for the page you should be able to find the portlet. I would assume that the div is being hidden? or perhaps you need to call the render() method on the sign-in module?</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2018-05-30T15:01:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay Theme: Login popup when clicking button</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109146776" />
    <author>
      <name>Amar Grabus</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109146776</id>
    <updated>2018-05-30T14:55:06Z</updated>
    <published>2018-05-30T14:55:06Z</published>
    <summary type="html">Hi Andrew,&lt;br /&gt;&lt;br /&gt;yes, that&amp;#39;s what I did. But I am not sure how to trigger the popup of the login when a user clicks on the button. With onClick and then specify what?</summary>
    <dc:creator>Amar Grabus</dc:creator>
    <dc:date>2018-05-30T14:55:06Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay Theme: Login popup when clicking button</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109143066" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109143066</id>
    <updated>2018-05-30T14:46:40Z</updated>
    <published>2018-05-30T14:46:40Z</published>
    <summary type="html">Hi Amar, &lt;br /&gt;&lt;br /&gt;I&amp;#39;m not sure I understand your question. In your theme you can detect whether or not the user is signed in, and then based on that, you can add the button and js (as you have above) to trigger the behavior.  Provided the login portlet is on the page then it should work. What I am not sure of off hand is whether or not the login portlet would be there (but I am assuming no). If it is not, then you can add a runtime portlet embedding inside the block as well.&lt;br /&gt;&lt;br /&gt;Or is there something I am missing?</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2018-05-30T14:46:40Z</dc:date>
  </entry>
  <entry>
    <title>Liferay Theme: Login popup when clicking button</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109146328" />
    <author>
      <name>Amar Grabus</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=109146328</id>
    <updated>2018-05-30T14:39:13Z</updated>
    <published>2018-05-30T14:39:13Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hey,&lt;br&gt;&lt;br&gt;I know how to popup the login portlat by klicking on 'Sign in':&lt;br&gt;&lt;br&gt;main.js:&lt;br&gt;&lt;pre&gt;&lt;code&gt;AUI().ready(
	'liferay-sign-in-modal',
	function(A) {	
		var signIn = A.one('.sign_in &amp;amp;gt; .menuText &amp;amp;gt; a');
		if (signIn &amp;amp;amp;&amp;amp;amp; signIn.getData('redirect') !== 'true') {
			     signIn.plug(Liferay.SignInModal);
		}
	}
);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;in ftl file:&lt;br&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;#if !is_signed_in&amp;amp;gt;
			&amp;lt;div class="sign_in"&amp;gt;
			&amp;lt;div class="menuText"&amp;gt;&amp;lt;a href="${sign_in_url}" rel="nofollow" data-redirect="false" id="sign_in" class="sign_in_custom" "&amp;gt;${sign_in_text}
			&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;
			&amp;lt;/div&amp;gt;
		&amp;lt;!--#if--&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;But how can I do the same with button somewhere in my theme (just popping up the login without going to the login page)? I'm working with Liferay 6.2.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Amar Grabus</dc:creator>
    <dc:date>2018-05-30T14:39:13Z</dc:date>
  </entry>
</feed>
