Message Boards

How do i get the correct edit-page entry in the layout table to a page

Niels Dohms, modified 3 Years ago.

How do i get the correct edit-page entry in the layout table to a page

New Member Posts: 8 Join Date: 12/6/19 Recent Posts
Hello,
i have a layoutIds of the pages that are in my navigation. But all those entries in the layout table of the database have a 0 in the classPK column. It seems if i create a new page, liferay creates two entries in the layout table for that page. The first entry is the page with a classPK of 0 and the second entry is the page that is used in the editmode with a classPK > 0. 


Right now i use the friendlyURL as the connection, but i can change the URL of the page. Is there a better link between these entries in the database? 
Thank you in advance
thumbnail
Olaf Kock, modified 3 Years ago.

RE: How do i get the correct edit-page entry in the layout table to a page

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts
Niels Dohms:

...all those entries in the layout table of the database have a 0 in the classPK column.
...
Right now i use the friendlyURL as the connection, but i can change the URL of the page. Is there a better link between these entries in the database?

Here's all you need to know about relationships in Liferay's Database.
With that knowledge, what is it that you're trying to achieve? Because the screenshot you posted seems to highlight existing functionality
Niels Dohms, modified 3 Years ago.

RE: How do i get the correct edit-page entry in the layout table to a page

New Member Posts: 8 Join Date: 12/6/19 Recent Posts
I want to create a sitemap portlet that contains links that are used in fragments. In the sitemap these links should be under the page in which the fragment with that link is used.
I know that i can get the the link with the FragmentEntryLinkLocalServiceUtil, but i need the FragmentEntryLinkId. I can get those by using the LayoutPageTemplateStructureRelLocalServiceUtil, but to get the LayoutPageTemplateStructureRelId i need the use the LayoutPageTemplateStructureLocalId, to get that id i need the groupId, classPK and classNameId of the page. I get the pages that should go on the sitemap by using the Navigation. But the classPK of the layouts that i get from these pages is 0. So i can't use all these LocalSerivceUtils to get to the FragmentEntryLinkIds. 
I don't know what the existing functionality to get the corresponding layout entry would be.
David Jones, modified 3 Years ago.

RE: How do i get the correct edit-page entry in the layout table to a page

New Member Post: 1 Join Date: 7/27/20 Recent Posts
The structure manufacturer page lets you review your structure format, add a page to the structure, or include some more fields.
Niels Dohms, modified 3 Years ago.

RE: How do i get the correct edit-page entry in the layout table to a page

New Member Posts: 8 Join Date: 12/6/19 Recent Posts
I want to clear up my intentions:
I want to create a sitemap portlet. That protlet should list all the pages that i can navigate to as list items. These items should include the title of the page and the link. I also want all the links used on a page to be included as sub-items of the page where the link occurs. These links are located in web-content elements and fragments.
So i need to get a page and then all the values of the lfr-editable links of the occuring fragments and and all the links used in the web-content elements that are located a that page.
Thank you in advance for your help.
Niels Dohms, modified 3 Years ago.

RE: How do i get the correct edit-page entry in the layout table to a page

New Member Posts: 8 Join Date: 12/6/19 Recent Posts
I know that i can use the LayoutLocalServiceUtil to get the coresponsding layout to the navItems, but the classPK of the layouts i get is 0. I use the classPK the get to the instances of the fragments. I can't find a method in the LayoutLocalServiceUtil to get from the page that i get via the navItems to the corresponding page (layoutEntry) that has the classPK != 0.

I am very thankful for every answer.