Jump to content

Recommended Posts

Posted

Mmmm, again lost...

In the template "Product" there is a Page field "Teacher", which lists the teachers pages.

The page "Yoga" has assigned the template "Product" and selected a teacher.

Then how could I output the related page in the Yoga page?

$page->teacher;
 

This outputs nothing...

Can´t find a reference in the docs about this field type.

Posted

It's strange that it outputs nothing. It should output the page ID.

To output the title, for instance, you would do this:

$page->teacher->title;
Posted

Yes, it should output at least the page id(s). No errors? Of course you have to echo it out ;) first

Btw, I thought there was something in the docs about page reference field types? I can't find it now. Or was it a video?

Other questions...

is that a single or multiple page select? If the latter, it returns a page array hence needs looping through. 

Posted

Aaaaah, again a silly mistake...

The field is named "Teacher"...wrote "teacher" in code... code is case-sensitive... error!

I guess  is time to sleep.

Thanks and sorry for the dumb question.

PD There is a video about Page field types, pointing to cities related pages, but only in the admin side, no code shown.

Posted
Btw, I thought there was something in the docs about page reference field types? I can't find it now. Or was it a video?
 There is a video about Page field types, pointing to cities related pages, but only in the admin side, no code shown.

Well, i found the reference to Page Field in the documents, is in the wiki. I was learning PW following the API and Videos docs, as there are no link to the wiki in the PW home.

http://wiki.processwire.com/index.php/Main_Page

Posted
Well, i found the reference to Page Field in the documents, is in the wiki. I was learning PW following the API and Videos docs, as there are no link to the wiki in the PW home.

I'm in the process of converting everything in the Wiki over to the main site. The Wiki is getting all kinds of strange traffic from the logs, and it's database is many gigabytes in size (when it should be more like a megabyte). Basically, I don't trust MediaWiki here, at least since I'm not an expert with it. I'd feel more comfortable having all this content on the main site, so it should be there soon. 

  • Like 4
Posted

Didn´t know about that issue with MediaWiki but I thought it was strange to split the docs into different sources. I'd be great to have it all in the main site. I believe that for newcomers/newbies/starters, a detailed, comprehensive and easy to find documentation is invaluable; even more if you are a graphic designer and need baby steps to advance.

Posted

I agree. Maybe we could manage to make the docs on the website semi-collaborative by creating a "docs collaboration" forum, from where some things would be added to the website after discussion and approval. People seem to be much more active here than in the comments on the website.

  • 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...