掲示板

WCM link to a page in LR 6

thumbnail
11年前 に Rahul Bhattacharya によって更新されました。

WCM link to a page in LR 6

Junior Member 投稿: 58 参加年月日: 10/01/16 最新の投稿
Hi,
the WCM in LR 6 has a structure field for link to page.
When i set one i see in db its saved as 4@private-group. How am i supposed to show this on template.
There is absolutely no documentation guiding users on this.

thanks
Rahul
thumbnail
11年前 に Tejas Kanani によって更新されました。

RE: WCM link to a page in LR 6

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
Hi Rahul,
Lets say if you structure has below field which bring Link to Page feature.
<dynamic-element name="LinkToPage" type="link_to_layout" index-type="" repeatable="false" />


You can get its url using below code in your template,
$LinkToPage.getData()


Hope this helps
thumbnail
11年前 に Rahul Bhattacharya によって更新されました。

RE: WCM link to a page in LR 6

Junior Member 投稿: 58 参加年月日: 10/01/16 最新の投稿
Hi,
i dont think its working that way in 6.1.0.

this is the part in my structure
<dynamic-element instance-id="PN2odmhB" name="article-display-page" type="link_to_layout" index-type="">
<dynamic-content><![CDATA[4@private-group]]></dynamic-content>
</dynamic-element>


when i am doing $article-display-page.getData() i am just getting "4".

thanks
Rahul


Tejas Kanani:
Hi Rahul,
Lets say if you structure has below field which bring Link to Page feature.
<dynamic-element name="LinkToPage" type="link_to_layout" index-type="" repeatable="false" />


You can get its url using below code in your template,
$LinkToPage.getData()


Hope this helps
thumbnail
11年前 に Tejas Kanani によって更新されました。

RE: WCM link to a page in LR 6

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
Hi Rahul,

If you want the url of selected page try below code.

If your structure is,
<dynamic-element instance-id="PN2odmhB" name="article-display-page" type="link_to_layout" index-type="" />

Then your template to get page url would be
$article-display-page.getUrl()

If you want to generate link for the same.
<a href="$article-display-page.getUrl()">Link</a>


Hope this would help.

Regards,
Tejas