This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » eZ Publish 5 Platform » get the ParentLocationId from the...
expandshrink

get the ParentLocationId from the actually location

get the ParentLocationId from the actually location

Tuesday 05 November 2013 9:03:04 pm - 1 reply

Hi,

outside my content block i can get some information about the parentLocationId using : {{ezpublish.systemUriString}} like /content/location/229 .

inside my eZFlow element this information will be replaced with the Uri String  like "/mypage".

I need the ParentLocationId to display some information inside the child location.

Is there some methods to get it directly inside my controller using my actually LocationId .

 

Thanks

 

PS: some information are lost within the ezpublish helper ! but not on the pagelayout.html.twig

Wednesday 06 November 2013 12:05:04 pm

ok,

I found one solution to get the parentLocationd from the actually location :

             $locationService = $this->getRepository()->getLocationService();
            $location = $locationService->loadLocation($LocationId);
            $parentLocationd= $location->parentLocationId;

what i have for is to display some child or other location Information in the parent page. something like child categories overview on the main page.

I bind my diferent location in an objektList attribute within my main page object.

In my template i get only the target object Ids as array using the objectList identifier. what i need is to get the LocationId from this Object to fetch the subcontent and to display it .

Right Now i can only get the parentLocationId only from my actually locationId.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from