RE: Add /c/portal/logout to sitemap.json

Lukas Wilbrand, modified 7 Years ago. New Member Posts: 20 Join Date: 9/28/18 Recent Posts

Hello everybody,

 

I'm currently trying to install the logout via the navigation, because I do not show the dockbar.

I tried to put the link /c/portal/logout in my sitemap.json, but that did not work.
I also tried to log out via the com_liferay_login_web_portlet_LoginPortlet, but it did not work either.

I would like to add the logout url in my sitemap.json, but currently I don't know how or even if it's possible.

 

Best regards and thanks in advance!

Lukas

 

Lukas Wilbrand, modified 7 Years ago. New Member Posts: 20 Join Date: 9/28/18 Recent Posts
Does nobody know an answer?

I start my liferay-tomcat currently locally and try to install the logout in the sitemap.json.

I'm just trying to call localhost:8080/c/portal/logout via the navigation.

​​​​​​​I tried few things like: 
          "linkToPageURL": "/c/portal/logout",
          "url": "/c/portal/logout",
          "link": "/c/portal/logout",
          "type": "/c/portal/logout",
... but nothing worked.

Thanks in advance!
thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
I start my liferay-tomcat currently locally and try to install the logout in the sitemap.json.

Which version of Liferay? Do you have a sample theme with the resources importer folder already set up to assist people who might be interested in helping you without too much of a time commitment to finding an answer?

With that being said, the documentation for Liferay 7.0 in Importing Resources with a Theme provides the following example for URL page types:

{
    "friendlyURL": "/url-page",
    "name": "URL Page",
    "title": "URL Page",
    "type": "url"
},

Assuming the documentation is mostly correct but is incomplete (the URL page types are resolved using typeSettings), I would try setting the url variable in typeSettings. This is based on the idea that the portal property value for layout.url for the url layout type (reference), and that PortalImpl.getLayoutURL populates the variables using the properties set to typeSettings.

That would look like this:

{
    "friendlyURL": "/logout",
    "name": "Logout",
    "title": "Logout",
    "type": "url",
    "typeSettings": "url=/c/portal/logout"
},