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 attribute node id
expandshrink

get attribute node id

get attribute node id

Wednesday 06 November 2013 11:36:54 am - 3 replies

Hello!
I try to access the attribute node id of my content object, but it's values are private. 
Is there a method to get these values? I couldn't find any solution yet.. 
Thanks for your help 

Wednesday 06 November 2013 11:51:52 am

Hi,

i cant understand what do you looking for, but if you do it throw a controller you will get it in the location contentInfo:

you fetch your actually location using e.g the the eZ fetchSubTree() method ant you add something like this:

 foreach ( $postResults->searchHits as $hit )
        {
            $posts[] = $hit->valueObject;
        }

and give the $posts array to your template. Then you have only to get the NodeId using:

 {{location.contentInfo.mainLocationId}}

Wednesday 06 November 2013 1:50:43 pm

Hi Ramzi Arfaoui, 
thanks for your quick reply!
My problem was that i had to create a download-link for a file (ezbinaryfile) - i rendered the whole object, and wasn't able to access the internal Fields to get the current attribute Id  where the downloadable file was located 

My first thought was i have to build a new download link template, but i got an hint to do it better. I will make an overwrite for content_fields.html.twig to change it. 

Thursday 07 November 2013 6:47:54 pm

Hi Michael

maybe this snippet helps

 

Cheers, Donat

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from