Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Diego Figueroa
Pull pages from different sites
29. April 2013 11:18
Antwort

Diego Figueroa

Rang: Junior Member

Nachrichten: 33

Eintrittsdatum: 11. März 2010

Neue Beiträge

Hello,

I was wondering if anyone else has constructed a navigation menu pulling items from other sites?

I currently have code that loops through all the sites taken from:

1$layoutService.getLayouts($site_id , true)


and for a regular page the children menu can be created using the standard liferay code:

 1
 2#foreach ($nav_child in $nav_item.getChildren())
 3  #if ($nav_child.isSelected())
 4    <li class="selected">
 5  #else
 6    <li>
 7  #end
 8      <a href="$nav_child.getURL()" $nav_child.getTarget()>$nav_child.getName()</a>
 9    </li>
10#end


However, for other sites where the page is of type URL I am not sure how to access the children and create a similar menu.

Any ideas would be appreciated.

Diego.
Anonym
RE: Pull pages from different sites
29. April 2013 11:26
Antwort

Anonym

redefine $nav_item by getting the navigation via layouts with a particular groupId
Diego Figueroa
RE: Pull pages from different sites
29. April 2013 11:32
Antwort

Diego Figueroa

Rang: Junior Member

Nachrichten: 33

Eintrittsdatum: 11. März 2010

Neue Beiträge

Thanks Bradley,

I guess there is no way to get what I need directly from the $nav_item element once I've determined it's the site I want right?

Diego.
Anonym
RE: Pull pages from different sites
29. April 2013 11:47
Antwort

Anonym

here is the link to an example of getting it to work
https://gist.github.com/randombrad/5483732
Diego Figueroa
RE: Pull pages from different sites
29. April 2013 12:12
Antwort

Diego Figueroa

Rang: Junior Member

Nachrichten: 33

Eintrittsdatum: 11. März 2010

Neue Beiträge

Thanks again Bradley!