<?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>Can the resource importer create layouts of type url or link_to_layout?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=53332259" />
  <subtitle>Can the resource importer create layouts of type url or link_to_layout?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=53332259</id>
  <updated>2026-04-05T21:56:58Z</updated>
  <dc:date>2026-04-05T21:56:58Z</dc:date>
  <entry>
    <title>RE: Can the resource importer create layouts of type url or link_to_layout?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119144268" />
    <author>
      <name>Aravinth Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119144268</id>
    <updated>2020-05-12T14:27:51Z</updated>
    <published>2020-05-12T14:27:51Z</published>
    <summary type="html">Hi All, &lt;br /&gt;We can achieve that through typesettings.&lt;br /&gt;&amp;#34;type&amp;#34;:&amp;#34;url&amp;#34;,&lt;br /&gt;&amp;#34;typeSettings&amp;#34;:&amp;#34;url=https://www.liferay.com&amp;#34;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Aravinth</summary>
    <dc:creator>Aravinth Kumar</dc:creator>
    <dc:date>2020-05-12T14:27:51Z</dc:date>
  </entry>
  <entry>
    <title>RE: Can the resource importer create layouts of type url or link_to_layout?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119138533" />
    <author>
      <name>Aravinth Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119138533</id>
    <updated>2020-05-11T11:52:17Z</updated>
    <published>2020-05-11T11:52:17Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;HI All,Is the type "URL" available in liferay 7.x versions resource importer. I m seeing below link has type:"url" but its not working. Please confirm.&lt;pre&gt;&lt;code&gt;[code]        {
            "friendlyURL": "/url-page",
            "name": "URL Page",
            "title": "URL Page",
            "type": "url"
        }&lt;/code&gt;&lt;/pre&gt;&lt;a href="https://help.liferay.com/hc/en-us/articles/360017883012-Importing-Resources-with-a-Theme"&gt;https://help.liferay.com/hc/en-us/articles/360017883012-Importing-Resources-with-a-Theme&lt;/a&gt;&lt;br&gt;Thanks in Advance.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Aravinth Kumar</dc:creator>
    <dc:date>2020-05-11T11:52:17Z</dc:date>
  </entry>
  <entry>
    <title>RE: Can the resource importer create layouts of type url or link_to_layout?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=54484350" />
    <author>
      <name>Travis Cory</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=54484350</id>
    <updated>2015-05-28T17:09:01Z</updated>
    <published>2015-05-28T17:09:01Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Here are the layout types from portal properties &lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;    #
    # Set the list of layout types. The display text of each of the layout types
    # is set in content/Language.properties and prefixed with "layout.types.".
    #
    # You can create new layout types and specify custom settings for each
    # layout type. End users input dynamic values as designed in the edit page.
    # End users see the layout as designed in the view page. The generated
    # URL can reference properties set in the edit page. Parentable layouts
    # can contain child layouts. You can also specify a comma delimited list of
    # configuration actions that will be called for your layout when it is
    # updated or deleted.
    #
    layout.types=portlet,panel,embedded,url,link_to_layout&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;you should be able to use link_to_layout&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Travis Cory</dc:creator>
    <dc:date>2015-05-28T17:09:01Z</dc:date>
  </entry>
  <entry>
    <title>RE: Can the resource importer create layouts of type url or link_to_layout?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=54416344" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=54416344</id>
    <updated>2015-05-27T12:51:49Z</updated>
    <published>2015-05-27T12:51:49Z</published>
    <summary type="html">Hi Wouter,&lt;br /&gt;&lt;br /&gt;Just for kicks, I would clone the 7 report, build the plugin and see if it works on 6.2. Slim chance I imagine but worth the 20 minutes worth of effort to see if you can be &amp;#34;ahead of the pack&amp;#34;. Alternatively, you could fork the 6.2 one and merge in the commits to make this work.</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2015-05-27T12:51:49Z</dc:date>
  </entry>
  <entry>
    <title>RE: Can the resource importer create layouts of type url or link_to_layout?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=54066163" />
    <author>
      <name>Wouter Vernaillen</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=54066163</id>
    <updated>2015-05-19T14:48:43Z</updated>
    <published>2015-05-19T14:48:43Z</published>
    <summary type="html">Hey Andew, I&amp;#39;m sorry for the very late reply. I&amp;#39;ve been off from work.&lt;br /&gt;&lt;br /&gt;Apparently the support for other layout types has been added in Liferay 7, but is not available yet in the Liferay 6.2 releases. &lt;br /&gt;We&amp;#39;re running 6.2 ga2, so we&amp;#39;re not able to use other layout types then portlet.&lt;br /&gt;&lt;br /&gt;FYI, this is the ticket: &lt;a href="https://issues.liferay.com/browse/LPS-50735"&gt;LPS-50735&lt;/a&gt; and the &lt;a href="https://github.com/liferay/liferay-plugins/commit/73656722d65b8902c2a9b6a500b6dd512c56bab3"&gt;commit&lt;/a&gt;</summary>
    <dc:creator>Wouter Vernaillen</dc:creator>
    <dc:date>2015-05-19T14:48:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: Can the resource importer create layouts of type url or link_to_layout?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=53355950" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=53355950</id>
    <updated>2015-05-04T15:51:01Z</updated>
    <published>2015-05-04T15:51:01Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I stand corrected. Check out this URL --&lt;br&gt;&lt;br&gt;https://github.com/liferay/liferay-plugins/blob/master/webs/resources-importer-web/docroot/WEB-INF/src/com/liferay/resourcesimporter/util/FileSystemImporter.java&lt;br&gt;&lt;br&gt;which has an addLayout method where you can see the properties of the JSON. One of the ones it checks is in fact type. That is the logic you want to reference I think.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
protected void addLayout(
			boolean privateLayout, long parentLayoutId,
			JSONObject layoutJSONObject)
		throws Exception {

		if (targetClassName.equals(LayoutSetPrototype.class.getName())) {
			privateLayout = true;
		}

		Map&amp;lt;locale, string&amp;gt; nameMap = getMap(layoutJSONObject, "name");
		Map&amp;lt;locale, string&amp;gt; titleMap = getMap(layoutJSONObject, "title");

		String type = layoutJSONObject.getString("type");

		if (Validator.isNull(type)) {
			type = LayoutConstants.TYPE_PORTLET;
		}

		String typeSettings = layoutJSONObject.getString("typeSettings");

		boolean hidden = layoutJSONObject.getBoolean("hidden");

		Map&amp;lt;locale, string&amp;gt; friendlyURLMap = new HashMap&amp;amp;lt;&amp;amp;gt;();

		String friendlyURL = layoutJSONObject.getString("friendlyURL");

		if (Validator.isNotNull(friendlyURL) &amp;amp;amp;&amp;amp;amp;
			!friendlyURL.startsWith(StringPool.SLASH)) {

			friendlyURL = StringPool.SLASH + friendlyURL;
		}

		friendlyURLMap.put(LocaleUtil.getDefault(), friendlyURL);

		ServiceContext serviceContext = new ServiceContext();

		serviceContext.setCompanyId(companyId);
		serviceContext.setScopeGroupId(groupId);
		serviceContext.setUserId(userId);

		ServiceContextThreadLocal.pushServiceContext(serviceContext);

		try {
			String layoutPrototypeName = layoutJSONObject.getString(
				"layoutPrototypeName");

			String layoutPrototypeUuid = null;

			if (Validator.isNotNull(layoutPrototypeName)) {
				LayoutPrototype layoutPrototype = getLayoutPrototype(
					companyId, layoutPrototypeName);

				layoutPrototypeUuid = layoutPrototype.getUuid();
			}
			else {
				layoutPrototypeUuid = layoutJSONObject.getString(
					"layoutPrototypeUuid");
			}

			if (Validator.isNotNull(layoutPrototypeUuid)) {
				boolean layoutPrototypeLinkEnabled = GetterUtil.getBoolean(
					layoutJSONObject.getString("layoutPrototypeLinkEnabled"),
					false);

				serviceContext.setAttribute(
					"layoutPrototypeLinkEnabled", layoutPrototypeLinkEnabled);

				serviceContext.setAttribute(
					"layoutPrototypeUuid", layoutPrototypeUuid);
			}

			Layout layout = LayoutLocalServiceUtil.addLayout(
				userId, groupId, privateLayout, parentLayoutId, nameMap,
				titleMap, null, null, null, type, typeSettings, hidden,
				friendlyURLMap, serviceContext);

			LayoutTypePortlet layoutTypePortlet =
				(LayoutTypePortlet)layout.getLayoutType();

			String layoutTemplateId = layoutJSONObject.getString(
				"layoutTemplateId", _defaultLayoutTemplateId);

			if (Validator.isNotNull(layoutTemplateId)) {
				layoutTypePortlet.setLayoutTemplateId(
					userId, layoutTemplateId, false);
			}

			JSONArray columnsJSONArray = layoutJSONObject.getJSONArray(
				"columns");

			addLayoutColumns(
				layout, LayoutTypePortletConstants.COLUMN_PREFIX,
				columnsJSONArray);

			LayoutLocalServiceUtil.updateLayout(
				groupId, layout.isPrivateLayout(), layout.getLayoutId(),
				layout.getTypeSettings());

			JSONArray layoutsJSONArray = layoutJSONObject.getJSONArray(
				"layouts");

			addLayouts(privateLayout, layout.getLayoutId(), layoutsJSONArray);
		}
		catch (Exception e) {
			if (_log.isWarnEnabled()) {
				_log.warn("Unable to import layout " + layoutJSONObject, e);
			}

			throw e;
		}
		finally {
			ServiceContextThreadLocal.popServiceContext();
		}
	}
&amp;lt;/locale,&amp;gt;&amp;lt;/locale,&amp;gt;&amp;lt;/locale,&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2015-05-04T15:51:01Z</dc:date>
  </entry>
  <entry>
    <title>RE: Can the resource importer create layouts of type url or link_to_layout?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=53355926" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=53355926</id>
    <updated>2015-05-04T15:48:28Z</updated>
    <published>2015-05-04T15:48:28Z</published>
    <summary type="html">Hey Wouter,&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t think that this is currently supported. It&amp;#39;s been a few months since I checked out the source code so it may have been added but I doubt it. The repo can be found here fo ryou to have a look https://github.com/liferay/liferay-plugins/tree/master/webs/resources-importer-web&lt;br /&gt;&lt;br /&gt;I know that you can specify typeSettings for some things (maybe a layout as well?). If you can do it for the layouts then that iw where I suspect you would need to set those values.</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2015-05-04T15:48:28Z</dc:date>
  </entry>
  <entry>
    <title>Can the resource importer create layouts of type url or link_to_layout?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=53332258" />
    <author>
      <name>Wouter Vernaillen</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=53332258</id>
    <updated>2015-05-04T09:41:26Z</updated>
    <published>2015-05-04T09:41:26Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Is it possible to create layouts of type 'url' or 'link_to_layout' with the resource importer?&lt;br&gt;What would be the syntax to use in sitemap.json?&lt;br&gt;&lt;br&gt;I tried many different parameters, like the example below, but with no success. The resource importer is always creating the layout with type 'portlet'.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;{
    "friendlyURL": "/linkToUrl",
    "name": "Link to URL",
    "title": "Link to URL",
    "type": "url",
    "url": "/otherUrl"
},
{
    "friendlyURL": "/linkToPage",
    "name": "Link to Page",
    "title": "Link to Page",
    "type": "link_to_layout",
    "linkToLayoutId": "16"
}
&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Wouter Vernaillen</dc:creator>
    <dc:date>2015-05-04T09:41:26Z</dc:date>
  </entry>
</feed>
