yesjoar Posted December 11, 2012 Share Posted December 11, 2012 Hey there, I've started a new project today and now I have a small issue. I have a page (id: 1012) with a select-field (type: page) to display some other pages. In my case the other pages a team member. So when I go to my page with the id 1012 and say echo $page->fieldname; So it returns me the ID (1046) from the page, which I have chosen in my field. Now i want to display some other fields from the page with the id 1046, but it doesn't work for me. I tried: $apID = $page->myfield; // returns the correct ID $test = $pages->get($apID); echo $test->title; But this doesnt work. When I say get(1046) all workes fine. Any idea whats the problem is? Thanks (: y. Link to comment Share on other sites More sharing options...
onjegolders Posted December 11, 2012 Share Posted December 11, 2012 I think you can just use the normal API so: if your page field links to multiple pages: foreach ($page->page_links as $link) { echo "<h2>$link->title</h2>"; echo "<h4>$link->other_field</h4>"; } if not, it ought to just be: $page->page_link->my_field 2 Link to comment Share on other sites More sharing options...
yesjoar Posted December 11, 2012 Author Share Posted December 11, 2012 Thanks. The second works correctly. (: 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now