<?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>Get site id or name in theme</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=15681627" />
  <subtitle>Get site id or name in theme</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=15681627</id>
  <updated>2026-04-04T21:23:43Z</updated>
  <dc:date>2026-04-04T21:23:43Z</dc:date>
  <entry>
    <title>RE: Get site id or name in theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=29039070" />
    <author>
      <name>Avinash R</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=29039070</id>
    <updated>2013-09-23T12:26:18Z</updated>
    <published>2013-09-23T12:26:18Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;how can i get the same in the custom portlet implementation?&lt;br&gt;&lt;br&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; &lt;em&gt;found it out&lt;/em&gt;&lt;br&gt;&lt;br&gt;in portlet implementations use:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;PortalUtil.getScopeGroupId(request);&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;to get the site id. Although this means that the staging and live sites will have different set of data.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Avinash R</dc:creator>
    <dc:date>2013-09-23T12:26:18Z</dc:date>
  </entry>
  <entry>
    <title>RE: Get site id or name in theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=27185711" />
    <author>
      <name>Nahuel Barrios</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=27185711</id>
    <updated>2013-08-09T12:18:12Z</updated>
    <published>2013-08-09T12:18:12Z</published>
    <summary type="html">Hi, in our team we get it working (get the site name) by using:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Courier New"&gt;&lt;span style="font-size: 16px;"&gt;[indent]#set($groupLocalService= $serviceLocator.findService(&amp;#34;com.liferay.portal.service.GroupLocalService&amp;#34;))&lt;br /&gt;&amp;lt;h1&amp;gt;$groupLocalService.getGroup($groupId).getName()&amp;lt;/h1&amp;gt;[/indent]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Greetins!</summary>
    <dc:creator>Nahuel Barrios</dc:creator>
    <dc:date>2013-08-09T12:18:12Z</dc:date>
  </entry>
  <entry>
    <title>RE: Get site id or name in theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15683767" />
    <author>
      <name>Peter Hellstrand</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15683767</id>
    <updated>2012-08-17T11:25:44Z</updated>
    <published>2012-08-17T11:25:44Z</published>
    <summary type="html">Thank you both</summary>
    <dc:creator>Peter Hellstrand</dc:creator>
    <dc:date>2012-08-17T11:25:44Z</dc:date>
  </entry>
  <entry>
    <title>RE: Get site id or name in theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15683339" />
    <author>
      <name>Jignesh Vachhani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15683339</id>
    <updated>2012-08-17T10:31:22Z</updated>
    <published>2012-08-17T10:31:22Z</published>
    <summary type="html">You can use   &lt;strong&gt;$theme_display.getScopeGroupId()&lt;/strong&gt; in your theme</summary>
    <dc:creator>Jignesh Vachhani</dc:creator>
    <dc:date>2012-08-17T10:31:22Z</dc:date>
  </entry>
  <entry>
    <title>RE: Get site id or name in theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15682106" />
    <author>
      <name>Harish Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15682106</id>
    <updated>2012-08-17T10:02:57Z</updated>
    <published>2012-08-17T10:02:57Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Peter,&lt;br&gt;&lt;br&gt;site id is nothing but the group id in Liferay.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;long id = themeDisplay.getLayout().getGroupId();&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Regards&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Harish Kumar</dc:creator>
    <dc:date>2012-08-17T10:02:57Z</dc:date>
  </entry>
  <entry>
    <title>Get site id or name in theme</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15681626" />
    <author>
      <name>Peter Hellstrand</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=15681626</id>
    <updated>2012-08-17T09:36:39Z</updated>
    <published>2012-08-17T09:36:39Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hello&lt;br&gt;&lt;br&gt;Is it possible to get the site id or name in theme.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
If($site.getId == "the_site"){
    &amp;lt;a href="site url"&amp;gt;link on visible on my site&amp;lt;/a&amp;gt;
}

&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Peter Hellstrand</dc:creator>
    <dc:date>2012-08-17T09:36:39Z</dc:date>
  </entry>
</feed>
