Jump to content

Recommended Posts

Posted

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.

Posted

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

  • Like 2

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...